I'd like to combine a DC temperature sweep and a t...
# xschem
s
I'd like to combine a DC temperature sweep and a transient simulation within a single test bench . I have a dc voltage source named V1 which is parameterized as
value=vdd
. I've written this ngspice script with the intention of changing the dc source to a
pwl
source for transient sim after a dc sim but it doesn't change the output to a pwl. What's the best way to change the DC source to a pwl source for a simulation and then reset it back to DC ?
Copy code
value = "
.param vdd=1.8
.control
	save all
	* Sets the vdd to 1.6V
	aterparam vdd=1.6 
    reset
	dc temp -40 140 5
	remzerovec
	write test_temperature.raw
	
	* Sets the v1 source to a pwl and performs a transient simulation
	alterparam vdd = "dc 1.8 pwl 0 0 1u 1 10u 1 11u 0 20u 0"
    reset
	tran 1n 250n
	remzerovec
	write test_transient.raw
.endc
"
l
You can have a pulse source with both levels set to the same voltage for a pure DC one.
s
Thanks @Luis Henrique Rodovalho for the suggestion. I tried to do the below with the dc source set to
value="dc 1.8 pwl 0 vl 1u vh 10u vh 11u vl 20u vl"
but the transient has no data. The params
vh, vl
to set the levels of the DC.
Copy code
value="
.param vd=1.8
.param vh=1.8
.param vl=0
.control
save all
	dc temp -40 140 5
	remzerovec
	write test_temperature.raw
    alterparam vl=0
    reset
	tran 1n 250n
	remzerovec
	write test_transient.raw
.endc
"
s
You must add again
save all
after
reset
.
Copy code
value="
.param vd=1.8
.param vh=1.8
.param vl=0
.control
save all
	dc temp -40 140 5
	remzerovec
	write test_temperature.raw
    alterparam vl=0
    reset
    *** add below line
    save all
	tran 1n 250n
	remzerovec
	write test_transient.raw
.endc
"