CaseAssociativeMemoryModelDescription constructor
Creates immutable exact-case associative memory geometry.
Implementation
CaseAssociativeMemoryModelDescription({
required this.entryCount,
required this.keyWidth,
required List<int> updateIndexWidths,
required List<int> lookupIndexWidths,
required this.trackValidity,
}) : updateIndexWidths = List.unmodifiable(updateIndexWidths),
lookupIndexWidths = List.unmodifiable(lookupIndexWidths) {
final minimumIndexWidth = (entryCount - 1).bitLength;
if (entryCount < 1 ||
keyWidth < 1 ||
lookupIndexWidths.isEmpty ||
[...updateIndexWidths, ...lookupIndexWidths]
.any((width) => width < 1 || width < minimumIndexWidth)) {
throw ArgumentError('Invalid exact-case associative geometry.');
}
}