The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> combining PWL and smooth waveforms in one voltage source
https://designers-guide.org/forum/YaBB.pl?num=1593136011

Message started by sutapanaki on Jun 25th, 2020, 6:46pm

Title: combining PWL and smooth waveforms in one voltage source
Post by sutapanaki on Jun 25th, 2020, 6:46pm

Hi,

I need to create a verilogA script for a voltage source that combines both PWL and smooth sections of its behavior, like in the attached picture. I can use the transition filter for the PWL part and I think for the smooth part it is best if I use the branch contribution operator <+ only. I don't know how to combine both. Any help will be very appreciated. Thanks.




Title: Re: combining PWL and smooth waveforms in one voltage source
Post by Ken Kundert on Jun 26th, 2020, 10:57am

You could use addition or multiplication.  For example:


Code:
analog begin
   offset = transition(enable, 0, 10n);
   sine = ampl*sine(6.28*freq*$abstime);
   V(out) <+ offset + sine;
end



Code:
analog begin
   on = transition(enable, 0, 10n);
   sine = on*ampl*sine(6.28*freq*$abstime);
   V(out) <+ sine;
end


-Ken

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