KvCacheBlockLookupResult constructor
Creates a KV-cache block lookup result.
Implementation
KvCacheBlockLookupResult({
required this.entryCount,
required this.physicalBlockWidth,
required this.referenceCountWidth,
String name = 'kvCacheBlockLookupResult',
}) : super(
[
Logic(name: 'hit'),
Logic(name: 'entryIndex', width: widthFor(entryCount)),
Logic(name: 'physicalBlock', width: physicalBlockWidth),
Logic(name: 'referenceCount', width: referenceCountWidth),
Logic(name: 'duplicateMatch'),
],
name: name,
) {
if (entryCount < 1 || physicalBlockWidth < 1 || referenceCountWidth < 1) {
throw ArgumentError('KV-cache lookup-result shape is invalid.');
}
}