Introduce let, cdepth, and angle

replace tbeta and talpha by trise and tfall
This commit is contained in:
Holger Vogt 2025-06-02 23:38:29 +02:00
parent ed0ab4cc0d
commit 1144e67a20
6 changed files with 143 additions and 36 deletions

View File

@ -6,9 +6,11 @@
.param vdd = 1.2
.param deltat=11n deltat2=27n
.param tochar = 1e-13 ; tochar dependency on LET not yet defined
.param talpha = 500p tbeta=20p ; tau in exponent for pulse
.param Inull = 'tochar/(talpha-tbeta)'
*.param tochar = 1e-13 ; tochar dependency on LET not yet defined
.param tfall = 500p trise=20p ; tau in exponent for pulse
.param let = 11
.param cdepth = 0.9
*.param Inull = 'tochar/(tfall-trise)'
* the voltage sources:
Vdd vd gnd DC 'vdd'
@ -18,7 +20,7 @@ Vbl2 bl2 0 0
**** SEE generator without control input, double exponential current sources
aseegen1 NULL [%id(xcell.n1 m1) %id(xcell.n2 m2) %id(xcell.n1 m1) %id(xcell.n2 m2)] seemod1
.model seemod1 seegen (tdelay = 11n tperiod=25n inull='Inull' talpha='talpha' tbeta='tbeta')
.model seemod1 seegen (tdelay = 11n tperiod=25n let='let' cdepth='cdepth' tfall='tfall' trise='trise')
* alternative syntax, if no current measurement required and reference nodes are GND
*aseegen1 NULL [%i(xcell.n1) %i(xcell.n2) %i(xcell.n1) %i(xcell.n2)] seemod1

View File

@ -0,0 +1,81 @@
* Simple SRAM cell in a subcircuit, double exponential current pulses
* total charge is varied.
* IHP Open PDK
* Path to the PDK
.lib "D:\Spice_general\IHP-Open-PDK\ihp-sg13g2\libs.tech\ngspice\models\cornerMOSlv.lib" mos_tt
.param vdd = 1.2
*.param tochar = 1e-13 ; tochar dependency on LET not yet defined
.param d = 1
.param let = 12
.param tochar = 1.035e-14 * let * d
.csparam let = 'let' ; send param value to .control section
.param tfall = 500p trise = 100p ; tau in exponent for pulse
.param Inull = 'tochar/(tfall-trise)'
* the voltage sources:
Vdd vd gnd DC 'vdd'
Vwl wl 0 0 PULSE 0 'vdd' 45n 1n 1n 7n 1
Vbl1 bl1 0 'vdd'
Vbl2 bl2 0 0
**** SEE generator without control input, double exponential current sources
aseegen1 NULL [%id(xcell.n1 m1) %id(xcell.n2 m2) %id(xcell.n1 m1) %id(xcell.n2 m2)] seemod1
.model seemod1 seegen (tdelay = 11n tperiod=25n tfall='tfall' trise='trise' let='let' cdepth='d')
* alternative syntax, if no current measurement required and reference nodes are GND
*aseegen1 NULL [%i(xcell.n1) %i(xcell.n2) %i(xcell.n1) %i(xcell.n2)] seemod1
**** the SRAM cell
Xcell bl1 bl2 wl vdd vss srcell
.subckt srcell bl1 bl2 wl vdd vss
Xnot1 n1 vdd vss n2 not1
Xnot2 n2 vdd vss n1 not1
xmo02 n2 wl bl1 vss sg13_lv_nmos l=0.15u w=0.495u as=0.131175p ad=0.131175p ps=1.52u pd=1.52u
xmo01 n1 wl bl2 vss sg13_lv_nmos l=0.15u w=0.495u as=0.131175p ad=0.131175p ps=1.52u pd=1.52u
.ends
**** Current measurements
Vmeasvss vss 0 0
Vmeasvdd vd vdd 0
Vm1 m1 0 0
Vm2 m2 0 0
**** Inverter cell
.subckt not1 a vdd vss z
xm01 z a vdd vdd sg13_lv_pmos l=0.15u w=0.99u as=0.26235p ad=0.26235p ps=2.51u pd=2.51u
xm02 z a vss vss sg13_lv_nmos l=0.15u w=0.495u as=0.131175p ad=0.131175p ps=1.52u pd=1.52u
c3 a vss 0.384f
c2 z vss 0.576f
.ends
* starting condition for SRAM cell
.ic v(xcell.n2)=0 v(xcell.n1)='vdd'
* simulation command:
.tran 100ps 120ns
*.options method=gear
.options noinit
.control
pre_osdi C:\Spice64\lib\ngspice\psp103_nqs.osdi
set xbrushwidth=3
let newlet = let
repeat 5
print newlet
run
plot xcell.n1 xcell.n2+2 wl+4 i(vm1)*10000+6 i(vm2)*10000+8 ylimit -1 10
let newlet = newlet - 1
alterparam let = $&newlet
reset
end
rusage
.endc
.end

View File

@ -1,10 +1,8 @@
* Repeat loop, double exponential current pulses
.param tochar = 1e-13 ; tochar dependency on LET not yet defined
.csparam tochar = 'tochar'
.param talpha = 500p tbeta=20p ; tau in exponent for pulse
.param Inull = 'tochar/(talpha-tbeta)'
.param let = 10.5 cdepth = 1.2
.csparam let = 'let'
.param tfall = 500p trise = 20p ; tau in exponent for pulse
R1 n1 0 1e4
R2 n2 0 1e4
@ -14,7 +12,7 @@ R4 n4 0 1e4
**** SEE generator without control input, double exponential current sources
aseegen1 NULL [%id(n1 0) %id(n2 0) %id(n3 0) %id(n4 0)] seemod1
.model seemod1 seegen (tdelay = 11n tperiod=25n inull='Inull' talpha='talpha' tbeta='tbeta')
.model seemod1 seegen (tdelay = 11n tperiod=25n let='let' cdepth='cdepth' trise='trise' tfall='tfall')
* alternative syntax, if no current measurement required and reference nodes are GND
*aseegen1 NULL [%i(n1) %i(n2) %i(n3) %i(n4)] seemod1
@ -29,12 +27,12 @@ aseegen1 NULL [%id(n1 0) %id(n2 0) %id(n3 0) %id(n4 0)] seemod1
set xbrushwidth=3
*run
*plot n1 n2+2 n3+4 n4+6
let newchar = tochar
let newlet = let
repeat 10
run
plot n1 n2+2 n3+4 n4+6
let newchar = newchar - 5e-15
alterparam tochar = $&newchar
plot n1 n2+2 n3+4 n4+6 ylimit -3 7
let newlet = newlet - 0.5
alterparam let = $&newlet
reset
end
rusage

View File

@ -1,6 +1,6 @@
SET pulse test
.param alpha = 10p beta = 500p deltat = 1n
.param alpha = 100p beta = 500p deltat = 1n
* Arbitrary currnt source with expression
Bset1 1 0 I = ternary_fcn(TIME < 'deltat', 0, 2.5m * (exp(-(TIME-'deltat')/'alpha')-exp(-(TIME-'deltat')/'beta')))
@ -8,13 +8,14 @@ R1 1 11 1
Vmeas 11 0 0
* Eponential current source
Iset 2 0 EXP(0 -2.5m 'deltat' 10p 'deltat' 500p)
Iset 2 0 EXP(0 -2.5m 'deltat' 'alpha' 'deltat' 'beta')
R2 2 22 1
Vmeas2 22 0 0
.control
tran 1p 10n
set xbrushwidth=2
plot I(Vmeas)-I(Vmeas2)
plot I(Vmeas) I(Vmeas2)
.endc

View File

@ -125,10 +125,13 @@ NON-STANDARD FEATURES
void cm_seegen(ARGS) /* structure holding parms,
inputs, outputs, etc. */
{
double talpha; /* parameter alpha */
double tbeta; /* parameter beta */
double tfall; /* pulse fall time */
double trise; /* pulse rise time */
double tdelay; /* delay until first pulse */
double inull; /* max. current of pulse */
double let; /* linear energy transfer */
double cdepth; /* charge collection depth */
double angle; /* particle entrance angle */
double tperiod; /* pulse repetition period */
double ctrlthres; /* control voltage threshold */
double ctrl; /* control input */
@ -144,11 +147,14 @@ void cm_seegen(ARGS) /* structure holding parms,
/* Retrieve frequently used parameters... */
talpha = PARAM(talpha);
tbeta = PARAM(tbeta);
tfall = PARAM(tfall);
trise = PARAM(trise);
tdelay = PARAM(tdelay);
tperiod = PARAM(tperiod);
inull = PARAM(inull);
let = PARAM(let);
cdepth = PARAM(cdepth);
angle = PARAM(angle);
ctrlthres = PARAM(ctrlthres);
if (PORT_NULL(ctrl))
@ -182,9 +188,14 @@ void cm_seegen(ARGS) /* structure holding parms,
/* the double exponential current pulse function */
if (tcurr < *last_t_value)
out = 0;
else
out = inull * (exp(-(tcurr-*last_t_value)/talpha) - exp(-(tcurr-*last_t_value)/tbeta));
else {
if (inull == 0) {
double LETeff = let/cos(angle);
double Qc = 1.035e-14 * LETeff * cdepth;
inull = Qc / (tfall - trise);
}
out = inull * (exp(-(tcurr-*last_t_value)/tfall) - exp(-(tcurr-*last_t_value)/trise));
}
if (tcurr > *last_t_value + tperiod * 0.9) {
/* return some info */
cm_message_printf("port no.: %d, port name: %s, time: %e",

View File

@ -41,8 +41,8 @@ Null_Allowed: yes no
PARAMETER_TABLE:
Parameter_Name: talpha tbeta
Description: "alpha" "beta"
Parameter_Name: tfall trise
Description: "pulse fall time" "pulse rise time"
Data_Type: real real
Default_Value: 500e-12 20e-12
Limits: - -
@ -53,15 +53,16 @@ Null_Allowed: yes yes
PARAMETER_TABLE:
Parameter_Name: tdelay inull
Description: "pulse delay" "max current"
Parameter_Name: tdelay inull
Description: "pulse delay" "max current"
Data_Type: real real
Default_Value: 0 200e-6
Default_Value: 0 0
Limits: - -
Vector: no no
Vector_Bounds: - -
Null_Allowed: yes yes
PARAMETER_TABLE:
Parameter_Name: tperiod ctrlthres
@ -73,16 +74,29 @@ Vector: no no
Vector_Bounds: - -
Null_Allowed: yes yes
PARAMETER_TABLE:
Parameter_Name: perlim
Description: "pulse repetition limited"
Data_Type: boolean
Default_Value: TRUE
Limits: -
Vector: no
Vector_Bounds: -
Null_Allowed: yes
Parameter_Name: let cdepth
Description: "lin energy transfer" "charge collection depth"
Data_Type: real real
Default_Value: 10 1
Limits: - -
Vector: no no
Vector_Bounds: - -
Null_Allowed: yes yes
PARAMETER_TABLE:
Parameter_Name: angle perlim
Description: "particle angle" "pulse repetition"
Data_Type: real boolean
Default_Value: 0 TRUE
Limits: [0 1.57079] -
Vector: no no
Vector_Bounds: - -
Null_Allowed: yes yes
STATIC_VAR_TABLE: