The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 8th, 2024, 2:22pm
Pages: 1
Send Topic Print
pwm in verilog (Read 5091 times)
uzma
New Member
*
Offline



Posts: 2

pwm in verilog
Sep 27th, 2006, 10:55pm
 
i have to generate the pulses of PW as low as  100ns in verilog

the pw duration is to be obtained from external source say PC

can anyone help me that how can i do it
Back to top
 
 
View Profile   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: pwm in verilog
Reply #1 - Sep 27th, 2006, 11:04pm
 
can you write the needed PW into a file? then read the file from the verilogams ..?

jbd
Back to top
 
 

jbdavid
Mixed Signal Design Verification
View Profile WWW   IP Logged
uzma
New Member
*
Offline



Posts: 2

Re: pwm in verilog
Reply #2 - Sep 28th, 2006, 2:13am
 
even if i write the pw in a file then still i will not be needing a program to generate a pulse train ???
Back to top
 
 
View Profile   IP Logged
jbdavid
Community Fellow
*****
Offline



Posts: 378
Silicon Valley
Re: pwm in verilog
Reply #3 - Sep 30th, 2006, 2:09am
 
This I don't know..
I was thinking that due to differences in time scale you are probably not looking for a realtime solution..
so if you can capture the PW from the external source into a file,
the your verilog model can read those in and generate the voltage in the simulation..

of course you may not need that exact solution..
capture the data in VCD format (see Verilog-XL reference or IEEE - 1364 )
and use a tool like ncgentb to turn the data into 1-0's in a verilog testbench for your circuit
capture the data in PWL format (see the spectre reference manual) and
read it into a spectre simulation with a VPWLF (or vsource - set to PWL type, read data from a file)

If you DON'T need to cature the data from an external source, (you said in your original question that this was
a requirement - then complain that you might need to genereate the PW outside your model.. which I find a little confusing)
you might want to write a verilog-A or verilog model to generate a "random" PW signal..
one type would be a PRBS of a certain bit length at a fixed period..
OR you could use a voltage input to represent duty cycle (0-1v) and run that through a V-> duty cycle circuit.

If you were coming to me as a customer there is a LOT more I need to know to make any kind of recommendation on an approach.
I hope the suggestions above help.


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.