9 posts / 0 new
Last post
#1 Nov 9, 2018
E.android
E.android's picture
Offline
Last seen: 4 months 4 weeks ago
Joined: 2017-09-20 19:01

How to Use Parameters in DC Sweep Command?

Hello,

Is it possible to pass parameters to the start/stop conditions of a DC sweep? I'd like to be able to pull these parameters in from a .inc file. Unfortunately it doesn't seem to work. Below is an example which will fail because parameters are used in the sweep statement.


* DC Sweep Example
**************************************
.PARAM  VEE=-20 VCC=20
.DC Vin {VEE} {VCC} 0.1 ;fails due to parameters in sweep command
.PROBE V([1])
*
Vin         1 0 0
.END

 

Any help is much appreciated!

Best regards,
Ian

 

Fri, 2018-11-09 14:02
ronaks
ronaks's picture
Offline
Last seen: 1 week 1 day ago
Joined: 2018-10-15 09:31

Hello Ian,

It is possible to pass parameters to the start/ stop conditions of a DC Sweep using Parametric Analysis.

Select DC Sweep as the Analysis Type and then you will see an option of Parametric Sweep beneath it in the options window. 

Parametric Sweep will allow you to sweep parameters along with DC Sweep analysis.

If you have to vary more 2+ parameters with DC Sweep, please Parametric Analysis from Advanced Analysis Suite of PSpice , which will make it very ease for you to visualize results.

FYI- Cadence Help  section has documentation on Parametric Analysis.

Thanks,

Ronak

Fri, 2018-11-09 15:07
E.android
E.android's picture
Offline
Last seen: 4 months 4 weeks ago
Joined: 2017-09-20 19:01

Hello Ronak,

Thank you for your comment. However I am trying to run these simulations all from a command line and netlist only. Is it possible for you to suggest how to implement this parametric step just from the netlist?

Best,
Ian

Mon, 2018-11-12 11:54
TeamPSpice
Offline
Last seen: 14 hours 7 min ago
Joined: 2016-03-23 11:50

Hello,

I performed a basic DC Parametric analysis sweep on the circuit below. Hope the netlist and the settings help with your query. I have attached everything (results, sim profile) just in case with the circuit netlist. 

* source DC_SWEEP_PARAMETRIC
R_R2         N14395 N14403 5
R_R1         0 N14403 {OHM}
V_V1         N14395 0 DC 10  
.PARAM  ohm=1

 

 

attach_0.PNGattach1.PNGattach2.PNGattach3.PNG

Does this help?

Thanks!

Wed, 2018-11-14 17:52
E.android
E.android's picture
Offline
Last seen: 4 months 4 weeks ago
Joined: 2017-09-20 19:01

Hi TeamPSpice,

I appreciate the suggestion, but unfortunately it is not helpful. Your example shows parametric sweeps with explicitly defined endpoints and steps. What I would like to do is have these be parameters instead so I can simply edit one .inc file and have those parameters propagate to all my test circuits.

For reference, in your example these are the analysis directives that are created:

*Analysis directives: 
.DC LIN V_V1 1 10 1 
.STEP LIN PARAM OHM 1 20 1  

What I would like instead is for the voltage step min/max to be parameters rather than explicit definitions, like this:

*Analysis directives: 
.DC LIN V_V1 {VMIN} {VMAX} 1 
.STEP LIN PARAM OHM 1 20 1 

Unfortunately when I try this, I get a syntax error. Is this functionality possible?

Best,
Ian

Tue, 2018-11-27 13:44 (Reply to #5)
retiredEE
Offline
Last seen: 1 month 3 weeks ago
Joined: 2018-03-21 12:19

Do all your test circuits have the same <sweep variable name> and <increment value>?  If so, just add the whole .DC sweep command to the include file and remove it from the circuit file.  That will allow you to edit one file for all circuits.

Thu, 2018-11-22 10:19
RobertoGb
RobertoGb's picture
Offline
Last seen: 1 week 3 hours ago
Joined: 2016-05-24 03:10

Hi,

This is not possible. It would be a very interesting thing.

Regards

Mon, 2018-11-26 12:53
E.android
E.android's picture
Offline
Last seen: 4 months 4 weeks ago
Joined: 2017-09-20 19:01

Hi Roberto,

Thanks for the reply. It's unfortunate that this is not possible, as it seems like a powerful capability for scripting/automation. With all the advanced tasks that Cadence can do it's surprising when it can't do the simple things.

Tue, 2018-11-27 04:21 (Reply to #8)
RobertoGb
RobertoGb's picture
Offline
Last seen: 1 week 3 hours ago
Joined: 2016-05-24 03:10

Hi,

Yes, I agree with you. Sometimes less is more. I am completely sure though, that this will be considered. 

Lot of success!

Download PSpice Lite and try it for free! Get PSpice Lite
Cadence