avl_apb._cdriver module

class avl_apb._cdriver.CplDriver(*args, **kwargs)[source]
Parameters:
__init__(name, parent)[source]

Initialize the Requester Driver for the AMBA agent.

Parameters:
  • name (str) – Name of the agent instance

  • parent (Component) – Parent component

Return type:

None

idx

Index of the driver in the AMBA interface (psel), used to select the correct signals.

async reset()[source]

Reset the driver by setting all signals to their default values. This method is called when the driver is reset.

By default 0’s all signals - can be overridden in subclasses to add randomization or other behavior.

Return type:

None

async drive(item)[source]

Drive the signals based on the provided sequence item. This method is called to drive the signals of the AMBA interface.

Parameters:

item (SequenceItem) – The sequence item containing the values to drive

Return type:

None

async get_next_item(item=None)[source]

Get the next sequence item.

The implementation ensures items are driven on the rising edge of pclk, when not in reset, while allowing for back-to-back requests if the sequencer provides them.

Parameters:

item (SequenceItem, optional) – The sequence item to retrieve, defaults to None

Returns:

The next sequence item

Return type:

SequenceItem

Raises:

NotImplementedError – If the method is not implemented in subclasses

class avl_apb._cdriver.CplRandomDriver(*args, **kwargs)[source]
Parameters:
__init__(name, parent)[source]

Initialize the Random Driver for the APB agent.

Parameters:
  • name (str) – Name of the agent instance

  • parent (Component) – Parent component

Return type:

None

async get_next_item(item=None)[source]

Get the next sequence item with randomization.

In the random driver implementation, the item fields are randomized based on constraints from the sequence item.

Parameters:

item (SequenceItem)

Return type:

SequenceItem

class avl_apb._cdriver.CplMemoryDriver(*args, **kwargs)[source]
Parameters:
__init__(name, parent)[source]

Initialize the Memory Driver for the APB agent.

This driver uses a memory model to simulate the behavior of the APB interface.

It allows for reading and writing to a memory model, which is useful for simulating memory-mapped devices.

By default accesses which miss the allocated range will return slverr (if supported) and randomize the item.

Parameters:
  • name (str) – Name of the agent instance

  • parent (Component) – Parent component

Return type:

None

async get_next_item(item=None)[source]

Get the next sequence item as if targeting a memory.

In the memory driver implementation, the item memory is updated and returns data from the memory if the address is valid.

In the event the address is not valid, the item is randomized and a plslverr signal is set to indicate an error (if present)

Parameters:

item (SequenceItem)

Return type:

SequenceItem