I was wondering if it is possible to enable support for the math functions in SystemVerilog (such as $sin) in the AMS simulator. When I try to run a systemverilog file including $sin built-in function in IEEE 1800-2009, I get the following error:
sjit = AMP_NOISE*($sin($realtime*2*PI/TNOISE));
Unrecognized system task or function (did not match built-in or user-defined names) [2.7.4(IEEE Std 1364-2001)].
The file runs without a problem in another system verilog simulator (Questa). Is there any option that I should use in the AMS simulator? Or does it simply not support the basic math functions?
I am using IC6.1.5.
Are you putting this code in a SystemVerilog view? Or in a VerilogAMS or Verilog view? It has to be in a SystemVerilog view.
I tried (from the command line, since it was quick to test) putting this in a file called "forum.sv":
module forum;parameter real AMP_NOISE=1.0;parameter real PI=3.1415926;parameter real TNOISE=1e-6;real sjit;always #10 begin sjit = AMP_NOISE*($sin($realtime*2*PI/TNOISE)); $strobe(sjit); endalways #1000 $finish;endmodule
And then ran "irun forum.sv" - and it worked fine. The ".sv" suffix told irun that this is SystemVerilog.