From 4db3780ebbd91f7dd4567a279be948b6c6ac8421 Mon Sep 17 00:00:00 2001 From: David Harris Date: Tue, 4 May 2021 01:19:44 -0400 Subject: [PATCH] Fixed testbench to produce error when signature.output doesn't exist --- wally-pipelined/testbench/testbench-imperas.sv | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wally-pipelined/testbench/testbench-imperas.sv b/wally-pipelined/testbench/testbench-imperas.sv index c186ae160..332c86567 100644 --- a/wally-pipelined/testbench/testbench-imperas.sv +++ b/wally-pipelined/testbench/testbench-imperas.sv @@ -524,11 +524,17 @@ module testbench(); signature[i/2] = {sig32[i+1], sig32[i]}; i = i + 2; end + if (sig32[i-1] === 'bx) begin + if (i == 1) begin + i = SIGNATURESIZE+1; // flag empty file + $display(" Error: empty test file"); + end else i = SIGNATURESIZE; // skip over the rest of the x's for efficiency + end end // Check errors + errors = (i == SIGNATURESIZE+1); // error if file is empty i = 0; - errors = 0; if (`XLEN == 32) testadr = (`TIMBASE+tests[test+1].atohex())/4; else