001_SS_script : Simple Control Block to recall simulation data
Requires: SmartSpice & Smartview
Minimum Versions: SmartSpice 4.30.5.R + SmartView 2.34.3.R
The SmartSpice application allows scripting of tasks in a control block of a SmartSpice input deck and to display results in the SmartView viewer. To illustrate this in a very simple case here is how to load in previously simulated dat in a RAW file and then to change contents before resaving the RAW file with the extra components. This is obviously very useful to avoid having to resimulate the circuit again and a real benefit in time saved especially when the simulation runs fore a long time. SmartSpice has the capability to load in a simulation data RAW file so further post processing on the results can be done without the need to re-simulate the circuit. This saves time when some extra waveform extraction is required from previous simulation runs.
To run the simulation:
- 1. Run the simulation input deck “ex2.in” in smartspice and exit. This will generate a raw file called "ex2.raw".
- 2. Run simulation input deck “re_meas_raw.in”. This reads in the raw file “ex2.raw” and does some extra waveform analysis.
- 3. A new file is saved “ex2_plus.raw” with the extra data results.
This can be used as a template to do more elaborate post processing analysis and SmartSpice has the capability to do script type analysis. Details can be found in the SmartSpice User’s Manual Chapter 5
ex2.in
TEST CIRCUIT - INPUT DECK * .SUBCKT SUB1 1 2 3 Q2 1 25 3 QNL RS2 25 2 0.1K .ENDS .SUBCKT SUB2 1 2 Q3 1 2 VEE QNL Q4 2 2 VEE QNL 1 .ENDS .GLOBAL VEE .OPTIONS RELTOL=0.01 ABSTOL=1N VNTOL=50U ITL1=100 ITL2=50 ITL4=10 ACCT NOMOD *......... PART I. COMPONENTS and CIRCUITS ........................ VIN 1 0 DC -0.25 PULSE( -0.25 0.25 1N 2N 2N 18N 40N ) AC 1 VEE VEE 0 DC -12 VCC 8 0 DC 12 X1 3 1 6 SUB1 CLOAD 3 4 0.75PF RC1 3 8 RMOD 1K RBIAS 7 8 2K X2 4 0 6 SUB1 X3 6 7 SUB2 RC2 4 8 RMOD 1K VGOAL3 VGOAL3 0 PWLDC( -0.25V 12 -0.2V 11.97 -0.15V 11.9 -0.1V 11 + -0.05V 9.2 0V 5.6 0.05V 2.1 0.1V 0.8 0.15V 0.4 2V 0.31 2.5V 0.3) RGOAL3 VGOAL3 0 -1 .MODEL QNL NPN(BF=80 RB=100 CCS=0.2PF TF=0.03NS TR=0.6NS CJE=0.3PF CJC=0.2PF) .MODEL RMOD R (TC1=0.003) *........ PART II. ANALYSIS, OUTPUT and CONTROL CARDS ............. .TRAN 5NS 80NS 1NS 1.5NS CALLV SAVEV .MEASURE TRAN MAX_TR_V3 MAX V(3) .MEASURE TRAN MIN_TR_V3 MIN V(3) .MEASURE TRAN FALL_1_TR_V3 WAVE V(3) FALL=1 VAL0=MIN_TR_V3 VAL1=MAX_TR_V3 .MEASURE TRAN DEL_V3_V1 DELAY V(1) RISE=1 VAL=0 TARG=V(3) FALL=1 VAL0=MIN_TR_V3 VAL1=MAX_TR_V3 .MEASURE TRAN CR_V3_V4_3 CROSS V(3) V(4) OCCUR=3 .MODIF RBIAS(RES)=2.5K CLOAD(CAP)=0.75PF +MODIF LOOP=5 STOP DEL_V3_V1 LE 2NS RBIAS(RES)*=0.9 CLOAD(CAP)*=0.6 .END
Reload_Simulation_data.in
Reload Simulation data for post processing _____________________________________ SmartSpice has the capability to load in a simulation data RAW file so further post processing on the results can be done without the need to re-simulate the circuit. This saves time when some extra waveform extraction is required from previous simulation runs. 1. Run the simulation input deck ex2.in in smartspice and exit. ( or just use the attached simulation RAW file ex2.raw in step 2 ) 2. Run simulation input deck re_meas_raw.in. This reads in the raw file ex2.raw and does some extra waveform analysis 3. A new file is saved ex2_plus.raw with the extra data results This can be used as a template to do more elaborate post processing analysis and SmartSpice has the capability to do script type analysis. Details can be found in the SmartSpice Users Manual Chapter 5 Colins
re_meas_raw.in
* Simple script to measure on loaded raw file .CONTROL Load ex2.raw measure max_v3 max tran1.v(3) measure max_v3 max tran2.v(3) measure max_v3 max tran3.v(3) measure max_v4 max tran1.v(4) measure max_v4 max tran2.v(4) measure max_v4 max tran3.v(4) setplot meas1 Write ex2_plus.raw all .endc