Jump to content

Configuring the testbench


Recommended Posts

I have problems configuring my uvm testbench. In the static testbench module, I write intefaces as (where bus_x.mp denotes modport of an interface):

uvm_config_db #(virtual dut_if.mp)::set(null, "uvm_test_top", "vif_0", bus_0.mp);

uvm_config_db #(virtual dut_if.mp)::set(null, "uvm_test_top", "vif_1", bus_1.mp);

uvm_config_db #(virtual dut_if.mp)::set(null, "uvm_test_top", "vif_2", bus_2.mp);

Then in the uvm_test, I read back and set the interface in the build phase:

uvm_config_db#(virtual dut_if.mp)::get(this, "", "vif_0", hook_0);

uvm_config_db #(virtual dut_if.mp)::set(this, "env.agent_0.*", "vif", hook_0);

uvm_config_db#(virtual dut_if.mp)::get(this, "", "vif_1", hook_0);

uvm_config_db #(virtual dut_if.mp)::set(this, "env.agent_1.*", "vif", hook_1);

uvm_config_db#(virtual dut_if.mp)::get(this, "", "vif_2", hook_0);

uvm_config_db #(virtual dut_if.mp)::set(this, "env.agent_2.*", "vif", hook_2);

Then I start a sequence on all the 3 sequencers in the run phase of the uvm_test:






Inspite of defining the scope clearly, all sequences get executed on env.agent_2.driver. The drivers of agent_0 and agent_1 are not used. I also get an error message:

UVM_ERROR verilog_src/uvm-1.1/src/seq/uvm_sequencer_base.svh(1196) @ 1675: uvm_test_top.env.agent_2.seq [sEQFINERR] Parent sequence 'uvm_test_top.env.agent_2.seq.s_ramp' should not finish before all items from itself and items from descendent sequences are processed. The item request from the sequence 'uvm_test_top.env.agent_2.seq.s_ramp' is being removed.

I have no problems when I don't use fork join. In that case, the sequence executes sequentially on the 3 respective sequencers of agent_0, agent_1, agent_2.

Link to comment
Share on other sites


I presume that s_ramp is the sequence you want to run? So this is a pointer to a class the sequencer needs to do stuff with. It looks to me like with the fork you are trying to do stuff in the sequencer using the same sequence object. That won't work. You can re-use the object when you run the sequence sequentially, so without the fork it would work.

You need a different pointer for each agent:




Or use an array or whatever you want.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...