The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Aug 16th, 2024, 4:23am
Pages: 1
Send Topic Print
How to generate Verilog-A model for a programmable divider? (Read 6402 times)
lois
New Member
*
Offline



Posts: 2

How to generate Verilog-A model for a programmable divider?
Jun 08th, 2009, 10:13am
 
Hi!
I want to generate a Verilog-A model for a programmable divider. It has two inputs, clk and control word(division ratio). Is it OK to read the control word and assign the division ratio with it @ initial step, then complete the divider part with the assigned division ratio?

I am pretty new in this area. Thanks a lot.

Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: How to generate Verilog-A model for a programmable divider?
Reply #1 - Jun 9th, 2009, 5:12am
 
It is easy.
Simply make numerical counter.

See http://www.designers-guide.org/VerilogAMS/functional-blocks/freq-divider/freq-di...
You can easily make your custom model by modifying this.
Back to top
 
« Last Edit: Jun 9th, 2009, 9:15am by pancho_hideboo »  
View Profile WWW Top+Secret Top+Secret   IP Logged
Peruzzi
Community Member
***
Offline



Posts: 71

Re: How to generate Verilog-A model for a programmable divider?
Reply #2 - Jun 10th, 2009, 8:10am
 
Hi Lois,

You're correct that you must read the control word @initial_step, but don't forget to respond to any subsequent changes in the control word.

And if the circuit is already designed (that is, you're not designing it from the top-down) make sure the model reacts to control word changes the same way as the circuit.  Try changing the control word at different phases of clk and different states of the numerical counter. (This is a rich area for finding bugs in the design as well as the model.)

Best regards,

Bob P.
www.RPeruzzi.com
Back to top
 
 
View Profile   IP Logged
lois
New Member
*
Offline



Posts: 2

Re: How to generate Verilog-A model for a programmable divider?
Reply #3 - Jun 10th, 2009, 8:33am
 
Thank you for all those good suggestions. I have managed to generate this veriloga model.
Back to top
 
 
View Profile   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: How to generate Verilog-A model for a programmable divider?
Reply #4 - Jun 23rd, 2009, 1:59pm
 
Generally the initial block should do initialization.. and an always block should process the control signals and change the value..
After all, you might get more than one value set command.
Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   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.