pyuvm._s14_15_python_sequences
Module Contents
Classes
The |
|
The pyuvm uvm_sequence_item has events to implement start_item() and finish_item() |
|
The sequence item port with a request queue and a response queue. |
|
The uvm_sequencer arbitrates between multiple sequences that want to send items to driver (connected to seq_export) It exposes put_req, get_next_item, get_response from the export. The sequence will use these to coordinate items with the sequencer. |
|
The uvm_sequence creates a series of sequence items and feeds them to the sequencer using start_item() and finish_item(). It can also get back results with get_response() body() gets launched in a thread at start. |
API
- class pyuvm._s14_15_python_sequences.ResponseQueue(maxsize: int = 0)
Bases:
pyuvm._s12_uvm_tlm_interfaces.UVMQueueThe
ResponseQueueis a queue that can cherry-pick an item using an id number, or simply return the next item in the queue.Initialization
- put_nowait(item)
Extend the
cocotb.queue.Queue.put_nowaitmethod to set theput_eventflag. This flag is used to signal that an item has been put in the queue so that get_response can be unblocked.:param item: The item to put in the queue :raises QueueFull: If the queue is full
- async get_response(txn_id=None)
A coroutine that will either get a response item with the given transaction_id, or return the next item in the queue.
:param txn_id: (Optional) The transaction ID of the response you want to pluck from the queue. :return: The response item
- __str__()
- class pyuvm._s14_15_python_sequences.uvm_sequence_item(name)
Bases:
pyuvm._s05_base_classes.uvm_transactionThe pyuvm uvm_sequence_item has events to implement start_item() and finish_item()
Initialization
:param name: Object name :param initiator: component that is the initiator
- set_context(item)
Use this to link a new response transaction to the request transaction. rsp.set_context(req)
:param item: The request transaction :return: None
- class pyuvm._s14_15_python_sequences.uvm_seq_item_export(name, parent)
Bases:
pyuvm._s12_uvm_tlm_interfaces.uvm_blocking_put_exportThe sequence item port with a request queue and a response queue.
Initialization
13.1.2.1—This is new() in the IEEE-UVM, but we mean the same thing with init()
:param name: The name of the component. Used in the UVM hierarchy :param parent: The parent component. If None, the parent is uvm_root
- async put_req(item)
put request into request queue. Block if the queue is full.
:param item: request item :return: None
- put_response(item)
Put response into response queue. Do not block.
:param item: response item :raise QueueFull: If the queue is full :return:
- async get_next_item()
A couroutine that gets the next item out of the item queue and blocks if the queue is empty.
:return: item to process
- item_done(rsp=None)
Signal that the item has been completed. If
rspis notNoneput it into the response queue.:param rsp: (optional) item to put in response queue if not None
- async get_response(transaction_id=None)
A couroutine that will block if there is no transaction available
If
transaction_idis notNone, block until a response with the transaction id becomes available.:param transaction_id: The transaction ID of the response :return: The response item
- class pyuvm._s14_15_python_sequences.uvm_seq_item_port(name, parent)
Bases:
pyuvm._s12_uvm_tlm_interfaces.uvm_port_base- connect(export)
- async put_req(item)
A coroutine that blocks until the request is put in the queue
:param item: The request item
- put_response(item)
Put a response back in the queue. aka put_response
:param item: The response item :Raises UVMFatalError: If the item is not a subclass of uvm_sequence_item
- async get_next_item()
A coroutine that get the next sequence item from the request queue and blocks if the queue is empty.
:return: The next sequence item
- item_done(rsp=None)
Notify the driver that it can get the next sequence. If
rspis notNone, put it in the response queue.:param rsp: (optional) The response item :raise UVMFatalError: If
rspis not a subclass of uvm_sequence_item
- async get_response(transaction_id=None)
A coroutine that will ither get a response item with the given transaction_id, or get the first response item in the queue. Otherwise it will block until a response is ready.
:param transaction_id: The transaction ID of the response you want :return: The response item
- class pyuvm._s14_15_python_sequences.uvm_sequencer(name, parent)
Bases:
pyuvm._s13_uvm_component.uvm_componentThe uvm_sequencer arbitrates between multiple sequences that want to send items to driver (connected to seq_export) It exposes put_req, get_next_item, get_response from the export. The sequence will use these to coordinate items with the sequencer.
Initialization
13.1.2.1—This is new() in the IEEE-UVM, but we mean the same thing with init()
:param name: The name of the component. Used in the UVM hierarchy :param parent: The parent component. If None, the parent is uvm_root
- async run_phase()
- async start_item(item)
- async finish_item(item)
- async put_req(req)
- async get_response(txn_id=None)
- async get_next_item()
- class pyuvm._s14_15_python_sequences.uvm_sequencer_base(name='')
- class pyuvm._s14_15_python_sequences.uvm_sequence_base(name)
- class pyuvm._s14_15_python_sequences.uvm_sequence(name='uvm_sequence')
Bases:
pyuvm._s05_base_classes.uvm_objectThe uvm_sequence creates a series of sequence items and feeds them to the sequencer using start_item() and finish_item(). It can also get back results with get_response() body() gets launched in a thread at start.
Initialization
:param name: Name of the object. Default is empty string.
- async pre_body()
This function gets launced BEFORE the function body() is started following a start() call.
This method should not be called directly by the user.
- async post_body()
This function gets launced AFTER the function body() is started following a start() call.
This method should not be called directly by the user.
- async body()
This function gets launched in a thread when you run start() You generally override it.
- async start(seqr=None, call_pre_post=True)
Launch this sequence on the sequencer. Seqr cannot be None.
:param seqr: The sequencer to launch this sequence on. :param call_pre_post: If set to true (default), then pre_body and post_body are called before and after the sequence body is called. :raise AssertionError: If seqr is None
- async start_item(item)
Sends an item to the sequencer and waits to be notified when the item has been selected to be run.
:param item: The sequence item to send to the driver.
- async finish_item(item)
- async get_response(transaction_id=None)