mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-12-25 07:29:25 -05:00
tb: Make trng selftesting
- Exit with the right error code
This commit is contained in:
parent
ac853c87ec
commit
c637c745cc
@ -177,7 +177,7 @@ module tb_trng ();
|
|||||||
// the word read will be available in the global variable
|
// the word read will be available in the global variable
|
||||||
// read_data.
|
// read_data.
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
task read_word(input [ 7 : 0] address, input [31 : 0] expected);
|
task read_word(input [7 : 0] address, input [31 : 0] expected);
|
||||||
begin : read_word
|
begin : read_word
|
||||||
reg [31 : 0] read_data;
|
reg [31 : 0] read_data;
|
||||||
|
|
||||||
@ -221,6 +221,22 @@ module tb_trng ();
|
|||||||
end
|
end
|
||||||
endtask // test1
|
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
|
// trng_test
|
||||||
@ -240,7 +256,7 @@ module tb_trng ();
|
|||||||
$display(" -= Testbench for trng completed =-");
|
$display(" -= Testbench for trng completed =-");
|
||||||
$display(" ==============================");
|
$display(" ==============================");
|
||||||
$display("");
|
$display("");
|
||||||
$finish;
|
exit_with_error_code();
|
||||||
end // trng_test
|
end // trng_test
|
||||||
endmodule // tb_trng
|
endmodule // tb_trng
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user