mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2024-12-24 06:59:24 -05:00
tb: Make uart selftesting
- Exit with the right exit code
This commit is contained in:
parent
c637c745cc
commit
66888a3756
@ -324,6 +324,23 @@ module tb_uart ();
|
||||
endtask // display_test_result
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// 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
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// uart_test
|
||||
// The main test functionality.
|
||||
@ -340,7 +357,7 @@ module tb_uart ();
|
||||
|
||||
display_test_result();
|
||||
$display("*** Simulation done.");
|
||||
$finish;
|
||||
exit_with_error_code();
|
||||
end // uart_test
|
||||
endmodule // tb_uart
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user