The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 2:31pm
Pages: 1
Send Topic Print
Variable pulse generator (Read 12263 times)
Nader K
New Member
*
Offline



Posts: 2

Variable pulse generator
Mar 28th, 2010, 3:36pm
 
Hello, I am new to verilog-A can somone help me create a fixed length pulse generator which generates a pulse when its input falls from one to zero?
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Variable pulse generator
Reply #1 - Mar 29th, 2010, 6:36am
 
You should at least try to give this a start.  People are willing to help you fix an issue, but not so likely to write the whole model for you.  Have you looked at the models available in the Verilog-AMS model library on this site?  (Click the Verilog-AMS tab in the header bar.)
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Nader K
New Member
*
Offline



Posts: 2

Re: Variable pulse generator
Reply #2 - Mar 31st, 2010, 12:38am
 
I am using this but its only working on the first falling edge, how can i fix it in order for it to work on every falling edge? Thanks

module fixed_pulse_generator(in,out);
   
     parameter real td = 0.5n;      // width of pulse
   parameter real tt = 0n;      // output transition time (s)
   output out;
   input in;
   voltage in, out;
   real Vout;

   analog begin
     @(cross(V(in), -1))
     Vout = 1.2;
     V(out) <+ transition(-Vout, td, tt);
     V(out) <+ transition(Vout, 2*td, tt);
   end
     
endmodule
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Variable pulse generator
Reply #3 - Apr 5th, 2010, 5:46am
 
What should happen if you get two falling edges in less than "td" ?  Ie, the first pulse isn't over before the second starts?
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Marq Kole
Senior Member
****
Offline

Hmmm. That's
weird...

Posts: 122
Eindhoven, The Netherlands
Re: Variable pulse generator
Reply #4 - Apr 6th, 2010, 3:43am
 
Your code doesn't change anything after the cross: Vout is constant (=1.2) after the first negative edge.  You will need both a cross event and a timer event to make Vout change levels and have the transition operator react to that.

Code:
module fixed_pulse_generator(in, out);

   parameter real td = 0.5n;   // width of pulse
   parameter real tt = 0n;	// output transition time (s)

   output out;
   input in;
   voltage in, out;

   real Vout, tend;

   analog begin
     @(cross(V(in), -1)) begin
	 Vout = -1.2;
	 tend = $abstime + td;
     end
     @(timer(tend))
	 Vout = 1.2;
     V(out) <+ transition(Vout, td, tt);
   end

endmodule  

Back to top
 
 
View Profile   IP Logged
Slavian
New Member
*
Offline



Posts: 3
Israel
Re: Variable pulse generator
Reply #5 - Dec 17th, 2010, 12:20pm
 
When I'm trying to run it (using Cadence Virtuoso) I don't see any graph, only the following message is displayed:
"Unable to plot expression <VT("net5"...(itc.) because it does not evaluate to an object that can be plotted, like a waveform or parametric wave. See the Visualization & Analysis Tool documentation for information about the types of objects that can be plotted in Visualization & Analysis Tool. Only the expressions that evaluate to those objects can be plotted."

Does anyone know what does it mean and how to make it work?
Thanks.
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Variable pulse generator
Reply #6 - Dec 20th, 2010, 5:22am
 
Slavian wrote on Dec 17th, 2010, 12:20pm:
"Unable to plot expression <VT("net5"...(itc.) because


Are you sure you've got that copied correctly?  Why is there VT rather than just V?
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Slavian
New Member
*
Offline



Posts: 3
Israel
Re: Variable pulse generator
Reply #7 - Dec 20th, 2010, 5:26am
 
Geoffrey_Coram wrote on Dec 20th, 2010, 5:22am:
Slavian wrote on Dec 17th, 2010, 12:20pm:
"Unable to plot expression <VT("net5"...(itc.) because


Are you sure you've got that copied correctly?  Why is there VT rather than just V?


Vt - Voltage transition. I want to use this pulse as a function of a time. So if i take a simulation 1 usec length, I expect to see the results... But I don't get any wave form at all...
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Variable pulse generator
Reply #8 - Jan 3rd, 2011, 12:28am
 
It appears you're a bit confused here - the VT() function is an ADE calculator function that allows you to access the transient voltage on a named signal - it's nothing to do with the VerilogA model described in this post.

Most likely the problem is because the signal is not in the result database because it didn't get saved. Which simulator were you using? Can  you maybe post the actual netlist you were using?

Best Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
Slavian
New Member
*
Offline



Posts: 3
Israel
Re: Variable pulse generator
Reply #9 - Jan 3rd, 2011, 11:51am
 
Hi all!
I've solved the problem by writing a new function by myself.
Thank you.
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Variable pulse generator
Reply #10 - Jan 3rd, 2011, 12:27pm
 
OK, although I cannot see what the VT() had to do with the VerilogA module described in this thread - so I've no idea why you needed to rewrite any "function"...

The VT() function is an ADE calculator function, whereas the module is a VerilogA module. Chalk and Cheese - two completely different things.

Regards,

Andrew.
Back to top
 
 
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.