2011-11-20 08:01:48 +01: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: 2011 Wilson Snyder
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2011-11-20 08:01:48 +01:00
|
|
|
|
|
|
|
|
module t;
|
|
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
integer i;
|
|
|
|
|
string s;
|
2011-11-20 08:01:48 +01:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
initial begin
|
2011-11-20 08:01:48 +01:00
|
|
|
`ifndef VERILATOR
|
2026-03-10 02:38:29 +01:00
|
|
|
`ifndef VCS
|
|
|
|
|
`ifndef NC
|
|
|
|
|
$system(); // Legal per spec, but not supported everywhere and nonsensical
|
|
|
|
|
`endif
|
|
|
|
|
`endif
|
2011-11-20 08:01:48 +01:00
|
|
|
`endif
|
2026-03-10 02:38:29 +01:00
|
|
|
$system("ls"); // IData
|
|
|
|
|
$system("exit 0"); // QData
|
|
|
|
|
$system("echo hello"); // WDATA
|
2011-11-20 08:01:48 +01:00
|
|
|
`ifndef VCS
|
2026-03-10 02:38:29 +01:00
|
|
|
i = $system("exit 0");
|
|
|
|
|
if (i !== 0) $stop;
|
|
|
|
|
i = $system("exit 10");
|
|
|
|
|
if (i !== 10) $stop;
|
|
|
|
|
i = $system("exit 20"); // Wide
|
|
|
|
|
if (i !== 20) $stop;
|
|
|
|
|
s = "exit 10";
|
|
|
|
|
i = $system(s); // String
|
|
|
|
|
if (i !== 10) $stop;
|
2011-11-20 08:01:48 +01:00
|
|
|
`endif
|
|
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2011-11-20 08:01:48 +01:00
|
|
|
|
|
|
|
|
endmodule
|