From 890514769808476225c58ccccf889d42c9d41b74 Mon Sep 17 00:00:00 2001 From: Laszlo Nagy Date: Wed, 10 Aug 2022 09:57:59 +0100 Subject: [PATCH] common/tb/ad_pack_tb: Add non random scenario as first test for easier debug --- library/common/tb/ad_pack_tb.v | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/library/common/tb/ad_pack_tb.v b/library/common/tb/ad_pack_tb.v index d415ace8c..6cf271961 100644 --- a/library/common/tb/ad_pack_tb.v +++ b/library/common/tb/ad_pack_tb.v @@ -31,14 +31,14 @@ module ad_pack_tb; .odata(odata), .ovalid(ovalid)); - task test(); + task test(input random_n); begin @(posedge clk); i = 0; j = 0; while (i < (VECT_W/(I_W*UNIT_W) + (VECT_W%(I_W*UNIT_W)>0))) begin @(posedge clk); - if ($urandom % 2 == 0) begin + if ($urandom % 2 == 0 | random_n) begin idata <= input_vector[i*(I_W*UNIT_W) +: (I_W*UNIT_W)]; ivalid <= 1'b1; i = i + 1; @@ -59,6 +59,11 @@ module ad_pack_tb; $display("i=%d Expected=%x Found=%x",i,input_vector[i*8+:8],output_vector[i*8+:8]); end end + // Clear output vector + for (i=0; i