Quantcast
Channel: Cadence Custom IC Design Forum
Viewing all articles
Browse latest Browse all 4891

Frequency Measurement when clock is constant (veriloga)

$
0
0

Hello All,

I am trying to create a model which is dependent on the frequency of the input signal clkA_in3m.

I am using the model "Frequency measurements (dg-vams4-8)." as a reference:

designers-guide.org/.../index.html

The relevant part of the code is below.

//****** Frequency Measurement **********
t = last_crossing(V(clkA_in3m) - thresh, +1);
@(cross(V(clkA_in3m) - thresh, +1)) begin
if (timing) begin
period = t - t0;
freq = 1/period;
Req2 = k/freq;
end
t0 = t;
timing = 1;
end

The frequency measurement works pretty well. I then use "freq" to adjust the value of another variable, let's say "Req2".
The problem that I have if that if the clock signal remains constant the variable "freq" keeps showing the same last value which is wrong and then my variable "Req2" remains constant which is also wrong.
I know that the reason is because there are no clocks. How can I make the "freq" to update to a predefined value, let's say 0.1 (Hz) in such a scenario?
Thank you very much for your help.


Viewing all articles
Browse latest Browse all 4891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>