The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jun 20th, 2024, 10:54pm
Pages: 1
Send Topic Print
Timer function can't take period input as a parameter (Read 34 times)
Lala878
Junior Member
**
Offline



Posts: 20

Timer function can't take period input as a parameter
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?
Back to top
 
 
View Profile   IP Logged
Lala878
Junior Member
**
Offline



Posts: 20

Re: Timer function can't take period input as a parameter
Reply #1 - 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.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.