1. sowmith Penugonda
  2. UVM
  3. Wednesday, 12 August 2020
Hi,

I didn't use the apb_cfg as suggested in the blog and had set virtual interface only.
I see the received packet to be print 2 times in the scoreboard. Please help me understand why this happens.
[email protected] https://www.edaplayground.com/x/5yvK
The result seen is:


UVM_INFO testbench.sv(157) @ 190: [email protected]@m_apb_seq [apb_seq] Starting sequence
# UVM_INFO testbench.sv(179) @ 310: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=958f99fe,writedata=0,readdata=8484d609
# UVM_INFO testbench.sv(179) @ 330: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=958f99fe,writedata=0,readdata=8484d609
# UVM_INFO testbench.sv(179) @ 390: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=b010f73e,writedata=0,readdata=b1f05663
# UVM_INFO testbench.sv(179) @ 410: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=b010f73e,writedata=0,readdata=b1f05663
# UVM_INFO testbench.sv(179) @ 430: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=1,addr=caa307dc,writedata=14838534,readdata=0
# UVM_INFO testbench.sv(179) @ 450: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=1,addr=caa307dc,writedata=14838534,readdata=0
# UVM_INFO testbench.sv(179) @ 470: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=1,addr=77c5fc65,writedata=8328ee12,readdata=0
# UVM_INFO testbench.sv(179) @ 490: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=1,addr=77c5fc65,writedata=8328ee12,readdata=0
# UVM_INFO testbench.sv(179) @ 570: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=ebb89683,writedata=0,readdata=46df998d
# UVM_INFO testbench.sv(179) @ 590: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=ebb89683,writedata=0,readdata=46df998d
# UVM_INFO testbench.sv(179) @ 670: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=d15544cf,writedata=0,readdata=b2c28465
# UVM_INFO testbench.sv(179) @ 690: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=d15544cf,writedata=0,readdata=b2c28465
# UVM_INFO testbench.sv(179) @ 710: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=1,addr=19993e5f,writedata=cb3b0700,readdata=0
# UVM_INFO testbench.sv(179) @ 730: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=1,addr=19993e5f,writedata=cb3b0700,readdata=0
# UVM_INFO testbench.sv(179) @ 750: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=6fbf385a,writedata=0,readdata=89375212
# UVM_INFO testbench.sv(179) @ 810: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=ea85209a,writedata=0,readdata=89375212
# UVM_INFO testbench.sv(179) @ 830: uvm_test_top.m_apb_env.m_apb_sbd [apb_sbd] Got packet write_cmd=0,addr=ea85209a,writedata=0,readdata=89375212
# UVM_INFO testbench.sv(164) @ 830: [email protected]@m_apb_seq [apb_seq] Ending sequence


I used read data to get read in the do while block instead of the style mentioned in the block which is outside.

do begin
@(m_vif.cb);
if(!req.m_write)
req.m_rdata=m_vif.cb.prdata;
end while(!m_vif.pready);


If I mention "if(!req.m_write) req.m_rdata=m_vif.cb.prdata;" outside of do while block I see a lot of errors.
Please help me understand the issue
Accepted Answer
Accepted Answer Pending Moderation
There was some kind of a race created from the way driver was driving it, instead it should use the clocking block. I have corrected the base example code.

virtual task drive_item(apb_pkt req);
m_vif.cb.paddr <= req.m_addr;
m_vif.cb.penable <= 0;
m_vif.cb.psel <= 1;
m_vif.cb.pwrite <= req.m_write;
m_vif.cb.pwdata <= req.m_wdata;

@(m_vif.cb) m_vif.cb.penable<=1;

do begin
@(m_vif.cb);
if(!req.m_write)
req.m_rdata=m_vif.cb.prdata;
end while(!m_vif.cb.pready);
endtask


I do not see any errors if rdata is captured outside the do-while loop.
  1. more than a month ago
  2. UVM
  3. # Permalink
Responses (3)
Accepted Answer Pending Moderation
Hi admin,

With the changes suggested it worked fine.
I had one more doubt,

With your code I see both read data and write data is being populated in every packet irrespective of m_write,
I see that due to "m_vld_val_only" not being set to 1.
On setting it to 1 I see the expected behavior..
What is the intention of that field in configuration class. It didn't use any config class and tried working out the example.
  1. more than a month ago
  2. UVM
  3. # 1
Accepted Answer Pending Moderation
Typcially, a monitor need to capture only valid data and hence it has to capture write data for write transactions and read data for read transactions, which leaves the complementary wr/rd data to be empty. But m_vld_val_only is just a config bit to show that you can pass such configurations via a config object that can influence monitor/driver or agent behavior.
  1. more than a month ago
  2. UVM
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!