hwtLib.amba package

This package is dedicated to component and utilities related to ARM AMBA interfaces.

This icludes:

  • AMBA AXI3

  • AMBA AXI3-lite

  • AMBA AXI4

  • AMBA AXI4-lite

  • AMBA AXI4-stream

  • AMBA ACE

  • and others

Available specifications:

Subpackages

Submodules

hwtLib.amba.ace module

class hwtLib.amba.ace.AR_MODE[source]

Bases: object

class BARRIER[source]

Bases: object

INNER = (1, 1, 0)
NON = (1, 0, 0)
OUTER = (1, 2, 0)
SYSTEM = (1, 3, 0)
class CACHE_MAINTENANCE[source]

Bases: object

class CLEAN_INVALID[source]

Bases: object

INNER = (0, 1, 9)
NON = (0, 0, 9)
OUTER = (0, 2, 9)
class CLEAN_SHARED[source]

Bases: object

INNER = (0, 1, 8)
NON = (0, 0, 8)
OUTER = (0, 2, 8)
class MAKE_INVALID[source]

Bases: object

INNER = (0, 1, 13)
NON = (0, 0, 13)
OUTER = (0, 2, 13)
class COHERENT[source]

Bases: object

class CLEAN_UNIQUE[source]

Bases: object

INNER = (0, 1, 11)
OUTER = (0, 2, 11)
class MAKE_UNIQUE[source]

Bases: object

INNER = (0, 1, 12)
OUTER = (0, 2, 12)
class READ_CLEAN[source]

Bases: object

INNER = (0, 1, 2)
OUTER = (0, 2, 2)
class READ_NOT_SHARED_DIRTY[source]

Bases: object

INNER = (0, 1, 3)
OUTER = (0, 2, 3)
class READ_ONCE[source]

Bases: object

INNER = (0, 1, 0)
OUTER = (0, 2, 0)
class READ_SHARED[source]

Bases: object

INNER = (0, 1, 1)
OUTER = (0, 2, 1)
class READ_UNIQUE[source]

Bases: object

INNER = (0, 1, 7)
OUTER = (0, 2, 7)
class DVM[source]

Bases: object

class COMPLETE[source]

Bases: object

INNER = (0, 1, 14)
OUTER = (0, 2, 14)
class MESSAGE[source]

Bases: object

INNER = (0, 2, 15)
OUTER = (0, 2, 15)
class NO_SNOOP[source]

Bases: object

class READ[source]

Bases: object

NON = (0, 0, 0)
SYSTEM = (0, 3, 0)
class hwtLib.amba.ace.Ace(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi4

https://static.docs.arm.com/ihi0022/d/IHI0022D_amba_axi_protocol_spec.pdf

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • ID_WIDTH - default value 6 of type int

  • ADDR_USER_WIDTH - default value 0 of type int

  • SNOOP_ADDR_WIDTH - default value 32 of type int

  • SNOOP_DATA_WIDTH - default value 32 of type int

HDL IO
AR_CLS

alias of Ace_addr

AW_CLS

alias of Ace_addr

_getIpCoreIntfClass()[source]
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.ace.AceSnoop_addr(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs

HDL params
  • SNOOP_ADDR_WIDTH - default value 32 of type int

HDL IO
class hwtLib.amba.ace.AceSnoop_data(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs

HDL params
  • SNOOP_DATA_WIDTH - default value 32 of type int

HDL IO
class hwtLib.amba.ace.AceSnoop_resp(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.ace.Ace_addr(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi4_addr

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • ID_WIDTH - default value 6 of type int

  • USER_WIDTH - default value 0 of type int

HDL IO
class hwtLib.amba.ace.BAR[source]

Bases: object

BARRIER = 1
IGNORE = 2
NORMAL = 0
SYNCHRONIZATION = 3
class hwtLib.amba.ace.CACHE[source]

Bases: object

DEVICE = 0
NON_CACHEABLE = 3
WRITE_BACK = 11
WRITE_THROUGH = 7
class hwtLib.amba.ace.DOMAIN[source]

Bases: object

INNER_SHARABLE = 1
NON_SHARABLE = 0
OUTER_SHARABLE = 2
SYSTEM = 3
hwtLib.amba.ace.setAceArMode(arbar, ardomain, arsnoop, transactionType)[source]

hwtLib.amba.aceLite module

class hwtLib.amba.aceLite.AceLite(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi4Lite

AMBA ACE-lite interface

https://static.docs.arm.com/ihi0022/d/IHI0022D_amba_axi_protocol_spec.pdf

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

HDL IO
AR_CLS

alias of AceLite_addr

AW_CLS

alias of AceLite_addr

_getIpCoreIntfClass()[source]
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.aceLite.AceLite_addr(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi4Lite_addr

HDL params
  • ADDR_WIDTH - default value 32 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]

hwtLib.amba.axi3 module

class hwtLib.amba.axi3.Axi3(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite

AMBA Axi3 bus interface

https://static.docs.arm.com/ihi0022/d/IHI0022D_amba_axi_protocol_spec.pdf

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • ID_WIDTH - default value 6 of type int

  • ADDR_USER_WIDTH - default value 0 of type int

HDL IO
AR_CLS

alias of Axi3_addr

AW_CLS

alias of Axi3_addr

B_CLS

alias of Axi3_b

LEN_WIDTH = 4
LOCK_WIDTH = 2
R_CLS

alias of Axi3_r

W_CLS

alias of Axi3_w

_getIpCoreIntfClass()[source]
class hwtLib.amba.axi3.Axi3_addr(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite_addr, Axi_id

Axi3 address channel interface

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • ID_WIDTH - default value 6 of type int

  • USER_WIDTH - default value 0 of type int

HDL IO
LEN_WIDTH = 4
LOCK_WIDTH = 2
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3.Axi3_addrAgent(sim: HdlSimulator, intf: Axi3_addr, allowNoReset=False)[source]

Bases: AxiStreamAgent

Simulation agent for Axi3_addr interface

input/output data stored in list under “data” property data contains tuples (id, addr, burst, cache, len, lock, prot, size, qos, optionally user)

__init__(sim: HdlSimulator, intf: Axi3_addr, allowNoReset=False)[source]
Parameters

rst – tuple (rst signal, rst_negated flag)

create_addr_req(addr, _len, _id=0, burst=1, cache=3, lock=0, prot=0, size=<object object>, user=None)[source]

Create a default AXI address transaction :note: transaction is created and returned but it is not added to a agent data

class hwtLib.amba.axi3.Axi3_b(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite_b, Axi_id

Axi3 write response channel interface

HDL params
  • ID_WIDTH - default value 0 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3.Axi3_bAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: BaseAxiAgent

Simulation agent for Axi3_b interface

input/output data stored in list under “data” property data contains tuples (id, resp)

get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwtLib.amba.axi3.Axi3_r(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite_r, Axi_id

Axi 3 read channel interface

HDL params
  • ID_WIDTH - default value 6 of type int

  • DATA_WIDTH - default value 64 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3.Axi3_rAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: BaseAxiAgent

Simulation agent for Axi4_r interface

input/output data stored in list under “data” property data contains tuples (id, data, resp, last)

get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwtLib.amba.axi3.Axi3_w(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs, Axi_strb

Axi3 write channel interface (simplified AxiStream)

HDL params
  • ID_WIDTH - default value 0 of type int

  • DATA_WIDTH - default value 64 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3.IP_Axi3[source]

Bases: IP_Axi3Lite

IP core interface meta for Axi3 interface

__init__()[source]
library
name
postProcess(component: Component, packager: IpPackager, thisIf: Axi3)[source]
vendor
version

hwtLib.amba.axi3Lite module

class hwtLib.amba.axi3Lite.Axi3Lite(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Interface

AMBA AXI3-lite interface

https://static.docs.arm.com/ihi0022/d/IHI0022D_amba_axi_protocol_spec.pdf

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

HDL IO
AR_CLS

alias of Axi3Lite_addr

AW_CLS

alias of Axi3Lite_addr

B_CLS

alias of Axi3Lite_b

LEN_WIDTH = 0
R_CLS

alias of Axi3Lite_r

W_CLS

alias of Axi3Lite_w

_getAddrStep()[source]
Returns

how many bits is one unit of address (e.g. 8 bits for char * pointer, 36 for 36 bit bram)

_getIpCoreIntfClass()[source]
_getWordAddrStep()[source]
Returns

size of one word in unit of address

_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3Lite.Axi3LiteAgent(sim: HdlSimulator, intf)[source]

Bases: AgentBase

Composite simulation agent with agent for every axi channel change of enable is propagated to each child

data for each agent is stored in agent for given channel (ar, aw, r, … property)

__init__(sim: HdlSimulator, intf)[source]
create_addr_req(*args, **kwargs)[source]
getDrivers()[source]

Called before simulation to collect all drivers of interfaces from this agent

getEnable()[source]
getMonitors()[source]

Called before simulation to collect all monitors of interfaces from this agent

setEnable(en)[source]
class hwtLib.amba.axi3Lite.Axi3Lite_addr(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs

HDL params
  • ADDR_WIDTH - default value 32 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3Lite.Axi3Lite_addrAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: BaseAxiAgent

Variables

~.data – iterable of addr

create_addr_req(addr, prot=None)[source]
get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwtLib.amba.axi3Lite.Axi3Lite_b(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3Lite.Axi3Lite_bAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: BaseAxiAgent

Variables

~.data – iterable of resp

get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwtLib.amba.axi3Lite.Axi3Lite_r(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs

HDL params
  • DATA_WIDTH - default value 64 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3Lite.Axi3Lite_w(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs

HDL params
  • DATA_WIDTH - default value 64 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi3Lite.Axi3Lite_wAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: BaseAxiAgent

Variables

~.data – iterable of tuples (data, strb)

get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwtLib.amba.axi3Lite.AxiLite_rAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: BaseAxiAgent

Variables

~.data – iterable of tuples (data, resp)

get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwtLib.amba.axi3Lite.IP_Axi3Lite[source]

Bases: IntfIpMeta

__init__()[source]
_toLowerCase(d)[source]
asQuartusTcl(buff: List[str], version: str, component: Component, packager: IpPackager, thisIf: Interface)[source]

Add interface to Quartus tcl

Parameters
  • buff – line buffer for output

  • version – Quartus version

  • intfName – name of top interface

  • component – component object from ipcore generator

  • packager – instance of IpPackager which is packagin current design

  • allInterfaces – list of all interfaces of top unit

  • thisIf – interface to add into Quartus TCL

get_quartus_map()[source]
library
name
postProcess(component: Component, packager: IpPackager, thisIf: Axi3Lite)[source]
vendor
version

hwtLib.amba.axi4 module

class hwtLib.amba.axi4.Axi4(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3

AMBA AXI4 bus interface https://static.docs.arm.com/ihi0022/d/IHI0022D_amba_axi_protocol_spec.pdf

Variables
  • ~.ar – read address channel

  • ~.r – read data channel

  • ~.aw – write address channel

  • ~.w – write data channel

  • ~.b – write acknowledge channel

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

  • ID_WIDTH - default value 6 of type int

  • ADDR_USER_WIDTH - default value 0 of type int

HDL IO
AR_CLS

alias of Axi4_addr

AW_CLS

alias of Axi4_addr

B_CLS

alias of Axi4_b

LEN_WIDTH = 8
LOCK_WIDTH = 1
R_CLS

alias of Axi4_r

W_CLS

alias of Axi4_w

_ag: Optional[AgentBase]
_associatedClk: Optional[Interface]
_associatedRst: Optional[Interface]
_ctx: Optional[RtlNetlist]
_direction: INTF_DIRECTION
_getIpCoreIntfClass()[source]
_hdl_port: Optional[HdlPortItem]
_masterDir: DIRECTION
_name: Optional[str]
_parent: Optional['Unit']
_setAttrListener: Optional[Callable[[str, object], None]]
class hwtLib.amba.axi4.Axi4_addr(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3_addr

Axi4 address channel interface (axi3 address channel with different size of len and lock signals and additional qos signal)

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • ID_WIDTH - default value 6 of type int

  • USER_WIDTH - default value 0 of type int

HDL IO
LEN_WIDTH = 8
LOCK_WIDTH = 1
_ag: Optional[AgentBase]
_associatedClk: Optional[Interface]
_associatedRst: Optional[Interface]
_ctx: Optional[RtlNetlist]
_direction: INTF_DIRECTION
_hdl_port: Optional[HdlPortItem]
_initSimAgent(sim: HdlSimulator)[source]
_masterDir: DIRECTION
_name: Optional[str]
_parent: Optional['Unit']
_setAttrListener: Optional[Callable[[str, object], None]]
class hwtLib.amba.axi4.Axi4_addrAgent(sim: HdlSimulator, intf: Axi3_addr, allowNoReset=False)[source]

Bases: AxiStreamAgent

__init__(sim: HdlSimulator, intf: Axi3_addr, allowNoReset=False)[source]
Parameters

rst – tuple (rst signal, rst_negated flag)

create_addr_req(addr, _len, _id=0, burst=1, cache=3, lock=0, prot=0, size=<object object>, qos=0, user=None)[source]

Create a default AXI address transaction :note: transaction is created and returned but it is not added to a agent data

class hwtLib.amba.axi4.Axi4_b(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3_b

Axi4 write response channel interface (same as Axi3_b)

HDL params
  • ID_WIDTH - default value 0 of type int

HDL IO
class hwtLib.amba.axi4.Axi4_r(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3_r

Axi4 read channel interface (same as r Axi3_r)

HDL params
  • ID_WIDTH - default value 6 of type int

  • DATA_WIDTH - default value 64 of type int

HDL IO
class hwtLib.amba.axi4.Axi4_w(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs, Axi_strb

Axi4 write channel interface (Axi3_w without id signal)

HDL params
  • DATA_WIDTH - default value 64 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi4.IP_Axi4[source]

Bases: IP_Axi3

IP core interface meta for Axi4 interface

__init__()[source]
library
name
vendor
version

hwtLib.amba.axi4Lite module

class hwtLib.amba.axi4Lite.Axi4Lite(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite

Axi4-lite bus interface (Same as Axi3Lite just address channels do have “prot” signal)

HDL params
  • ADDR_WIDTH - default value 32 of type int

  • DATA_WIDTH - default value 64 of type int

HDL IO
AR_CLS

alias of Axi4Lite_addr

AW_CLS

alias of Axi4Lite_addr

B_CLS

alias of Axi4Lite_b

R_CLS

alias of Axi4Lite_r

W_CLS

alias of Axi4Lite_w

_ag: Optional[AgentBase]
_associatedClk: Optional[Interface]
_associatedRst: Optional[Interface]
_ctx: Optional[RtlNetlist]
_direction: INTF_DIRECTION
_getIpCoreIntfClass()[source]
_hdl_port: Optional[HdlPortItem]
_masterDir: DIRECTION
_name: Optional[str]
_parent: Optional['Unit']
_setAttrListener: Optional[Callable[[str, object], None]]
class hwtLib.amba.axi4Lite.Axi4Lite_addr(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite_addr

Axi3Lite_addr with “prot” signal added.

HDL params
  • ADDR_WIDTH - default value 32 of type int

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi4Lite.Axi4Lite_addrAgent(sim: HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: Axi3Lite_addrAgent

Variables

~.data – iterable of addr

create_addr_req(addr, prot=0)[source]
get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwtLib.amba.axi4Lite.Axi4Lite_b(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite_b

(Same as Axi3Lite_b)

HDL IO
class hwtLib.amba.axi4Lite.Axi4Lite_r(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite_r

(Same as Axi3Lite_r)

HDL params
  • DATA_WIDTH - default value 64 of type int

HDL IO
class hwtLib.amba.axi4Lite.Axi4Lite_w(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi3Lite_w

(Same as Axi3Lite_w)

HDL params
  • DATA_WIDTH - default value 64 of type int

HDL IO
class hwtLib.amba.axi4Lite.IP_Axi4Lite[source]

Bases: IP_Axi3Lite

IP core meta description for Axi4-lite interface

__init__()[source]
library
name
vendor
version

hwtLib.amba.axi_intf_common module

hwtLib.amba.axi_intf_common.AxiMap(prefix, listOfNames, d=None)[source]
class hwtLib.amba.axi_intf_common.Axi_hs(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: HandshakeSync

AXI handshake interface with ready and valid signal (same as HandshakeSync just vld is valid and rd is ready) transaction happens when both ready and valid are high

Variables
  • ~.ready – when high slave is ready to receive data

  • ~.valid – when high master is sending data to slave

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axi_intf_common.Axi_id(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Interface

HDL params
  • ID_WIDTH - default value 0 of type int

class hwtLib.amba.axi_intf_common.Axi_strb(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Interface

HDL params
  • DATA_WIDTH - default value 64 of type int

HDL IO
class hwtLib.amba.axi_intf_common.Axi_user(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Interface

hwtLib.amba.axis module

class hwtLib.amba.axis.AxiStream(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Axi_hs, Axi_id, Axi_user, Axi_strb

AMBA AXI-stream interface https://static.docs.arm.com/ihi0051/a/IHI0051A_amba4_axi4_stream_v1_0_protocol_spec.pdf

Variables
  • ~.IS_BIGENDIAN – Param which specifies if interface uses bigendian byte order or little-endian byte order

  • ~.DATA_WIDTH – Param which specifies width of data signal

  • ~.HAS_STRB – if set strb signal is present

  • ~.HAS_KEEP – if set keep signal is present

  • ~.ID_WIDTH – if > 0 id signal is present and this is it’s width

  • ~.DEST_WIDTH – if > 0 dest signal is present and this is it’s width

  • ~.id – optional signal wich specifies id of transaction

  • ~.dest – optional signal which specifies destination of transaction

  • ~.data – main data signal

  • ~.keep – optional signal which signalize which bytes should be keept and which should be discarded

  • ~.strb – optional signal which signalize which bytes are valid

  • ~.last – signal which if high this data is last in this frame

  • ~.user – optional signal which can be used for arbitrary purposes

HDL params
  • IS_BIGENDIAN - default value False of type bool

  • USE_STRB - default value False of type bool

  • USE_KEEP - default value False of type bool

  • ID_WIDTH - default value 0 of type int

  • DEST_WIDTH - default value 0 of type int

  • DATA_WIDTH - default value 64 of type int

  • USER_WIDTH - default value 0 of type int

HDL IO
_getIpCoreIntfClass()[source]
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axis.AxiStreamAgent(sim: HdlSimulator, intf: AxiStream, allowNoReset=False)[source]

Bases: BaseAxiAgent, UniversalHandshakedAgent

Simulation agent for AxiStream interface

input/output data stored in list under “data” property data contains tuples

Format of data tules is derived from signals on AxiStream interface Order of values coresponds to definition of interface signals. If all signals are present fotmat of tuple will be (id, dest, data, strb, keep, user, last)

__init__(sim: HdlSimulator, intf: AxiStream, allowNoReset=False)[source]
Parameters

rst – tuple (rst signal, rst_negated flag)

class hwtLib.amba.axis.IP_AXIStream[source]

Bases: IntfIpMeta

Class which specifies how to describe AxiStream interfaces in IP-core

__init__()[source]
library
name
vendor
version
hwtLib.amba.axis._axis_recieve_bytes(ag_data: Deque[Union[Tuple[BitsVal, BitsVal, BitsVal, BitsVal], Tuple[BitsVal, BitsVal, BitsVal], Tuple[BitsVal, BitsVal]]], D_B: int, use_keep: bool, use_id: bool) Tuple[int, List[int]][source]
Parameters
  • ag_data – list of axi stream words, number of item in tuple depends on use_keep and use_id

  • use_keep – specifies if input tuples contain keep mask

  • use_id – specifies if input tuples contain axi stream id

  • D_B – number of bytes in word

hwtLib.amba.axis._axis_send_bytes(axis: AxiStream, data_B: List[int], withStrb: bool, offset: int) List[Tuple[int, int, int]][source]
hwtLib.amba.axis.axis_mask_propagate_best_effort(src: AxiStream, dst: AxiStream)[source]
hwtLib.amba.axis.axis_recieve_bytes(axis: AxiStream) Tuple[int, List[int]][source]

Read data from AXI Stream agent in simulation and use keep signal to mask out unused bytes

hwtLib.amba.axis.axis_send_bytes(axis: AxiStream, data_B: Union[List[int], bytes], offset=0) None[source]
Parameters
  • axis – AxiStream master which is driver from the simulation

  • data_B – bytes to send

  • offset – number of empty bytes which should be added before data in frame (and use keep signal to mark such a bytes)

hwtLib.amba.axis.packAxiSFrame(dataWidth, structVal, withStrb=False)[source]

pack data of structure into words on axis interface Words are tuples (data, last) or (data, mask, last) depending on args.

hwtLib.amba.axis.unpackAxiSFrame(structT: HdlType, frameData: Deque[Union[BitsVal, int]], getDataFn=None, dataWidth=None)[source]

opposite of packAxiSFrame

hwtLib.amba.axis_fullduplex module

class hwtLib.amba.axis_fullduplex.AxiStreamFullDuplex(masterDir=DIRECTION.OUT, hdl_name: Optional[Union[str, Dict[str, str]]] = None, loadConfig=True)[source]

Bases: Interface

HDL params
  • IS_BIGENDIAN - default value False of type bool

  • USE_STRB - default value False of type bool

  • USE_KEEP - default value False of type bool

  • ID_WIDTH - default value 0 of type int

  • DEST_WIDTH - default value 0 of type int

  • DATA_WIDTH - default value 64 of type int

  • USER_WIDTH - default value 0 of type int

  • HAS_RX - default value True of type bool

  • HAS_TX - default value True of type bool

HDL IO
_initSimAgent(sim: HdlSimulator)[source]
class hwtLib.amba.axis_fullduplex.AxiStreamFullDuplexAgent(sim: HdlSimulator, intf: AxiStreamFullDuplex)[source]

Bases: AgentBase

__init__(sim: HdlSimulator, intf: AxiStreamFullDuplex)[source]
getDrivers()[source]

Called before simulation to collect all drivers of interfaces from this agent

getMonitors()[source]

Called before simulation to collect all monitors of interfaces from this agent

hwtLib.amba.constants module

Constant used for a signals in AXI, AXI-lite interfaces.

https://static.docs.arm.com/ihi0022/d/IHI0022D_amba_axi_protocol_spec.pdf

hwtLib.amba.constants.BYTES_IN_TRANS(n)[source]
hwtLib.amba.constants.CACHE_DEFAULT = 3

ARCACHE[3:0]

AWCACHE[3:0]

Memory type

0000

0000

Device Non-bufferable

0001

0001

Device Bufferable

0010

0010

Normal Non-cacheable Non-bufferable

0011

0011

Normal Non-cacheable Bufferable

1010

0110

Write-through No-allocate

1110 (0110)

0110

Write-through Read-allocate

1010

1110 (1010)

Write-through Write-allocate

1110

1110

Write-through Read and Write-allocate

1011

0111

Write-back No-allocate

1111 (0111)

0111

Write-back Read-allocate

1011

1111 (1011)

Write-back Write-allocate

1111

1111

Write-back Read and Write-allocate

hwtLib.amba.constants.LOCK_DEFAULT = 0

RESP

Response

Description

0b00

OKAY

Normal access success

0b01

EXOKAY

Exclusive access success

0b10

SLVERR

Slave error

0b11

DECERR

Decode error

hwtLib.amba.constants.PROT_DEFAULT = 0
Note

“prot” is an access permissions signals that can be used to protect against illegal transactions.

PROT

Value

Function

[0]

0

Unprivileged access

1

Privileged access

[1]

0

Secure access

1

Non-secure access

[2]

0

Data access

1

Instruction access