class ramreg_monitor; virtual sram_if#(25,32) xif; //collect spi_trans act_trans[$]; function new(); endfunction extern task collect(); extern task do_mon(); endclass : ramreg_monitor task ramreg_monitor::do_mon(); while(1) begin @(negedge xif.wren); collect(); end endtask: do_mon task ramreg_monitor::collect(); spi_trans tr_temp; @(posedge xif.clk); @(negedge xif.clk); tr_temp = new(); tr_temp.dout = xif.dout ; act_trans.push_back(tr_temp); endtask: collect