We discussed sequece_item, sequence, sequencer, and driver independently. In this section, we will discuss how they talk with each other and provide sequence items from sequence to driver via the sequencer. Before you start reading this section, make sure you are aware of all methods used in sequencer and driver. (Refer: UVM Sequencer and UVM Driver).
我们分别讨论了sequence_item、sequence、sequencer和驱动程序。在本节中,我们将讨论它们如何相互通信,并通过测序仪从序列到驱动程序提供序列项。在开始阅读本节之前,请确保您了解测序仪和驱动程序中使用的所有方法。(请参阅:UVM序列器和UVM驱动器)。
The sequencer and driver communicate with each other using a bidirectional TLM interface to transfer REQ and RSP sequence items.
The driver has uvm_seq_item_pull_port which is connected with uvm_seq_item_pull_export of the associated sequencer. This TLM interface provides a facility to use implemented API to retrieve REQ items and turn RSP items.
定序器和驱动器使用双向TLM接口相互通信,以传输REQ和RSP序列项。
驱动程序具有uvm_seq_item_pull_port,该端口与相关定序器的uvm_seq_item_pull_export连接。该TLM接口提供了一种使用已实现的API检索REQ项和转RSP项的设施。
两者连接采用uvm中tlm seq_item port,通常情况下有req和rsp,注意:
uvm_seq_item_pull_port和uvm_seq_item_pull_export都是具有REQ和RSP seq_item的参数化类。驱动器和定序器之间的TLM连接是一对一的。这意味着既没有多个seq连接到单个驱动器,也没有多个驱动器连接到单个测序仪。连接:驱动程序和测序仪在UVM代理的connect_phase中连接。
Note: Both uvm_seq_item_pull_port and uvm_seq_item_pull_export are parameterized classes with REQ and RSP sequence items.The TLM connection between driver and sequencer is one-to-one. It means neither multiple sequencers are connected to a single driver nor multiple drivers connected to a single sequencer.Connections: The driver and sequencers are connected in the connect_phase of the UVM agent.
<driver_inst>.seq_item_port.connect(<sequencer_inst>.seq_item_export);
Where,The seq_item_port and seq_item_export are an instance handle for uvm_seq_item_pull_port and uvm_seq_item_pull_export respectively.
Using get_next_item and item_done methods in the driver
我们在验证工作中可以不要求rsp
1.Create a sequence item and register in the factory using the create_item function call.
2.The wait_for_grant issues request to the sequencer and wait for the grant from the sequencer. It returns when the sequencer has granted the sequence. Randomize the sequence item and send it to the sequencer using send_request call. There should not be any simulation time delay between wait_for_grant and send_request method call.
3.The sequencer forwards the sequence item to the driver with the help of REQ FIFO. This unblocks the get_next_item() call and the driver receives the sequence item.
4.The wait_for_item_done() call from sequence gets blocked until the driver responds back.In the meantime, the driver drives the sequence item to the DUT using a virtual interface handle. Once it is completed, the item_done method is called.
5.This unblocks the wait_for_item_done method from the sequence.If a response has to be sent from the driver to the sequence, item_done(RSP) is called with the RSP item as an argument.
6.The RSP item is communicated to the sequence by a sequencer with help of RSP FIFO. It is important to call the get_response method to get the response. This step is optional and not required if the RSP item is not sent by the DUT.
1.创建一个序列项,并使用Create_item函数调用在工厂中注册。
2.wait_for_grant向测序仪发出请求,并等待测序仪的授权。当测序仪授予序列时,它会返回。随机化序列项,并使用send_request调用将其发送给测序仪。wait_for_grant和send_request方法调用之间不应有任何模拟时间延迟。
3.定序器在REQ FIFO的帮助下将序列项转发给驱动器。这将解除对get_ext_item()调用的阻止,驱动程序将接收序列项。
4.序列中的wait_for_item_done()调用被阻止,直到驱动程序做出响应。同时,驱动程序使用虚拟接口句柄将序列项驱动到DUT。一旦完成,就会调用item_done方法。
5.这将从序列中解除对wait_for_item_done方法的阻塞。如果必须从驱动程序向序列发送响应,则调用item_done(RSP),并将RSP项作为参数。
6.RSP项目在RSP FIFO的帮助下由定序器传递到序列。调用get_response方法以获取响应非常重要。如果DUT没有发送RSP项目,则此步骤是可选的,不是必需的。
1.Create a sequence item and register in the factory using the create_item function call.
2.The wait_for_grant issues the request to the sequencer and wait for the grant from the sequencer. It returns when the sequencer has granted the sequence.
3.Randomize the sequence item and send it to the sequencer using send_request call. There should not be any simulation time delay between wait_for_grant and send_request method call. The sequencer forwards the sequence item to the driver with the help of REQ FIFO. This unblocks the get() call and the driver receives the sequence item.
4.The wait_for_item_done() call from the sequence gets blocked until the driver calls the get method.
5.Once the get method is called, the wait_for_item_done() call from sequence gets unblocked immediately without caring about driving the virtual interface.The get_response call is necessary to call that completes the communication.
6. The get_response method is blocked until the driver calls put(RSP).
7. In the meantime, the driver drives the sequence item to the DUT using a virtual interface handle. Once it is completed, the put(RSP) method is called. This unblocks the get_response method from the sequence. The RSP item is communicated to the sequence by a sequencer with help of RSP FIFO.
1.Create a sequence item and register in the factory using the create_item function call.
2.The wait_for_grant issues the request to the sequencer and wait for the grant from the sequencer. It returns when the sequencer has granted the sequence.
3.Randomize the sequence item and send it to the sequencer using send_request call. There should not be any simulation time delay between wait_for_grant and send_request method call. The sequencer forwards the sequence item to the driver with the help of REQ FIFO. This unblocks the get() call and the driver receives the sequence item.
4.The wait_for_item_done() call from the sequence gets blocked until the driver calls the get method.Once the get method is called, the wait_for_item_done() call from sequence gets unblocked immediately without caring about driving the virtual interface.The get_response call is necessary to call that completes the communication.
6. The get_response method is blocked until the driver calls put(RSP).
7. In the meantime, the driver drives the sequence item to the DUT using a virtual interface handle.
5Once it is completed, the put(RSP) method is called. This unblocks the get_response method from the sequence. The RSP item is communicated to the sequence by a sequencer with help of RSP FIFO.
1.创建一个序列项,并使用Create_item函数调用在工厂中注册。
2.wait_for_grant向测序仪发出请求,并等待测序仪的授权。当测序仪授予序列时,它会返回。
3.随机化序列项,并使用send_request调用将其发送给测序仪。wait_for_grant和send_request方法调用之间不应有任何模拟时间延迟。定序器在REQ FIFO的帮助下将序列项转发给驱动器。这将解除对get()调用的阻止,驱动程序将接收序列项。
4.序列中的wait_for_item_done()调用被阻塞,直到驱动程序调用get方法。
5.一旦调用了get方法,序列中的wait_for_item_done()调用就会立即解除阻塞,而不必关心驱动虚拟接口。get_response调用对于完成通信的调用是必要的。
6.get_response方法被阻塞,直到驱动程序调用put(RSP)。
7.同时,驱动器使用虚拟接口句柄将序列项驱动到DUT。
5一旦完成,就会调用put(RSP)方法。这将解除序列中get_response方法的阻塞。RSP项目在RSP FIFO的帮助下由定序器传达给序列。