86 lines
2.6 KiB
Systemverilog
86 lines
2.6 KiB
Systemverilog
|
class pllreg_monitor;
|
||
|
|
||
|
|
||
|
virtual pllreg_if pif;
|
||
|
virtual spi_if wif;
|
||
|
virtual sram_if#(25,32) xif;
|
||
|
|
||
|
//collect
|
||
|
pllreg_trans act_trans[$];
|
||
|
|
||
|
|
||
|
function new();
|
||
|
endfunction
|
||
|
extern task collect();
|
||
|
extern task do_mon();
|
||
|
|
||
|
endclass : pllreg_monitor
|
||
|
|
||
|
|
||
|
task pllreg_monitor::do_mon();
|
||
|
|
||
|
while(1) begin
|
||
|
@(negedge xif.wren);
|
||
|
collect();
|
||
|
end
|
||
|
|
||
|
endtask: do_mon
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
task pllreg_monitor::collect();
|
||
|
pllreg_trans tr_temp;
|
||
|
|
||
|
@(posedge wif.sclk);
|
||
|
@(negedge wif.sclk);
|
||
|
|
||
|
tr_temp = new();
|
||
|
tr_temp.ref_sel = pif.ref_sel ;
|
||
|
tr_temp.ref_en = pif.ref_en ;
|
||
|
tr_temp.ref_s2d_en = pif.ref_s2d_en ;
|
||
|
tr_temp.p_cnt = pif.p_cnt ;
|
||
|
tr_temp.pfd_delay = pif.pfd_delay ;
|
||
|
tr_temp.pfd_dff_Set = pif.pfd_dff_Set ;
|
||
|
tr_temp.pfd_dff_4and = pif.pfd_dff_4and ;
|
||
|
tr_temp.spd_div = pif.spd_div ;
|
||
|
tr_temp.spd_pulse_width = pif.spd_pulse_width ;
|
||
|
tr_temp.spd_pulse_sw = pif.spd_pulse_sw ;
|
||
|
tr_temp.cpc_sel = pif.cpc_sel ;
|
||
|
tr_temp.swcp_i = pif.swcp_i ;
|
||
|
tr_temp.sw_ptat_r = pif.sw_ptat_r ;
|
||
|
tr_temp.sw_fll_cpi = pif.sw_fll_cpi ;
|
||
|
tr_temp.sw_fll_delay = pif.sw_fll_delay ;
|
||
|
tr_temp.pfd_sel = pif.pfd_sel ;
|
||
|
tr_temp.spd_sel = pif.spd_sel ;
|
||
|
tr_temp.fll_sel = pif.fll_sel ;
|
||
|
tr_temp.vco_tc = pif.vco_tc ;
|
||
|
tr_temp.vco_tcr = pif.vco_tcr ;
|
||
|
tr_temp.vco_gain_adj = pif.vco_gain_adj ;
|
||
|
tr_temp.vco_gain_adj_r = pif.vco_gain_adj_r ;
|
||
|
tr_temp.vco_cur_adj = pif.vco_cur_adj ;
|
||
|
tr_temp.vco_buff_en = pif.vco_buff_en ;
|
||
|
tr_temp.vco_en = pif.vco_en ;
|
||
|
tr_temp.pll_dpwr_adj = pif.pll_dpwr_adj ;
|
||
|
tr_temp.vco_fb_adj = pif.vco_fb_adj ;
|
||
|
tr_temp.afc_en = pif.afc_en ;
|
||
|
tr_temp.afc_reset = pif.afc_reset ;
|
||
|
tr_temp.afc_shutdown = pif.afc_shutdown ;
|
||
|
tr_temp.flag_out_sel = pif.flag_out_sel ;
|
||
|
tr_temp.afc_det_speed = pif.afc_det_speed ;
|
||
|
tr_temp.afc_cnt = pif.afc_cnt ;
|
||
|
tr_temp.afc_ld_cnt = pif.afc_ld_cnt ;
|
||
|
tr_temp.afc_pres = pif.afc_pres ;
|
||
|
tr_temp.afc_ld_tcc = pif.afc_ld_tcc ;
|
||
|
tr_temp.afc_fb_tcc = pif.afc_fb_tcc ;
|
||
|
tr_temp.div_rstn_sel = pif.div_rstn_sel ;
|
||
|
tr_temp.test_clk_sel = pif.test_clk_sel ;
|
||
|
tr_temp.test_clk_oen = pif.test_clk_oen ;
|
||
|
tr_temp.dig_clk_sel = pif.dig_clk_sel ;
|
||
|
tr_temp.div_sync_en = pif.div_sync_en ;
|
||
|
tr_temp.sync_oe = pif.sync_oe ;
|
||
|
|
||
|
act_trans.push_back(tr_temp);
|
||
|
|
||
|
endtask: collect
|