SPI_Test/tb/sram_tb/ram_trans.sv

29 lines
486 B
Systemverilog
Raw Normal View History

2024-06-25 16:41:01 +08:00
class ram_trans;
rand bit[31 :0] dout [8192];
constraint cstr {
dout >= 0 ;
dout <= 2000;
}
function new();
endfunction
function bit[7:0] compare(ram_trans tr);
bit result= 1'b0;
if(tr.dout != dout ) result = 1'b1;
return result;
endfunction
function print(bit ctrl,integer fid);
if(ctrl[0]) begin
$fwrite(fid,"s_data =%b\n",dout );
end
endfunction
endclass : ram_trans