beepo/tests/adding/adding.v

34 lines
747 B
Coq
Raw Normal View History

2023-11-15 19:55:46 -06:00
`include "../../src/beepo.v"
`timescale 100us/10ns
`define assert(signal, value) \
if (signal !== value) begin \
$display("ASSERTION FAILED in %m: signal != value"); \
$finish; \
end
2023-11-15 21:21:06 -06:00
module tb_adding();
reg clk = 0;
2023-11-15 19:55:46 -06:00
2023-11-15 21:21:06 -06:00
Beepo #(
.FREQ(1),
.UART_BAUD(1_000_000)
) bep (
.i_clk(clk)
);
2023-11-15 19:55:46 -06:00
localparam CLK_PERIOD = 1.0;
always #(CLK_PERIOD/2) clk=~clk;
initial begin
2023-11-17 12:53:35 -06:00
$dumpfile("build/dump.vcd");
$dumpvars(0, tb_adding, bep.r_registers[1]);
2023-11-15 19:55:46 -06:00
end
2023-11-15 21:21:06 -06:00
// should probably do more granular tests
2023-11-15 19:55:46 -06:00
initial #10000 begin
`assert(bep.r_registers[1], 64'h2020202040406090);
2023-11-17 12:53:35 -06:00
$display("[ADDING] All tests passed");
2023-11-15 19:55:46 -06:00
$finish;
end
endmodule