KvCacheBlockLookupResult constructor

KvCacheBlockLookupResult({
  1. required int entryCount,
  2. required int physicalBlockWidth,
  3. required int referenceCountWidth,
  4. String name = 'kvCacheBlockLookupResult',
})

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.');
  }
}