hwt.interfaces.agents package

This package contains a UVM like simulation agents to handle IO between circuit running in simulator and the code which drives the simulation.

Submodules

hwt.interfaces.agents.bramPort module

class hwt.interfaces.agents.bramPort.BramPortAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf)[source]

Bases: hwt.interfaces.agents.bramPort.BramPort_withoutClkAgent

getDrivers()[source]

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

class hwt.interfaces.agents.bramPort.BramPort_withoutClkAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

A simulation agent for BramPort_withoutClk interface In slave mode acts as a memory, in master mode dispathes requests stored in “requests” dequeu

Variables:
  • requests – list of tuples (request type, address, [write data]) - 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
__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
doReq(req)[source]
driver()[source]

Implement this method to drive your interface in simulation/verification

monitor()[source]

Handle read/write request on this interfaces

This method is executed on clock edge. This means that the read data should be put on dout after clock edge.

onReadReq(addr)[source]

on readReqRecieved in monitor mode

onWriteReq(addr, data)[source]

on writeReqRecieved in monitor mode

hwt.interfaces.agents.fifo module

class hwt.interfaces.agents.fifo.FifoReaderAgent(sim, intf, allowNoReset=False)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

Simulation agent for FifoReader interface

__init__(sim, intf, allowNoReset=False)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
dataReader()[source]
dataWriter()[source]
driver()[source]

Implement this method to drive your interface in simulation/verification

driver_init()[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

get_data()[source]
monitor()[source]

Initialize data reading if wait is 0

monitor_init()[source]
setEnable_asDriver(en)[source]
setEnable_asMonitor(en)[source]
set_data(d)[source]
class hwt.interfaces.agents.fifo.FifoWriterAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf, allowNoReset=False)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

Simulation agent for FifoWriter interface

__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf, allowNoReset=False)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
driver()[source]

Implement this method to drive your interface in simulation/verification

driver_init()[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

get_data()[source]
monitor()[source]

Implement this method to monitor your interface in simulation/verification

monitor_init()[source]
setEnable_asDriver(en)[source]
setEnable_asMonitor(en)[source]
set_data(d)[source]

hwt.interfaces.agents.handshaked module

class hwt.interfaces.agents.handshaked.HandshakeSyncAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: hwt.interfaces.agents.handshaked.HandshakedAgent

Simulation/verification agent for HandshakedSycn interface

Attention:there is no data channel on this interface it is synchronization only and it actually does not have any meaningful data collected data in monitor mode are just values of simulation time when item was collected
get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

class hwt.interfaces.agents.handshaked.HandshakedAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase, hwtSimApi.agents.handshaked.HandshakedAgent

Simulation/verification agent for hwt.interfaces.std.Handshaked interface there is onMonitorReady(simulator) and onDriverWriteAck(simulator) unimplemented method which can be used for interfaces with bi-directional data streams

Note:2-phase (xor) handshake
Attention:requires clk and rst/rstn signal ( If you do not have any create simulation wrapper with it. Without it you can very easily end up with a combinational loop.)
__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: Handshaked, allowNoReset=False)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
get_data()[source]

extract data from interface

get_ready()[source]

get value of “ready” signal

classmethod get_ready_signal(intf)[source]
get_valid()[source]

get “valid” signal

classmethod get_valid_signal(intf)[source]
set_data(data)[source]

write data to interface

set_ready(val)[source]
set_valid(val)[source]
class hwt.interfaces.agents.handshaked.HandshakedReadListener(hsAgent: hwt.interfaces.agents.handshaked.HandshakedAgent)[source]

Bases: object

__init__(hsAgent: hwt.interfaces.agents.handshaked.HandshakedAgent)[source]

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

_afterReadWrap()[source]
register(transCnt, callback)[source]
class hwt.interfaces.agents.handshaked.UniversalHandshakedAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: Handshaked, allowNoReset=False)[source]

Bases: hwt.interfaces.agents.handshaked.HandshakedAgent

Same thing like hwt.interfaces.agents.handshaked.HandshakedAgent just the get_data/set_data method is predefined to use a tuple constructed from signals available on this interface.

Variables:
  • _signals – tuple of data signals of this interface (excluding ready and valid signal)
  • _sigCnt – len(_signals)
__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: Handshaked, allowNoReset=False)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
get_data()[source]

extract data from interface

set_data(data)[source]

write data to interface

hwt.interfaces.agents.rdSynced module

class hwt.interfaces.agents.rdSynced.RdSyncedAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf, allowNoReset=True)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

Simulation/verification agent for RdSynced interface

__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf, allowNoReset=True)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
driver()[source]

Push data to interface

get_data()[source]

extract data from interface

get_ready()[source]
classmethod get_ready_signal(intf)[source]
monitor()[source]

Collect data from interface

setEnable_asMonitor(en)[source]
set_data(data)[source]

write data to interface

set_ready(val)[source]

hwt.interfaces.agents.regCntrl module

class hwt.interfaces.agents.regCntrl.RegCntrlAgent(sim, intf)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

Simulation/verification agent for RegCntrl interface

__init__(sim, intf)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
din
din_getter()[source]
din_setter(newVal)[source]
dout
dout_getter()[source]
dout_setter(newVal)[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

setEnable_asDriver(en: bool)[source]
setEnable_asMonitor(en: bool)[source]

hwt.interfaces.agents.signal module

class hwt.interfaces.agents.signal.SignalAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: Signal, delay=None)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

Agent for signal interface, it can use clock and reset interface for synchronization or can be synchronized by delay

Attention:clock synchronization has higher priority
__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: Signal, delay=None)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
driverInit()[source]
driverWithClk()[source]
driverWithTimer()[source]
getDrivers()[source]

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

get_data()[source]
monitorWithClk()[source]
monitorWithTimer()[source]
set_data(data)[source]

hwt.interfaces.agents.structIntf module

class hwt.interfaces.agents.structIntf.StructIntfAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf)[source]

Bases: hwtSimApi.agents.base.AgentBase

Agent for StructIntf inteface

Summary:only purpose is to instantiate agents for child interfaces
__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf)[source]

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

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

get_data()[source]
set_data(d)[source]

hwt.interfaces.agents.tuleWithCallback module

class hwt.interfaces.agents.tuleWithCallback.TupleWithCallback[source]

Bases: tuple

hwt.interfaces.agents.unionIntf module

class hwt.interfaces.agents.unionIntf.UnionSourceAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf)[source]

Bases: hwt.interfaces.agents.structIntf.StructIntfAgent

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

hwt.interfaces.agents.universalComposite module

class hwt.interfaces.agents.universalComposite.UniversalCompositeAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: hwt.synthesizer.interface.Interface)[source]

Bases: hwtSimApi.agents.base.AgentBase

Composite agent which just instanciates agents for every subinterface

__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf: hwt.synthesizer.interface.Interface)[source]

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

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(v: bool)[source]

Distribute change of enable on child agents

hwt.interfaces.agents.vldSynced module

class hwt.interfaces.agents.vldSynced.VldSyncedAgent(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf, allowNoReset=False)[source]

Bases: hwt.simulator.agentBase.SyncAgentBase

__init__(sim: hwtSimApi.hdlSimulator.HdlSimulator, intf, allowNoReset=False)[source]
Parameters:rst – tuple (rst signal, rst_negated flag)
driver()[source]

Implement this method to drive your interface in simulation/verification

get_data()[source]
get_valid()[source]
classmethod get_valid_signal(intf)[source]
monitor()[source]

Implement this method to monitor your interface in simulation/verification

setEnable_asDriver(en)[source]
set_data(data)[source]
set_valid(val)[source]