Faceing issue in scoreboard

am collecting write data in monitor from DUT. whatever I have collected, that data is assigned to transcollected port. At monitor am able to print that write data.

I have implemented a write method in scoreboard. In scoreboard am unable to collet same data. I am collecting last write data only.

trans_collected.wdata_o=3a
trans_collected.wdata_o=37
trans_collected.wdata_o=3f
trans_collected.wdata_o=35
trans_collected.wdata_o=3c

scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c

Please help me…

In reply to Manirama:
Could you please show some code. Looks like you see only the last data packet.

In reply to chr_sue:

In reply to Manirama:
Could you please show some code. Looks like you see only the last data packet.

class scoreboard extends uvm_scoreboard;

axi_seq_item pkt_qu[$];

//S signals
bit wready = 1;
bit [127:0] s_data_out;

//---------------------------------------
//port to recive packets from monitor
//---------------------------------------
uvm_analysis_imp#(axi_seq_item, axi_scoreboard) item_collected_export;
`uvm_component_utils(axi_scoreboard)

//---------------------------------------
// new - constructor
//---------------------------------------
function new (string name, uvm_component parent);
super.new(name, parent);
endfunction : new
//---------------------------------------
// build_phase - create port and initialize local memory
//---------------------------------------
function void build_phase(uvm_phase phase);
super.build_phase(phase);
item_collected_export = new(“item_collected_export”, this);
endfunction: build_phase

//---------------------------------------
// write task - recives the pkt from monitor and pushes into queue
//---------------------------------------
virtual function void write(axi_seq_item pkt);
//pkt.print();
pkt_qu.push_back(pkt);
endfunction : write

//---------------------------------------
// run_phase - compare’s the read data with the expected data(stored in local memory)
// local memory will be updated on the write operation.
//---------------------------------------
virtual task run_phase(uvm_phase phase);
axi_seq_item axi_pkt;
//axi_seq_item axi_pkt[$];
//axi_pkt = new();
forever begin
wait(pkt_qu.size() > 0);
axi_pkt = pkt_qu.pop_front();
//$display(“scb…axi_pkt.wdata_o= %h”,axi_pkt.wdata_o);
if((axi_pkt.wvalid_o == 1’b1) && (wready == 1’b1)) begin
if(axi_pkt.awlen_o == 0) begin
//$display(“s_data_out”);
this.s_data_out <= axi_pkt.wdata_o;
#10;
end
else
//$display(“else part”);
for(int i = 0; i<=axi_pkt.awlen_o ; i++) begin
#10;
this.s_data_out <= axi_pkt.wdata_o;
$display(“scb…axi_pkt.wdata_o= %h”,axi_pkt.wdata_o);
end
end
if(this.s_data_out == axi_pkt.rdata_i) begin
$display(" test passed condition");
end
else
$display(" test failed condition");
end
endtask : run_phase
endclass :

In reply to Manirama:

Thanks for showing this code. 2 remarks:
(1) Could you please use code tags. This makes the code more readable.
(2) Why you are using a queue to store the incoming transaction. The recommended and better way is to connect to the analysis_export/imp a uvm analysis fifo.

I think in monitor you might have created the transaction object only once and every time you are updating the same transaction object form the monitor.In SB after getting the transaction class object from monitor & before the SB completes the execution first transaction object received from the monitor, the monitor may modify the data in that object. Try creating new transaction class object in monitor every time before the object is updated with the new value

Regards,
Shanthi

In reply to chr_sue:

ok i will try with uvm analysis fifo

In reply to shanthi:

I have implemented by using below link

can you please guide me how to implement “creating new transaction class object in monitor every time before the object is updated with the new value”

In reply to Manirama:

Your code has a couple of weaknesses, VCS is tolerating. Using another simulator they appear.
You do not understand correctly the construction of dynamicobjects. In the UVM we have 2 different types:
(1) components extended from uvm_component they are use to construct the testbench. They will be creted at runtime 0 and exist all the simualtion time.
(2) transient objects like seq_items and sequences which are created at any time and they disappear after they have benn processed. You do not have to construct them in the build_phase or the constructor.
I saw only 1 seq_item generated in your code. I have modified it to see all the reads and writes to all addresses. But I cannot see your problem.
Here you can find my code:
https://www.edaplayground.com/x/5vU_

In reply to Manirama:

In reply to shanthi:
I have implemented by using below link
https://www.edaplayground.com/x/5r89
can you please guide me how to implement “creating new transaction class object in monitor every time before the object is updated with the new value”

In monitor create the object for trans_collected inside forever loop.Find the edited code.

Regards,
Shanthi
www.maven-silicon.com

In reply to chr_sue:

thanks for helping me…
am facing issue in scoreboard not in monitor.

am collecting write data in monitor from DUT. whatever I have collected, that write data is assigned to transcollected port. At monitor am able to print the correct write data.

I have implemented a write method in scoreboard. In scoreboard am unable to collet same data. I am collecting last write data only.

trans_collected.wdata_o=3a
trans_collected.wdata_o=37
trans_collected.wdata_o=3f
trans_collected.wdata_o=35
trans_collected.wdata_o=3c

scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c
scb…axi_pkt.wdata_o= 3c

Please help me…

In reply to Manirama:

I’d like to see the behavior you are posting here. But I do not. Which test you are running?

In reply to Manirama:

You are facing issue in scorebaord because every time the same object is sent from monitor to SB. In SB before the value is retrieved from transaction object, monitor is changing the value.
Hence in the monitor every time create the new transaction object to collect the data & send it to SB. I have modified the code & running the test for multiple write & read and output is proper now. You can refer the code

Regards,
Shanthi
www.maven-silicon.com

In reply to chr_sue:

BURST write followed by BURST read testcase

In reply to Manirama:

In your EDAPlayground code I see only test 'mem_wr_rd_test '. Could you please update your code.

In reply to chr_sue:

I have updated the code and I have the called the write follewed by read testcase.

the above link i have used for reference perpose only.

In reply to Manirama:

Which problem you are facing?