hwtLib.ipif package

Submodules

hwtLib.ipif.endpoint module

class hwtLib.ipif.endpoint.IpifEndpoint(structTemplate, intfCls=<class 'hwtLib.ipif.intf.Ipif'>, shouldEnterFn=None)[source]

Bases: hwtLib.abstract.busEndpoint.BusEndpoint

Delegate request from bus to fields of structure

Attention:interfaces are dynamically generated from names of fileds in structure template
Attention:byte enable and register clock enable signals are ignored
__init__(structTemplate, intfCls=<class 'hwtLib.ipif.intf.Ipif'>, shouldEnterFn=None)[source]
Parameters:
  • structTemplate – instance of HStruct which describes address space of this endpoint
  • intfCls – class of bus interface which should be used
  • shouldEnterFn – function(structField) return (shouldEnter, shouldUse) where shouldEnter is flag that means iterator over this interface should look inside of this actual object and shouldUse flag means that this field should be used (to create interface)
_getAddrStep()
Returns:how many bits is one unit of address (f.e. 8 bits for char * pointer, 36 for 36 bit bram)
_getWordAddrStep()
Returns:size of one word in unit of address
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr

hwtLib.ipif.intf module

class hwtLib.ipif.intf.Ipif(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]

Bases: hwt.synthesizer.interface.Interface

READ = 1
WRITE = 0
_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance
  • called in __init__ of class
_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)
  • _declr method is called after _config
  • if this object is Unit all interfaces are threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_getAddrStep()[source]
Returns:how many bits is one unit of address (f.e. 8 bits for char * pointer, 36 for 36 bit bram)
_getWordAddrStep()[source]
Returns:size of one word in unit of address
_initSimAgent()[source]
class hwtLib.ipif.intf.IpifAgent(intf, allowNoReset=True)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

Variables:
  • requests – list of tuples (request type, address, [write data], [write mask]) - used for driver
  • data – list of data in memory, used for monitor
  • mem – if agent is in monitor mode (= is slave) all reads and writes are performed on mem object
  • actual – actual request which is performed
__init__(intf, allowNoReset=True)[source]

Initialize self. See help(type(self)) for accurate signature.

doReq(sim, req)[source]
driver(sim)[source]

Implement this method to drive your interface in simulation/verification

monitor(sim)[source]

Implement this method to monitor your interface in simulation/verification

class hwtLib.ipif.intf.IpifWithCE(masterDir=<DIRECTION.OUT: 1>, asArraySize=None, loadConfig=True)[source]

Bases: hwtLib.ipif.intf.Ipif

_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance
  • called in __init__ of class
_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)
  • _declr method is called after _config
  • if this object is Unit all interfaces are threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded

hwtLib.ipif.reg module

class hwtLib.ipif.reg.IpifReg[source]

Bases: hwt.synthesizer.unit.Unit

_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance
  • called in __init__ of class
_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)
  • _declr method is called after _config
  • if this object is Unit all interfaces are threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
connectRegistered(intfFrom, intfTo)[source]

hwtLib.ipif.simMaster module

class hwtLib.ipif.simMaster.IPFISimMaster(bus, registerMap)[source]

Bases: hwtLib.sim.abstractMemSpaceMaster.AbstractMemSpaceMaster

Simulation address space master for IPIF interface

_read(addr, size, onDone=None)[source]

Add read transaction to agent of interface :param addr: address value on bus to read froms :param size: size of data to read in bites :param onDone: on read done callback function(sim) -> None

_write(addr, size, data, mask, onDone=None)[source]

Add write transaction to agent of interface

Parameters:
  • addr – address value on bus to write on
  • size – size of data to write in bites
  • data – data to write on bus
  • onDone – on write done callback function(sim) -> None

Module contents