The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 4:20pm
Pages: 1
Send Topic Print
Clock state (Read 1807 times)
nishant22
New Member
*
Offline



Posts: 8

Clock state
Apr 26th, 2009, 9:26am
 
Hi I am writing Verilog A model for a block which has 2 clocks coming as inputs, both may have different frequency. I have to check if during the simulation any of the clock dissapears or is stopped, my output should go to zero. How can I model this? And it should detect that when both clocks come back again and execute rest of my model.
Its really important.
Thanks,
Nishant
Back to top
 
 
View Profile   IP Logged
Peruzzi
Community Member
***
Offline



Posts: 71

Re: Clock state
Reply #1 - Apr 27th, 2009, 8:30am
 
Hello Nishant,

You can devise an algorithm to do this.  For each clock.  

For each rising edge detection, find the difference between the present time and the time of the previous rising edge and the frequency is the reciprocal of that difference.  

If the frequency is within tolerance, set some status variable indicating OK, and set up a timer() function to return execute some time in the future, corresponding to your definition of "if during the simulation any of the clock dissapears or is stopped".

Do a similar thing when the timer() executes to make sure the clock frequency is still OK.  You have to mess around with it a little to get it right, but I'm sure this is enough to get you going.  

You get the idea, right?

You can also google around for "loss of clock detection".


Bob P.
www.RPeruzzi.com
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.