Adding functionality inside write method of UVM analysis port

Hi,

I have my write function defined in my scoreboard - This collects the tran from the request monitor and prints the tran req

function void write_a_waddr(a_req_txn_t tran);

   bit           is_write = 0;
   bit [31:0]    addr;
   logic [`MAX_DATA_WIDTH-1:0]                           axi_wdata[$];
   logic [`MAX_DATA_WIDTH-1:0]                           tmp_axi_wdata;
   bit   [`MAX_ADDR_WIDTH-1:0] 		                 axi_addr;

   if (tran.trans_type == AXI_WRITE) begin is_write = 1;
     addr = tran.addr;
    `uvm_info("TEST", $sformatf("WRITE: Received axi_req: %s\n", tran.sprint()), UVM_NONE);

endfunction

I want to add my functionality to this function like whenever i see AXI_WRITE i.e, is_write = 1 i want to take the addr and wdata and write to some other interface

I have a task defined which does AXI reads and writes
a_write (sequencer, a_id, a_strb, a_len, a_wdata …)
a_read(sequencer, a_id, a_strb, a_len, a_rdata …)

Obviously i cannot call these task inside the write method

how to achieve this ?

In reply to xfinity:

Having your scoreboard generate stimulus is not a good practice. If you need to turn it off to run a particular test, you lose that functionality.

A better practice is hooking your monitor’s analysis port to a uvm_tlm_analysis_fifo. That uses a builtin write function to do a put() into the fifo, and you can create process task the does a get() from the fifo.