Hi
Want to access the array with different width sizes along with different upper and lower limits .
The Sample code is as follows (Ignore the begin/end syntax )
foreach(fields[i]) begin
if(fields[i].get_name().substr(0,7) != "reserved") begin
const int lsb_i= fields[i].get_lsb_pos() ;
const int msb_i = fields[i].get_lsb_pos() + fields[i].get_n_bits()-1;
int size_of = msb_i - lsb_i + 1;
if((r_data[msb_i -:size_of] ) ==( m_data[msb_i -:size_of] ) )
begin
`uvm_info(get_type_name(),$sformatf("Matching data for Reg %s with fields[i] %s read data = %0h and mirror_data = %0h @ Addr=%0h", regs[i].get_name(), fields[i].get_name() ,r_data ,m_data, regs[i].get_address()), UVM_MEDIUM);
end
else
`uvm_error(get_name(),$sformatf("MIsMatching data for Reg %s with fields[i] %s read data = %0h and mirror_data = %0h @ Addr=%0h", regs[i].get_name(), fields[i].get_name() ,r_data ,m_data, regs[i].get_address()));
end
The Problem is with the BLOCK code ,
The array doesnt suppoort the indices for range being variable .
I get an error as follows :
if((r_data[msb_i -:size_of] ) ==( m_data[msb_i -:size_of] ) )
|
xmvlog: *E,NOTPAR (/vobs/asic/hawkowl/src/jor/src/jor_top_sec/tb/lib/env/er_jor_insec_reg_seq_lib.svh,220|35): Illegal operand for constant expression [4(IEEE)].
if((r_data[msb_i -:size_of] ) ==( m_data[msb_i -:size_of] ) )
|
xmvlog: *E,NOTPAR (/vobs/asic/hawkowl/src/jor/src/jor_top_sec/tb/lib/env/er_jor_insec_reg_seq_lib.svh,220|65): Illegal operand for constant expression [4(IEEE)].
So please help me solving this issue .
Thanks in advance