Axi5StreamInterface constructor

Axi5StreamInterface({
  1. int idWidth = 4,
  2. int dataWidth = 64,
  3. int userWidth = 0,
  4. int destWidth = 0,
  5. bool useKeep = false,
  6. bool useLast = false,
  7. bool useWakeup = false,
  8. bool useStrb = false,
})

Construct a new instance of an AXI5-S interface.

Default values in constructor are from official spec.

Implementation

Axi5StreamInterface({
  this.idWidth = 4,
  this.dataWidth = 64,
  this.userWidth = 0,
  this.destWidth = 0,
  this.useKeep = false,
  this.useLast = false,
  this.useWakeup = false,
  this.useStrb = false,
})  : strbWidth = dataWidth ~/ 8,
      super(
          main: true,
          prefix: 'T',
          useCrediting: false,
          sharedCredits: false,
          numRp: 0) {
  _validateParameters();

  setPorts([
    if (destWidth > 0) Logic.port('TDEST', destWidth),
    if (dataWidth > 0) Logic.port('TDATA', dataWidth),
    if (useStrb) Logic.port('TSTRB', strbWidth),
    if (useKeep) Logic.port('TKEEP', strbWidth),
    if (useLast) Logic.port('TLAST'),
    if (useWakeup) Logic.port('TWAKEUP'),
    if (idWidth > 0) Logic.port('TID', idWidth),
    if (userWidth > 0) Logic.port('TUSER'),
  ], [
    PairDirection.fromProvider,
  ]);
}