Hi friends ,
I have written a scoreboard. Inside the scoreboard I have 4 subscribers talking to 4 interfaces. each subscriber has a queue. inside scoreboard code i am pushing the value to the queue of subscriber. Now I want to compare the value of data pushed in the queue with data from the dut o/p. My question is in uvm_subscriber there is a write function. when I am adding some print statement there , I donot see any data in the queue.But when I add print statement in the report_phase of subscriber I see queue getting values.Why do i see queue empty inside write function? I have added my chunk of scoreboard and subscriber code.
class tb_scoreboard extends uvm_scoreboard;
port_sb sb[4]; // 4 subscribers for 4 interfaces
virtual function void write_before(packet pkt);
pkt.print();
sb[get_oport(pkt)].expected_data_q.push_back(pkt); // each subscriber has a queue . push dat
---------
class port_sb extends uvm_subscriber#(packet) ;
packet expected_data_q[$];
virtual function void write(packet pkt);
$display("size of expected queue is = %d", expected_data_q.size) ; ---> this shows the size always 0
pkt.print();
endfunction:write
If the queue is filled before the write was issued. The queue is not empty (assuming, it is implemented correctly).
For me it is not clear what are you doing with your 2 scoreboards and why thea are of the same type.
i have one score board. That instantiates 4 subscribers. Each subscriber has a queue inside. The reason is I have a 4 input , 4 output serial router to test.
At the output side , each output agent (passive agent) is connect to the one instance of subscriber. So that each o/p port of DUT has a unique subscriber where the data goes.
I got some understanding from the code . You have two analysis export in scoreboard.
You have 4 subscriber. Are they connected directly with monitor analysis port ?
How are the subscriber ports connected ? Looks like you want to fill the queue based on write method of scoreboard, and you want to use in subscriber’s write method and they are not in sync. Can you please elaborate more regarding your connections ?