LaneReliabilitySummary constructor

LaneReliabilitySummary({
  1. required Logic errorDetectedMask,
  2. required Logic correctedMask,
  3. required Logic uncorrectableMask,
  4. String name = 'lane_reliability_summary',
})

Creates a lane reliability summary.

Implementation

LaneReliabilitySummary({
  required Logic errorDetectedMask,
  required Logic correctedMask,
  required Logic uncorrectableMask,
  super.name = 'lane_reliability_summary',
}) : super(
        definitionName: 'LaneReliabilitySummary_L${errorDetectedMask.width}',
      ) {
  if (errorDetectedMask.width != correctedMask.width ||
      errorDetectedMask.width != uncorrectableMask.width) {
    throw RohdHclException('Lane reliability masks must have equal widths.');
  }
  final detected = addInput(
    'errorDetectedMask',
    errorDetectedMask,
    width: errorDetectedMask.width,
  );
  final corrected = addInput(
    'correctedMask',
    correctedMask,
    width: correctedMask.width,
  );
  final uncorrectable = addInput(
    'uncorrectableMask',
    uncorrectableMask,
    width: uncorrectableMask.width,
  );
  final errorCountValue = Count(detected).count;
  final correctedCountValue = Count(corrected).count;
  final uncorrectableCountValue = Count(uncorrectable).count;

  addOutput('anyError') <= detected.or();
  addOutput('anyUncorrectable') <= uncorrectable.or();
  addOutput('allDetectedCorrected') <= detected.or() & ~uncorrectable.or();
  addOutput('errorCount', width: errorCountValue.width) <= errorCountValue;
  addOutput('correctedCount', width: correctedCountValue.width) <=
      correctedCountValue;
  addOutput('uncorrectableCount', width: uncorrectableCountValue.width) <=
      uncorrectableCountValue;
}