2024-05-08 14:31:34 +02:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
|
//
|
2026-01-27 02:24:34 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain
|
|
|
|
|
// SPDX-FileCopyrightText: 2024 Antmicro
|
2024-05-08 14:31:34 +02:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
module t (
|
|
|
|
|
input clk
|
|
|
|
|
);
|
2024-05-08 14:31:34 +02:00
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
module_with_assert module_with_assert (clk);
|
|
|
|
|
module_with_assertctl module_with_assertctl (clk);
|
2024-05-08 14:31:34 +02:00
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
always @(posedge clk) begin
|
|
|
|
|
assert (0);
|
|
|
|
|
end
|
2024-05-08 14:31:34 +02:00
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
always @(negedge clk) begin
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2024-05-08 14:31:34 +02:00
|
|
|
endmodule
|
|
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
module module_with_assert (
|
|
|
|
|
input clk
|
|
|
|
|
);
|
|
|
|
|
always @(posedge clk) assert (0);
|
2024-05-08 14:31:34 +02:00
|
|
|
endmodule
|
|
|
|
|
|
2026-03-03 13:21:24 +01:00
|
|
|
module module_with_assertctl (
|
|
|
|
|
input clk
|
|
|
|
|
);
|
|
|
|
|
function void assert_off;
|
|
|
|
|
begin
|
2024-05-08 14:31:34 +02:00
|
|
|
$assertoff;
|
2026-03-03 13:21:24 +01:00
|
|
|
end
|
|
|
|
|
endfunction
|
|
|
|
|
function void assert_on;
|
|
|
|
|
begin
|
2024-05-08 14:31:34 +02:00
|
|
|
$asserton;
|
2026-03-03 13:21:24 +01:00
|
|
|
end
|
|
|
|
|
endfunction
|
|
|
|
|
function void f_assert;
|
|
|
|
|
begin
|
|
|
|
|
assert (0);
|
|
|
|
|
end
|
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
initial begin
|
|
|
|
|
assert_on();
|
|
|
|
|
assert (0);
|
|
|
|
|
assert_off();
|
|
|
|
|
assert_off();
|
|
|
|
|
assert (0);
|
|
|
|
|
assert_on();
|
|
|
|
|
assert_on();
|
|
|
|
|
assert (0);
|
|
|
|
|
|
|
|
|
|
f_assert();
|
|
|
|
|
f_assert();
|
|
|
|
|
assert_off();
|
|
|
|
|
f_assert();
|
|
|
|
|
f_assert();
|
|
|
|
|
end
|
2024-05-08 14:31:34 +02:00
|
|
|
endmodule
|