Display errors in tb_tk1 even if DEBUG is 0

Always display errors to make them easy to find and troubleshoot.
This commit is contained in:
Mikael Ågren 2024-11-22 14:21:54 +01:00
parent 97b1ea6df2
commit 1a450cfddb
No known key found for this signature in database
GPG Key ID: E02DA3D397792C46

View File

@ -18,7 +18,7 @@ module tb_tk1 ();
//---------------------------------------------------------------- //----------------------------------------------------------------
// Internal constant and parameter definitions. // Internal constant and parameter definitions.
//---------------------------------------------------------------- //----------------------------------------------------------------
parameter DEBUG = 1; parameter DEBUG = 0;
parameter CLK_HALF_PERIOD = 1; parameter CLK_HALF_PERIOD = 1;
parameter CLK_PERIOD = 2 * CLK_HALF_PERIOD; parameter CLK_PERIOD = 2 * CLK_HALF_PERIOD;
@ -353,16 +353,15 @@ module tb_tk1 ();
#(CLK_PERIOD); #(CLK_PERIOD);
tb_cs = 1'h0; tb_cs = 1'h0;
if (DEBUG) begin if (read_data == expected) begin
if (read_data == expected) begin if (DEBUG) begin
$display("--- Reading 0x%08x from 0x%02x.", read_data, address); $display("--- Reading 0x%08x from 0x%02x.", read_data, address);
end end
else begin end
$display("--- Error: Got 0x%08x when reading from 0x%02x, expected 0x%08x", read_data, else begin
address, expected); $display("--- Error: Got 0x%08x when reading from 0x%02x, expected 0x%08x", read_data,
error_ctr = error_ctr + 1; address, expected);
end error_ctr = error_ctr + 1;
$display("");
end end
end end
endtask // read_check_word endtask // read_check_word