If I simulate the following module:
module test;
longint seconds;
initial begin
seconds = $system("date +%s");
$display("Seconds: %0d", seconds);
$finish;
end
endmodule
The output from both ncsim and vsim is:
1571172006
Seconds: 0
So I can see that the $system call is printing the time in seconds 1571172006, however the variable seconds has a value of 0 so I'm not saving that value.
Is there a way for me to save that value? (Preferably not using DPI)
Thanks in advance.