Mantis 1863

P1800-2008/D4, Clause 19

Add $system

In P1800-2008/D4,

ADD new Section 19.n (subclause number n to be supplied by editor) at end of Clause 19:

19.n Miscellaneous tasks and functions

19.n.1 $system

 

The syntax for $system is shown in Syntax 19-xx. (xx to be supplied by editor)

 

system_call ::=

$system ( [ "  terminal_command_line " ] )

Syntax 19-xx—Syntax for $system (not in Annex A)

$system makes a call to the C function system(). The C function executes the argument passed to it as if the argument was executed from the terminal. $system can be called as either a task or a function. When called as a function, it returns the return value of the call to system() with data type int. If $system is called with no string argument, the C function system() will be called with the NULL string.

The example below calls $system as a task to rename a file.

module top;
  initial $system(“mv design.v adder.v”);
endmodule