SPI_Test/tb/testbench/sysreg_tb/sysreg_trans.sv

138 lines
3.9 KiB
Systemverilog
Raw Normal View History

2024-06-25 16:41:01 +08:00
class sysreg_trans;
//Properties for Randomizing the MOSI
/*bit pll_lock;
bit pll_lost_lock;
bit ch0_dbg_upd ;
bit ch0_dbg_fifo_e;
bit ch0_dbg_fifo_f;
bit ch0_ldst_addr_unalgn;
bit ch0_dec_err;
bit ch0_exit_irq ;
bit ch1_dbg_upd ;
bit ch1_dbg_fifo_e ;
bit ch1_dbg_fifo_f ;
bit ch1_ldst_addr_unalgn ;
bit ch1_dec_err ;
bit ch1_exit_irq ;
bit ch2_dbg_upd ;
bit ch2_dbg_fifo_e ;
bit ch2_dbg_fifo_f ;
bit ch2_ldst_addr_unalgn ;
bit ch2_dec_err ;
bit ch2_exit_irq ;
bit ch3_dbg_upd ;
bit ch3_dbg_fifo_e ;
bit ch3_dbg_fifo_f ;
bit ch3_ldst_addr_unalgn ;
bit ch3_dec_err ;
bit ch3_exit_irq ;
bit sys_soft_rstn ;
bit mcu_soft_rstn ;
bit awg_soft_rstn ;
bit dac_soft_rstn ;
bit irq ;*/
rand int pll_lock_time ;
rand int pll_lost_lock_time ;
rand int ch0_dbg_upd_time ;
rand int ch0_dbg_fifo_e_time ;
rand int ch0_dbg_fifo_f_time ;
rand int ch0_ldst_addr_unalgn_time;
rand int ch0_dec_err_time ;
rand int ch0_exit_irq_time ;
rand int ch1_dbg_upd_time ;
rand int ch1_dbg_fifo_e_time ;
rand int ch1_dbg_fifo_f_time ;
rand int ch1_ldst_addr_unalgn_time;
rand int ch1_dec_err_time ;
rand int ch1_exit_irq_time ;
rand int ch2_dbg_upd_time ;
rand int ch2_dbg_fifo_e_time ;
rand int ch2_dbg_fifo_f_time ;
rand int ch2_ldst_addr_unalgn_time ;
rand int ch2_dec_err_time ;
rand int ch2_exit_irq_time ;
rand int ch3_dbg_upd_time ;
rand int ch3_dbg_fifo_e_time ;
rand int ch3_dbg_fifo_f_time ;
rand int ch3_ldst_addr_unalgn_time ;
rand int ch3_dec_err_time ;
rand int ch3_exit_irq_time ;
constraint cstr {
pll_lock_time <= 5000 ;
pll_lost_lock_time <= 5000 ;
ch0_dbg_upd_time <= 5000 ;
ch0_dbg_fifo_e_time <= 5000 ;
ch0_dbg_fifo_f_time <= 5000 ;
ch0_ldst_addr_unalgn_time <= 5000 ;
ch0_dec_err_time <= 5000 ;
ch0_exit_irq_time <= 5000 ;
ch1_dbg_upd_time <= 5000 ;
ch1_dbg_fifo_e_time <= 5000 ;
ch1_dbg_fifo_f_time <= 5000 ;
ch1_ldst_addr_unalgn_time <= 5000 ;
ch1_dec_err_time <= 5000 ;
ch1_exit_irq_time <= 5000 ;
ch2_dbg_upd_time <= 5000 ;
ch2_dbg_fifo_e_time <= 5000 ;
ch2_dbg_fifo_f_time <= 5000 ;
ch2_ldst_addr_unalgn_time <= 5000 ;
ch2_dec_err_time <= 5000 ;
ch2_exit_irq_time <= 5000 ;
ch3_dbg_upd_time <= 5000 ;
ch3_dbg_fifo_e_time <= 5000 ;
ch3_dbg_fifo_f_time <= 5000 ;
ch3_ldst_addr_unalgn_time <= 5000 ;
ch3_dec_err_time <= 5000 ;
ch3_exit_irq_time <= 5000 ;
pll_lock_time > 10 ;
pll_lost_lock_time > 10 ;
ch0_dbg_upd_time > 10 ;
ch0_dbg_fifo_e_time > 10 ;
ch0_dbg_fifo_f_time > 10 ;
ch0_ldst_addr_unalgn_time > 10 ;
ch0_dec_err_time > 10 ;
ch0_exit_irq_time > 10 ;
ch1_dbg_upd_time > 10 ;
ch1_dbg_fifo_e_time > 10 ;
ch1_dbg_fifo_f_time > 10 ;
ch1_ldst_addr_unalgn_time > 10 ;
ch1_dec_err_time > 10 ;
ch1_exit_irq_time > 10 ;
ch2_dbg_upd_time > 10 ;
ch2_dbg_fifo_e_time > 10 ;
ch2_dbg_fifo_f_time > 10 ;
ch2_ldst_addr_unalgn_time > 10 ;
ch2_dec_err_time > 10 ;
ch2_exit_irq_time > 10 ;
ch3_dbg_upd_time > 10 ;
ch3_dbg_fifo_e_time > 10 ;
ch3_dbg_fifo_f_time > 10 ;
ch3_ldst_addr_unalgn_time > 10 ;
ch3_dec_err_time > 10 ;
ch3_exit_irq_time > 10 ;
}
function new();
endfunction
extern function bit compare(spi_trans rhs_);
extern function void print();
extern function void unpack(ref bit stream[$]);
endclass : sysreg_trans