verilator/test_regress/t/t_sys_system.v

40 lines
830 B
Systemverilog
Raw Normal View History

2011-11-20 08:01:48 +01:00
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2011 Wilson Snyder
// 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