Axi4WriteInterface constructor

Axi4WriteInterface({
  1. int idWidth = 4,
  2. int addrWidth = 32,
  3. int lenWidth = 8,
  4. int dataWidth = 64,
  5. int awuserWidth = 32,
  6. int wuserWidth = 32,
  7. int buserWidth = 16,
  8. bool useLock = true,
})

Construct a new instance of an AXI4 interface.

Default values in constructor are from official spec.

Implementation

Axi4WriteInterface({
  this.idWidth = 4,
  this.addrWidth = 32,
  this.lenWidth = 8,
  this.dataWidth = 64,
  this.awuserWidth = 32,
  this.wuserWidth = 32,
  this.buserWidth = 16,
  this.useLock = true,
}) : strbWidth = dataWidth ~/ 8 {
  _validateParameters();

  setPorts([
    if (idWidth > 0) Logic.port('AWID', idWidth),
    Logic.port('AWADDR', addrWidth),
    if (lenWidth > 0) Logic.port('AWLEN', lenWidth),
    if (sizeWidth > 0) Logic.port('AWSIZE', sizeWidth),
    if (burstWidth > 0) Logic.port('AWBURST', burstWidth),
    if (useLock) Logic.port('AWLOCK'),
    if (cacheWidth > 0) Logic.port('AWCACHE', cacheWidth),
    Logic.port('AWPROT', protWidth),
    if (qosWidth > 0) Logic.port('AWQOS', qosWidth),
    if (regionWidth > 0) Logic.port('AWREGION', regionWidth),
    if (awuserWidth > 0) Logic.port('AWUSER', awuserWidth),
    Logic.port('AWVALID'),
    Logic.port('WDATA', dataWidth),
    Logic.port('WSTRB', strbWidth),
    Logic.port('WLAST'),
    if (wuserWidth > 0) Logic.port('WUSER', wuserWidth),
    Logic.port('WVALID'),
    Logic.port('BREADY'),
  ], [
    Axi4Direction.fromMain,
  ]);

  setPorts([
    if (idWidth > 0) Logic.port('BID', idWidth),
    if (brespWidth > 0) Logic.port('BRESP', brespWidth),
    if (buserWidth > 0) Logic.port('BUSER', buserWidth),
    Logic.port('BVALID'),
    Logic.port('AWREADY'),
    Logic.port('WREADY'),
  ], [
    Axi4Direction.fromSubordinate,
  ]);
}