The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> How to generate Verilog-A model for a programmable divider?
https://designers-guide.org/forum/YaBB.pl?num=1244481233

Message started by lois on Jun 8th, 2009, 10:13am

Title: How to generate Verilog-A model for a programmable divider?
Post by lois on Jun 8th, 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.


Title: Re: How to generate Verilog-A model for a programmable divider?
Post by pancho_hideboo on Jun 9th, 2009, 5:12am

It is easy.
Simply make numerical counter.

See http://www.designers-guide.org/VerilogAMS/functional-blocks/freq-divider/freq-divider.va
You can easily make your custom model by modifying this.

Title: Re: How to generate Verilog-A model for a programmable divider?
Post by Peruzzi on 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

Title: Re: How to generate Verilog-A model for a programmable divider?
Post by lois on Jun 10th, 2009, 8:33am

Thank you for all those good suggestions. I have managed to generate this veriloga model.

Title: Re: How to generate Verilog-A model for a programmable divider?
Post by jbdavid on 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.

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