SpeculativeRecoveryContext constructor

SpeculativeRecoveryContext({
  1. required int checkpointWidth,
  2. required int orderTagWidth,
  3. required int addressWidth,
  4. required int causeWidth,
  5. String? name,
})

Creates speculative recovery context.

Implementation

SpeculativeRecoveryContext({
  required this.checkpointWidth,
  required this.orderTagWidth,
  required this.addressWidth,
  required this.causeWidth,
  String? name,
}) : super([
        Logic(name: 'checkpointValid'),
        Logic(name: 'checkpoint', width: checkpointWidth),
        Logic(name: 'retainedTail', width: orderTagWidth),
        Logic(name: 'redirectTarget', width: addressWidth),
        Logic(name: 'cause', width: causeWidth),
        Logic(name: 'trapValue', width: addressWidth),
        Logic(name: 'trap'),
        Logic(name: 'interrupt'),
      ], name: name ?? 'speculative_recovery_context') {
  if (checkpointWidth < 1 ||
      orderTagWidth < 1 ||
      addressWidth < 1 ||
      causeWidth < 1) {
    throw ArgumentError('Recovery context widths must be positive.');
  }
}