From 04690d631eb9fc6440ab64df3126a8628f9c91de Mon Sep 17 00:00:00 2001 From: lf <15201710458@163.com> Date: Fri, 24 Jul 2020 23:11:21 +0800 Subject: [PATCH] add assertion --- tb/sm3_pad_mntr.sv | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tb/sm3_pad_mntr.sv b/tb/sm3_pad_mntr.sv index d760433..e23788e 100644 --- a/tb/sm3_pad_mntr.sv +++ b/tb/sm3_pad_mntr.sv @@ -62,10 +62,22 @@ always @(posedge sm3_pad_reg_cmpr) begin $display("Mess:@%0t:result compare %d times",$time,total_cnt); foreach(gldn_pttrn[i]) sm3_gldn_pttrn_reg[511 -32*i-:32] = gldn_pttrn[i];//do a copy to a ref array .hhh - if (sm3_gldn_pttrn_reg == sm3_pad_lst_blk_reg) begin + + // if (sm3_gldn_pttrn_reg == sm3_pad_lst_blk_reg) begin + // ok_cnt++; + // $display("Mess:@%0t:check ok and ok %d times",$time,ok_cnt); + // end else begin + // fail_cnt++; + // $display("Err:@%0t:check fail and fail %d times",$time,fail_cnt); + // $stop; + // end + + cmpr_a1:assert (sm3_gldn_pttrn_reg == sm3_pad_lst_blk_reg) + begin ok_cnt++; $display("Mess:@%0t:check ok and ok %d times",$time,ok_cnt); - end else begin + end + else begin fail_cnt++; $display("Err:@%0t:check fail and fail %d times",$time,fail_cnt); $stop;