tb: Make tb_tk1.v selftesting

- Exit with the right error code
This commit is contained in:
Daniel Jobson 2024-11-21 14:21:36 +01:00
parent 07dec8b8dc
commit 09c3d9b58e
No known key found for this signature in database
GPG Key ID: 3707A9DBF4BB8F1A

View File

@ -714,6 +714,22 @@ module tb_tk1 ();
end
endtask // test10
//----------------------------------------------------------------
// exit_with_error_code()
//
// Exit with the right error code
//----------------------------------------------------------------
task exit_with_error_code;
begin
if (error_ctr == 0) begin
$finish(0);
end
else begin
$fatal(1);
end
end
endtask // exit_with_error_code
//----------------------------------------------------------------
// tk1_test
@ -744,7 +760,7 @@ module tb_tk1 ();
$display(" -= Testbench for tk1 completed =-");
$display(" =============================");
$display("");
$finish;
exit_with_error_code();
end // tk1_test
endmodule // tb_tk1