diff --git a/TESTBENCH/register_file_tb.v b/TESTBENCH/register_file_tb.v index f9de925..89c8710 100644 --- a/TESTBENCH/register_file_tb.v +++ b/TESTBENCH/register_file_tb.v @@ -84,7 +84,7 @@ begin else no_of_pass = no_of_pass + 1; result[ridx] = DATA_R1; ridx=ridx+1; - result[ridx] = DATA_R1; ridx=ridx+1; + // result[ridx] = DATA_R1; ridx=ridx+1; end @@ -100,10 +100,22 @@ begin else no_of_pass = no_of_pass + 1; result[ridx] = DATA_R1; ridx=ridx+1; - result[ridx] = DATA_R1; ridx=ridx+1; + // result[ridx] = DATA_R1; ridx=ridx+1; end +// Test reading when READ=0 +#5 READ=1'b0; +#5 no_of_test = no_of_test + 1; +if (DATA_R1 !== 32'bZ) + $write("[TEST @ %0dns] READ=0, expecting DATA_R1 to be HiZ, got %8h [FAILED]\n", $time, DATA_R1); +else if (DATA_R2 !== 32'bZ) + $write("[TEST @ %0dns] READ=0, expecting DATA_R2 to be HiZ, got %8h [FAILED]\n", $time, DATA_R2); +else +no_of_pass = no_of_pass + 1; +result[ridx] = DATA_R1; ridx=ridx+1; +// result[ridx] = DATA_R1; ridx=ridx+1; + // TODO: Read and write from the same address at the same time? #5 READ=1'b0; WRITE=1'b0; // No op