Skip to content

Commit 47b020a

Browse files
authored
test: Verilator compile fixes (#255)
1 parent 0d3b168 commit 47b020a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

test/cdc_2phase_clearable_tb.sv

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,16 @@ module cdc_2phase_clearable_tb_delay_injector #(
368368
.a_rst_ni ( src_rst_ni ),
369369
.a_clear_i ( src_clear_i ),
370370
.a_clear_o ( s_src_clear ),
371+
.a_clear_ack_i ( '0 ),
372+
.a_isolate_o ( ),
373+
.a_isolate_ack_i( '0 ),
371374
.b_clk_i ( dst_clk_i ),
372375
.b_rst_ni ( dst_rst_ni ),
373376
.b_clear_i ( dst_clear_i ),
374-
.b_clear_o ( s_dst_clear )
377+
.b_clear_o ( s_dst_clear ),
378+
.b_clear_ack_i ( '0 ),
379+
.b_isolate_o ( ),
380+
.b_isolate_ack_i( '0 )
375381
);
376382

377383
assign src_clear_pending_o = s_src_clear;

test/clk_int_div_static_tb.sv

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ module clk_int_div_static_tb;
3535
.rst_no ( rstn )
3636
);
3737

38+
// https://github.com/verilator/verilator/issues/5979
39+
`ifndef VERILATOR
3840
property T_clk(real clk_period);
3941
realtime current_time;
4042
realtime actual_period;
@@ -43,7 +45,7 @@ module clk_int_div_static_tb;
4345
('1, actual_period = $realtime - current_time) |->
4446
(($realtime - current_time >= clk_period - t_delta) && ($realtime - current_time < clk_period + t_delta));
4547
endproperty
46-
48+
`endif
4749

4850
for (genvar i = 1; i < MaxClkDiv; i++) begin :gen_clk_divs
4951
clk_int_div_static #(
@@ -57,8 +59,10 @@ module clk_int_div_static_tb;
5759
.clk_o ( clk_out[i] )
5860
);
5961

62+
`ifndef VERILATOR
6063
assert_period_period: assert property (@(posedge clk_out[i]) T_clk(TClkIn*i)) else
6164
$error("Output period of div %d clock is incorrect. Should be in range %d to %d.", i, TClkIn*i-t_delta, TClkIn*i+t_delta);
65+
`endif
6266

6367
end
6468

test/fifo_tb.sv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,15 @@ module fifo_inst_tb #(
147147
end
148148
end
149149

150+
// https://github.com/verilator/verilator/issues/5981
151+
`ifndef VERILATOR
150152
if (FALL_THROUGH) begin
151153
// In fall through mode, assert that the output data is equal to the input data when pushing
152154
// to an empty FIFO.
153155
assert property (@(posedge clk_i) ((empty & ~push) ##1 push) |-> rdata == wdata)
154156
else $error("Input did not fall through");
155157
end
158+
`endif
156159

157160
endmodule
158161

0 commit comments

Comments
 (0)