RISC-V_Verilog/tb/tb_tools.vh

16 lines
558 B
Plaintext
Raw Normal View History

2023-10-23 08:34:37 +00:00
`define assert(message, expected, got) \
2023-10-24 11:08:36 +00:00
#4 \
2023-10-23 08:34:37 +00:00
if(expected !== got) begin \
$display("\033[0;31m[FAILED]\033[0m : %s - got: %d, expected: %d", message, expected, got); \
end
2023-10-24 12:19:24 +00:00
`define assert_no_wait(message, expected, got) \
if(expected !== got) begin \
$display("\033[0;31m[FAILED]\033[0m : %s - got: %d, expected: %d", message, expected, got); \
end
2023-10-23 08:34:37 +00:00
`define end_message $display("\033[0;32mIf no \033[0m[FAILED]\033[0;32m messages, all tests passed!\033[0m");
2023-10-24 12:19:24 +00:00
`define next_cycle \
#1 clk = ~clk; \
#1 clk = ~clk;