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