1
0
mirror of https://github.com/olofk/serv.git synced 2026-04-27 12:48:42 +00:00

Refactor testbench

Introduce an intermediate common simulation toplevel for verilator
and other sims
This commit is contained in:
Olof Kindgren
2020-03-03 09:15:50 +01:00
parent 3468958f1e
commit c9a3c883f1
6 changed files with 74 additions and 40 deletions

18
bench/uart_decoder.v Normal file
View File

@@ -0,0 +1,18 @@
module uart_decoder
#(parameter BAUD_RATE = 115200)
(input rx);
localparam T = 1000000000/BAUD_RATE;
integer i;
reg [7:0] ch;
initial forever begin
@(negedge rx);
#(T/2) ch = 0;
for (i=0;i<8;i=i+1)
#T ch[i] = rx;
$write("%c",ch);
$fflush;
end
endmodule