I am making a simple decimal to binary code to shape a multibit output in verilogA.
I want to use a @timer function but I noticed I can't put a parameter or variable for the period interval.
Example:
Code:
parameter real inputFrequency = 150K;
parameter integer ptsPerPeriod = 1000;
real timerPeriod = (1/inputFrequency)/ptsPerPeriod;
analog begin
...
@(timer(0, timerPeriod)) begin
...
end //timer
end //analog
The timerPeriod in this example is calculated correctly, I checked wih the $display() function, it is 0.00000000000667 .
Simulating (in Cadence Virtuoso) in transient analysis for 1ns, the timer is never triggered.
However, if I put "6.67p" for the timer period interval it works fine.
Am I getting the formatting wrong? Does anybody have an advice how to make the period interval into a variable?