CacheTransactionRequest<T extends Logic, M extends Logic, C extends Logic> constructor

CacheTransactionRequest<T extends Logic, M extends Logic, C extends Logic>({
  1. required int tokenWidth,
  2. required T dataSchema,
  3. required int writeMaskWidth,
  4. required M lineMetadataSchema,
  5. required C contextSchema,
  6. int? addrWidth,
  7. int operationWidth = 2,
  8. String name = 'cache_request',
  9. @Deprecated('Use addrWidth instead.') int? addressWidth,
})

Creates a request schema.

addressWidth is the deprecated former name of addrWidth.

Implementation

CacheTransactionRequest({
  required int tokenWidth,
  required T dataSchema,
  required int writeMaskWidth,
  required M lineMetadataSchema,
  required C contextSchema,
  int? addrWidth,
  int operationWidth = 2,
  String name = 'cache_request',
  @Deprecated('Use addrWidth instead.') int? addressWidth,
}) : super([
        Logic(name: 'operation', width: operationWidth),
        Logic(
            name: 'address',
            width: resolveAddrWidth(addrWidth, addressWidth)),
        Logic(name: 'token', width: tokenWidth),
        cloneTypedPayload(dataSchema, name: 'data'),
        Logic(name: 'writeMask', width: writeMaskWidth),
        cloneTypedPayload(lineMetadataSchema, name: 'lineMetadata'),
        cloneTypedPayload(contextSchema, name: 'requestContext'),
      ], name: name) {
  if (operationWidth < 2 ||
      resolveAddrWidth(addrWidth, addressWidth) < 1 ||
      tokenWidth < 1 ||
      writeMaskWidth < 1 ||
      dataSchema.width % writeMaskWidth != 0) {
    throw ArgumentError('Invalid cache transaction request geometry.');
  }
}