Question: Understanding of p_sequencer
Zhang Qiang's UVM white paper gave a detailed description of the use of p_sequencer, but he has not understood the essence of p_sequencer, and now seems to understand a little bit.
1. Consider the following situation, the sequencer has the following variables:
2. When the sequence sends a transaction, the dmac and smac must be set. How can the body of the sequence get these two values?
1) When introducing sequence, there is m_sequencer inside, directly use m_sequencer to get these two variables:
Compile Error:
Because m_sequencer is uvm_sequencr_base (the base class of uvm_sequencr) type, not my_sequencer type.
So cast: convert m_sequencer to my_sequencer:
But it's troublesome. So there is a built-in macro: uvm_declare_p_sequencer(SEQUENCER)
Equivalent to declare the following variables:
Automatically cast m_sequencer to p_sequencer. It is done before pre_body().
---------------------
Author: tingtang13
Source: CSDN
Original: https: //blog.csdn.net/tingtang13/article/details/46546395
Disclaimer: This article Original article for the blogger, please attach a link to the blog post if you reprint it!