50 lines
959 B
Systemverilog
50 lines
959 B
Systemverilog
class mcureg_monitor;
|
|
|
|
|
|
virtual mcureg_if mif;
|
|
virtual sram_if#(25,32) xif;
|
|
|
|
//collect
|
|
mcureg_trans act_trans[$];
|
|
|
|
|
|
function new();
|
|
endfunction
|
|
extern task collect();
|
|
extern task do_mon();
|
|
|
|
endclass : mcureg_monitor
|
|
|
|
|
|
task mcureg_monitor::do_mon();
|
|
|
|
while(1) begin
|
|
@(negedge xif.wren);
|
|
collect();
|
|
end
|
|
|
|
endtask: do_mon
|
|
|
|
|
|
|
|
|
|
task mcureg_monitor::collect();
|
|
mcureg_trans tr_temp;
|
|
|
|
@(posedge xif.clk);
|
|
@(negedge xif.clk);
|
|
|
|
tr_temp = new();
|
|
tr_temp.mcu_result = mif.mcu_result ;
|
|
tr_temp.mcu_cwfr = mif.mcu_cwfr ;
|
|
tr_temp.mcu_gapr = mif.mcu_gapr ;
|
|
tr_temp.mcu_ampr = mif.mcu_ampr ;
|
|
tr_temp.mcu_baisr = mif.mcu_baisr ;
|
|
tr_temp.mcu_intp_sel = mif.mcu_intp_sel ;
|
|
tr_temp.mcu_nco_pha_clr = mif.mcu_nco_pha_clr ;
|
|
tr_temp.mcu_rz_pha = mif.mcu_rz_pha ;
|
|
|
|
act_trans.push_back(tr_temp);
|
|
|
|
endtask: collect
|