Skip to content

Commit

Permalink
Finished simulation when uart char is illegal
Browse files Browse the repository at this point in the history
  • Loading branch information
Siudya committed Nov 7, 2023
1 parent c9f40c0 commit 58593d5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/test/vsrc/vcs/top.v
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,14 @@ assign io_uart_in_ch = 8'hff;

always @(posedge clock) begin
if (!reset && io_uart_out_valid) begin
if(io_uart_out_ch[7] == 1'b1) $finish();
$fwrite(32'h8000_0001, "%c", io_uart_out_ch);
$fflush();
if(io_uart_out_ch[7] == 0) begin
$fwrite(32'h8000_0001, "%c", io_uart_out_ch);
$fflush();
end
else begin
$display("\033[32mHIT GOOD TRAP!\033[0m");
$finish;
end
end
end

Expand Down

0 comments on commit 58593d5

Please sign in to comment.