Hello, I have written the following property to check that the actual valid count (ie the number of times wr_vld is high) is less that or equal to the expected valid count calculated from vld_count, the valid is counted as long as I have wr_vld high and until I see an instr_done or clr ==1 where it reset the counter to 0. However, the assertion works fine under some cases but for few tests, the uvm_info gets displayed twice in the same cycle leading to incrementing the counter twice in one cycle as a result of which the actual count exceeds the expected count but in reality from the waveform it is less that the expected value. It is basically due to multiple
uvm_info in same cycle. The error message is also shown below. What could be the reason for it?The arrow (|) points at until in the property. Please help!
Also, is there a way I can increment the count in the property itself instead in the function and just display the counter values in the function for the following implementation? I tried one way to increment the counter in the property but it increment only once. Also tried to include [*0:$] to increment on every clock as long as the valid is high but even that didn’t work!
function int wr_num_exp_instr(int calc_vld_count);begin
begin wr_num_exp_instr = calc_vld_count;end
uvm_info("PROPERTY",$psprintf(" EXPECTED INSTRUCTION COUNT :%0d",wr_num_exp_instr) ,UVM_NONE) end endfunction function int wr_act_instr_cnt_func( int wr_exp_instr_cnt);begin if(instr_done ==1 || clr == 1) wr_act_instr_cnt_func = 0; else wr_act_instr_cnt_func++; line 514
uvm_info(“PROPERTY”,psprintf("label ACTUAL VALID COUNT IS :%0d label EXPECTED INSTRUCTION COUNT:%0d ",wr_act_instr_cnt_func,wr_exp_instr_cnt) ,UVM_NONE)
end
endfunction
property wr_num_instr_match_num_vld_start_p;
int wr_exp_instr_cnt;
int wr_act_instr_cnt ;
@(posedge clk) disable iff(!rstn || disable_check == 1)
(((enable==1) ##0 first_match( ##[0:] drm_wr_vld) |-> (((wr_vld,wr_exp_instr_cnt = wr_num_exp_instr(vld_count),wr_act_instr_cnt = wr_act_instr_cnt_func( wr_exp_instr_cnt)) |-> (wr_act_instr_cnt<=wr_exp_instr_cnt)) until (instr_done,wr_act_instr_cnt =wr_act_instr_cnt_func(wr_exp_instr_cnt))) ;
endproperty
assert property (wr_num_instr_match_num_vld_start_p)
else begin
`uvm_error(“PROPERTY”,$psprintf("wr_num_instr_match_num_vld_start_p failure "))
end;
UVM_INFO sva_cov.sv(532) @ 97000: reporter [PROPERTY] EXPECTED INSTRUCTION COUNT :14
UVM_INFO sva_cov.sv(514) @ 98000: reporter [PROPERTY] label ACTUAL VALID COUNT IS :14 label EXPECTED INSTRUCTION COUNT:14
UVM_INFO sva_cov.sv(514) @ 98000: reporter [PROPERTY] label ACTUAL VALID COUNT IS :15 label EXPECTED INSTRUCTION COUNT:14
(((enable==1) ##0 first_match( ##[0:$] drm_wr_vld) |-> (((wr_vld,wr_exp_instr_cnt = wr_num_exp_instr(vld_count),wr_act_instr_cnt = wr_act_instr_cnt_func( wr_exp_instr_cnt)) |-> (wr_act_instr_cnt<=wr_exp_instr_cnt)) until (instr_done,wr_act_instr_cnt =wr_act_instr_cnt_func(wr_exp_instr_cnt))) ;
|
xmsim: *E,ASRTST (sva_cov.sv,517): (time 98 NS) Assertion sva.wr_num_instr_match_num_vld_start_p has failed (1 cycles, starting 98 NS)
UVM_ERROR sva_cov.sv(525) @ 98000: reporter [PROPERTY] wr_num_instr_match_num_vld_start_p failure