Hello everyone, hope you're doing well. I am currently working on a system that consists of several ...
k
Hello everyone, hope you're doing well. I am currently working on a system that consists of several blocks, and I have created several symbols that are interconnected. I was wondering if there is a way to specify the simulation temperature for individual symbols (blocks), rather than a general temperature for the entire system. Any assistance you could provide would be greatly appreciated. Thank you.
a
@Karla Julieth Camacho Mercado Looks really interesting circuit. I'm interested to know what you are working on. Yes, there is a way to make each "instance" have a different temperature by using the "dtemp" variable associated with each instance. Go to section 1.3 in the manual: https://ngspice.sourceforge.io/docs/ngspice-html-manual/manual.xhtml
Here is the basic equation from the manual
Copy code
IF TEMP is specified THEN
instance_temperature = TEMP
ELSE
instance_temperature = circuit_temperature + DTEMP
END IF
s
Unfortunately as far as I know the
dtemp=...
parameter can not be applied to subcircuit instances. You probably need to add this to individual MOS transistors, but since MOS transistors in sky130 are represented as subcircuits you have to make this change in the model files. TL;DR: I have not found an easy way to set part of a circuit to a different temperature. May be @Tim Edwards has some trick for this?
@Amro Tork just after the TEMP setting algorithm in sec. 1.3 of the manual there is this text: Temperature dependent support is provided for all devices except voltage and current sources (either independent and controlled) and BSIM models. BSIM MOSFETs have an alternate temperature dependency scheme that adjusts all of the model parameters before input to ngspice. For details of the BSIM temperature adjustment, see [6] and [7]. [6] Soyeon Park, ‘Analysis and SPICE implementation of High Temperature Effects on MOSFET ’, Master’s thesis, University of California, Berkeley, December 1986. [7] Clement Szeto, ‘Simulation of Temperature Effects in MOSFETs (STEIM)’, Master’s thesis, University of California, Berkeley, May 1988.
a
Thanks for the addition @Stefan Schippers And yes,
dtemp=
doesn't work for subcircuit. You might need to build a parameterized cell for that.
k
@Amro Tork @Stefan Schippers Thanks a lot for your answers. I'm working on the design of an RFID tag, which has a Temperature Sensor. Wow! I notice it is not a trivial task, however thank you for your assistance. I have a question regarding the schematic in the image. Could you confirm if a temperature of 0°C is accurately indicated?
@Amro Tork Could you please explain to me what you mean by "a parameterized cell"?
a
@Karla Julieth Camacho Mercado a subcircuit with parameters that you pass to your instances.
@Karla Julieth Camacho Mercado Will that design be part of MPW "Open Source" I mean?
s
@Karla Julieth Camacho Mercado Yes, adding a
.temp 0
will set the whole circuit at 0C. About parametrized cells, you might notice if you open a sky130 spice netlist that even a single nfet transistor is described as a subcircuit. The nfet subcircuit is parametric as it takes various parameters, most important ones are W, L, nf, mult. xschem generates a subcircuit instance line for a mos transistor:
XM18 G2 G2 VSS VSS sky130_fd_pr__nfet_01v8_lvt L=4 W=2 nf=1 ad='W * 0.29' as='W * 0.29' pd='2*(W + 0.29)'
+ ps='2*(W + 0.29)' nrd=0 nrs=0 sa=0 sb=0 sd=0 mult=1 m=1
The
sky130_fd_pr__nfet_01v8_lvt
is the name of the nfet subcircuit, and it is followed by all transistor parameters (width, length, number of fingers, calculated drain/source areas/perimeters, and so on). The definition of this subcircuit is inside the sky130 pdk and looks somewhat like this:
.subckt  sky130_fd_pr__nfet_01v8_lvt d g s b
.param  l = 1 w = 1 nf = 1.0 ad = 0 as = 0 pd = 0 ps = 0 nrd = 0 nrs = 0 sa = 0 sb = 0 sd = 0 mult = 1
msky130_fd_pr__nfet_01v8_lvt d g s b sky130_fd_pr__nfet_01v8_lvt__model l = {l} w = {w} nf = {nf} ad = {ad} as = {as} pd = {pd} ps = {ps} nrd = {nrd} nrs = {nrs} sa = {sa} sb = {sb} sd = {sd}
...
... << nfet model definition
...
...
.ends
the parameters declared here are just default values that are to be replaced by the instance call. Adding a temp=... or dtemp=... requires to modify the pdk file above, and even if doing so it seems BSIM MOS models don't use this temperature information, so yes, the task looks complicated.
k
@Stefan Schippers Now I understand better, thank you very much for the detailed explanation.
@Amro Tork Thanks also to you for replying. Yes, once completed, the plan is to submit it to the Open MPW Program..
a
Thanks @Karla Julieth Camacho Mercado
@Karla Julieth Camacho Mercado It would be interesting share the link
k
@Amro Tork Of course! 😄 Thanks for your interest.