ProtectedMemoryLayout constructor

ProtectedMemoryLayout({
  1. required ProtectionCodec<Logic, Logic> laneCodec,
  2. required int laneCount,
  3. required ProtectedPartialWritePolicy partialWritePolicy,
})

Creates and validates a protected memory layout.

Implementation

ProtectedMemoryLayout({
  required this.laneCodec,
  required this.laneCount,
  required this.partialWritePolicy,
}) {
  if (laneCount < 1) {
    throw RohdHclException('Protected memory lane count must be positive.');
  }
  if (partialWritePolicy == ProtectedPartialWritePolicy.independentLanes &&
      laneCount == 1) {
    throw RohdHclException(
        'Independent-lane protection requires at least two lanes.');
  }
}