How do I send Data from the Driver to the Scoreboard

Hi,

I am trying to send the data from the driver to the scoreboard using analysis port write method. But the problem that I face is that as soon as I write the sequence item into the analysis port in the driver, the scoreboard immediately extracts the data. The scoreboard does not even wait for the execution of its run phase.
How do I make sure that the scoreboard gets the sequence item sent by the driver only when it executes its run phase? Or is the whole process of sending the seq item from the driver to the scoreboard itself is incorrect? Please help.

Driver snippet :
uvm_analysis_port #(xgemac_seq_item) ap_driver2agent;
task run();
@(posedge xgemac_intf.clkTxRxInterface);
xgemac_seq_item_h = xgemac_seq_item :: type_id :: create(“xgemac_seq_item_h”);
`uvm_info(“Driver”,“run Phase”,UVM_LOW)

forever begin
seq_item_port.get_next_item(xgemac_seq_item_h);

xgemac_intf.tx_pkt_valid = 1;
xgemac_intf.tx_pkt_sop = xgemac_seq_item_h.tx_pkt_sop ;
xgemac_intf.tx_pkt_eop = xgemac_seq_item_h.tx_pkt_eop;
xgemac_intf.tx_pkt_modlength = xgemac_seq_item_h.tx_pkt_modlength ;
xgemac_intf.rx_pkt_ren = 1;
xgemac_intf.tx_pkt_data = xgemac_seq_item_h.tx_pkt_data ;

ap_driver2agent.write(xgemac_seq_item_h);
end
seq_item_port.item_done();
endtask

Scoreboard code:
uvm_tlm_analysis_fifo #(xgemac_seq_item) fifo_driver2scoreboard;

task run();
`uvm_info(“scb”,“Run phase”,UVM_LOW)
forever begin
fifo_driver2scoreboard.get(xgemac_seq_item_driver_h);

fifo_monitor2scoreboard.get(xgemac_seq_item_monitor_h);
endtask

In reply to prithvinkumble:

Hi,

First of all, its not a good approach to send transaction directly from Driver to scoreboard. Always it should be from monitor. In your case, set some delay and then write.

In reply to prithvinkumble:
Can you take a look at the code you posted and make sure all the begin/end blocks are nested correctly. And then please use code tags.

In reply to prithvinkumble:

Where is there delay being inserted between driver transactions? If you are using uvm components, ‘run’ is a little confusing, should use ‘run_phase’. Can you wait a cycle before you begin driving transactions?