Hi everyone, so I am trying to do the parametric s...
# gf180mcu
c
Hi everyone, so I am trying to do the parametric sweeping of NMOS to obtain its gm/id info across different L values. The entire netlist is as follows:
Copy code
** sch_path: /fs1/eecg/tcc/lizongh2/gm_id/xschem/nfet_gm_id.sch
**.subckt nfet_gm_id
XM1 D G S S nfet_03v3 L=L_sweep W=W_sweep nf=1 ad='int((nf+1)/2) * W/nf * 0.18u' as='int((nf+2)/2) * W/nf * 0.18u'
+ pd='2*int((nf+1)/2) * (W/nf + 0.18u)' ps='2*int((nf+2)/2) * (W/nf + 0.18u)' nrd='0.18u / W' nrs='0.18u / W'
+ sa=0 sb=0 sd=0 m=M_sweep
Vg G S 1
.save i(vg)
Vd D S 1.65
.save i(vd)
**** begin user architecture code


.param W_sweep = 4u
.param L_sweep = 0.28u
.param M_sweep = 1

.control
.options savecurrents
set filetype=ascii

let L_start = 0.28u
let L_stop = 4u
let L_delta = 0.2u
let L_act = L_start

* loop
while L_act le L_stop
  alter @m.XM1.m0[l] = $&L_act
  reset
  dc Vg 0.3 3.3 0.3
  let gm = @m.XM1.m0[gm]
  let id = @m.XM1.m0[id]
  let gds = @m.XM1.m0[gds]
  let cgg = @m.XM1.m0[cgg]
  let vth = @m.XM1.m0[vth]
  let l = @m.XM1.m0[l]
  let w = @m.XM1.m0[w]
  print @m.XM1.m0[gm] @m.XM1.m0[l]
  remzerovec
  save all
  write nfet_gm_id.raw gm
  let L_act = L_act + L_delta
  set appendwrite
end

.endc



.include /usr/local/share/pdk/gf180mcuC/libs.tech/ngspice/design.ngspice
.lib /usr/local/share/pdk/gf180mcuC/libs.tech/ngspice/sm141064.ngspice typical

**** end user architecture code
**.ends
.GLOBAL GND
.end
However, I keep getting the following similar error:
Copy code
Error: no model available for w=  4.0000000e-06 l=  6.8000000e-07.
Which I am not sure what causes this as the GF180MCU model is continuous. Any idea of this? Thanks.
Okay it seems like by changing:
alter @m.XM1.m0[l] = $&L_act
to
alterparam L_sweep = $&L_act
the error was gone. Not sure why this is the issue.
However, even by doing so, the results I got is as follows:
Copy code
Title: ** sch_path: /fs1/eecg/tcc/lizongh2/gm_id/xschem/nfet_gm_id.sch
Date: Thu Aug 10 15:50:21  2023
Plotname: DC transfer characteristic
Flags: real
No. Variables: 2
No. Points: 11
Variables:
	0	v(v-sweep)	voltage
	1	gm	notype dims=1
Values:
 0	3.000000000000000e-01
	7.376853103102681e-04

 1	6.000000000000001e-01
	0.000000000000000e+00

 2	9.000000000000001e-01
	0.000000000000000e+00

 3	1.200000000000000e+00
	0.000000000000000e+00

 4	1.500000000000000e+00
	0.000000000000000e+00

 5	1.800000000000000e+00
	0.000000000000000e+00

 6	2.100000000000001e+00
	0.000000000000000e+00

 7	2.400000000000000e+00
	0.000000000000000e+00

 8	2.700000000000000e+00
	0.000000000000000e+00

 9	3.000000000000000e+00
	0.000000000000000e+00

 10	3.300000000000000e+00
	0.000000000000000e+00

Title: ** sch_path: /fs1/eecg/tcc/lizongh2/gm_id/xschem/nfet_gm_id.sch
Date: Thu Aug 10 15:50:21  2023
Plotname: DC transfer characteristic
Flags: real
No. Variables: 2
No. Points: 11
Variables:
	0	v(v-sweep)	voltage
	1	gm	notype dims=1
Values:
 0	3.000000000000000e-01
	5.907251783592129e-04

 1	6.000000000000001e-01
	0.000000000000000e+00

 2	9.000000000000001e-01
	0.000000000000000e+00

 3	1.200000000000000e+00
	0.000000000000000e+00

 4	1.500000000000000e+00
	0.000000000000000e+00

 5	1.800000000000000e+00
	0.000000000000000e+00

 6	2.100000000000001e+00
	0.000000000000000e+00

 7	2.400000000000000e+00
	0.000000000000000e+00

 8	2.700000000000000e+00
	0.000000000000000e+00

 9	3.000000000000000e+00
	0.000000000000000e+00

 10	3.300000000000000e+00
	0.000000000000000e+00

Title: ** sch_path: /fs1/eecg/tcc/lizongh2/gm_id/xschem/nfet_gm_id.sch
Date: Thu Aug 10 15:50:22  2023
Plotname: DC transfer characteristic
Flags: real
No. Variables: 2
No. Points: 11
Variables:
	0	v(v-sweep)	voltage
	1	gm	notype dims=1
Values:
 0	3.000000000000000e-01
	4.809661166496103e-04

 1	6.000000000000001e-01
	0.000000000000000e+00

 2	9.000000000000001e-01
	0.000000000000000e+00

 3	1.200000000000000e+00
	0.000000000000000e+00

 4	1.500000000000000e+00
	0.000000000000000e+00

 5	1.800000000000000e+00
	0.000000000000000e+00

 6	2.100000000000001e+00
	0.000000000000000e+00

 7	2.400000000000000e+00
	0.000000000000000e+00

 8	2.700000000000000e+00
	0.000000000000000e+00

 9	3.000000000000000e+00
	0.000000000000000e+00

 10	3.300000000000000e+00
	0.000000000000000e+00

Title: ** sch_path: /fs1/eecg/tcc/lizongh2/gm_id/xschem/nfet_gm_id.sch
Date: Thu Aug 10 15:50:22  2023
Plotname: DC transfer characteristic
Flags: real
No. Variables: 2
No. Points: 11
Variables:
	0	v(v-sweep)	voltage
	1	gm	notype dims=1
Values:
 0	3.000000000000000e-01
	3.995049705733429e-04

 1	6.000000000000001e-01
	0.000000000000000e+00

 2	9.000000000000001e-01
	0.000000000000000e+00

 3	1.200000000000000e+00
	0.000000000000000e+00

 4	1.500000000000000e+00
	0.000000000000000e+00

 5	1.800000000000000e+00
	0.000000000000000e+00

 6	2.100000000000001e+00
	0.000000000000000e+00

 7	2.400000000000000e+00
	0.000000000000000e+00

 8	2.700000000000000e+00
	0.000000000000000e+00

 9	3.000000000000000e+00
	0.000000000000000e+00

 10	3.300000000000000e+00
	0.000000000000000e+00

Title: ** sch_path: /fs1/eecg/tcc/lizongh2/gm_id/xschem/nfet_gm_id.sch
Date: Thu Aug 10 15:50:22  2023
Plotname: DC transfer characteristic
Flags: real
No. Variables: 2
No. Points: 11
Variables:
	0	v(v-sweep)	voltage
	1	gm	notype dims=1
Values:
 0	3.000000000000000e-01
	3.444464406495690e-04

 1	6.000000000000001e-01
	0.000000000000000e+00

 2	9.000000000000001e-01
	0.000000000000000e+00

 3	1.200000000000000e+00
	0.000000000000000e+00

 4	1.500000000000000e+00
	0.000000000000000e+00

 5	1.800000000000000e+00
	0.000000000000000e+00

 6	2.100000000000001e+00
	0.000000000000000e+00

 7	2.400000000000000e+00
	0.000000000000000e+00

 8	2.700000000000000e+00
	0.000000000000000e+00

 9	3.000000000000000e+00
	0.000000000000000e+00

 10	3.300000000000000e+00
	0.000000000000000e+00

*** More similar results, neglected due to word limit ***
Which is not exactly what I want, as it only spits out the gm at the first Vgs sweep point.
e
Hello @Chris please how did you finally solve the problem. I'd like to learn.
c
I ended up using a python script as a wrapper to iteratively simulate the netlist. I find it easier for me...