Skip to content

Commit

Permalink
tb: make trng selftesting
Browse files Browse the repository at this point in the history
- Exit with the right error code
  • Loading branch information
dehanj committed Dec 9, 2024
1 parent ca912f5 commit 7f84270
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion hw/application_fpga/core/trng/tb/tb_trng.v
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,22 @@ module tb_trng ();
end
endtask // test1

//----------------------------------------------------------------
// 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


//----------------------------------------------------------------
// trng_test
Expand All @@ -240,7 +256,7 @@ module tb_trng ();
$display(" -= Testbench for trng completed =-");
$display(" ==============================");
$display("");
$finish;
exit_with_error_code();
end // trng_test
endmodule // tb_trng

Expand Down

0 comments on commit 7f84270

Please sign in to comment.