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.
In reply to Andrew Beckett:
I am running from systemverilog view. Below is the irun arguments I got from the output log file (I redacted some of the company specific arguments). The line in bold italic is where the systemverilog view is defined.
irun -f irunArgs -clean -UNBUFFERED -noupdate -errormax 50 -status -nowarn DLNOHV -v93 -timescale 1ns/1ns -vtimescale 1ns/1ns -discipline logic -delay_mode None -novitalaccl -access r -iereport -amspartinfo ../psf/partition.info -analogcontrol ./amsControlSpectre.scs -input ./probe.tcl -run -exit -ncsimargs "+amsrawdir ../psf" -simcompatible_ams spectre -name test:config_AMS -allowredefinition -amsbind -top test -top cds_globals ./netlist.vams -f ./textInputs -amscompilefile "***/clockgen/systemverilog/verilog.sv lib:***_lib cell:clockgen view:systemverilog" ./cds_globals.vams -l ../psf/irun.log -spectre_args +aps -spectre_args -mt