I am interested in learning UVM, so I have downloaded one of the uvm examples (spi).
I have made some modifications to the UVM testbench since the SPI RTL that I have has different functionality.
I could see that that my sequence items are generated as I expect. Next to that my driver and monitor are also doing what they should do. also the functional coverage block. The problem that I have is with the scoreboard. The monitor is broadcasting the transactions (via write method) to both functional coverage block (uvm subscriber) and to the scoreboard, I see that transactions are correctly broadcasted to the subscriber (functional coverage block) but not to the scoreboard. This the code of my scoreboard:
class spi_scoreboard extends uvm_scoreboard;
`uvm_component_utils(spi_scoreboard)
uvm_tlm_analysis_fifo #(spi_seq_item) spi_fifo;
spi_seq_item item;
function new(string name = “”, uvm_component parent = null);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
spi_fifo = new(“spi_fifo”, this);
endfunction: build_phase
task run_phase(uvm_phase phase);
forever
begin
spi_fifo.get(item);
if(item.pedge_mosi.size ==0)
uvm_info("SPI_SB_REPORT:", $sformatf("Item is empty !!!!"), UVM_LOW) else
uvm_info(“SPI_SB_REPORT:”, $sformatf(“Item is %p”,item), UVM_LOW)
end
endtask: run_phase
The get method (spi_fifo.get(item);) is getting something because it gets executed the exact same number of transactions that being broadcasted. But the items are empty (item.pedge_mosi.size is always 0, this is also the case for all other the item object attributes), so I am not getting how these items reach the subscriber correctly but not the scoreboard. I am suspecting that something is wrong with connection from Monitor to Scoreboard, but have no clue.
This is how the TLM connection of the monitor to the scoreboard is done:
function void spi_env::connect_phase(uvm_phase phase);
…
…
// Connect monitor to subscriber
m_spi_agent.ap.connect(m_func_cov_monitor.analysis_export);
// Connect monitor to scoreboard
m_spi_agent.ap.connect(m_scoreboard.spi_fifo.analysis_export);
…
…
endfunction: connect_phase
Any clue why I don’t get the items?
all what I get get is:
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
UVM_INFO …/TESTBENCH/env/spi_scoreboard.svh(63) @ 1342110: uvm_test_top.m_env.m_scoreboard [SPI_SB_REPORT:] Item is empty !!!
This message gets repeated as many times as the number of the broadcasted transactions.