The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Analog Verification >> Analog Functional Verification >> Timer function can't take period input as a parameter
https://designers-guide.org/forum/YaBB.pl?num=1718108527

Message started by Lala878 on Jun 11th, 2024, 5:22am

Title: Timer function can't take period input as a parameter
Post by Lala878 on Jun 11th, 2024, 5:22am

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?

Title: Re: Timer function can't take period input as a parameter
Post by Lala878 on Jun 11th, 2024, 5:34am

Hey, I am sorry for the confusion, but while writing this post I realized my own mistake in calculating the period and setting up the transient simulation.
I made a mistake with the analysis tran time.
It is working as it should, it is making 1000 points in 6.67us (MICRO seconds) and I was simulating in 6.67ns, so of course no results to show there...
and I counted the zeros wrongly...


Anyway, I searched for a way to delete my post and haven't found it yet, but if pointed I can delete it.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.