Sir, Is there a way to set a parameter of an insta...
# analog-design
s
Sir, Is there a way to set a parameter of an instance (eg. nfet width), and create a second nfet instance that takes values (eg. nfet width) from the first instance.
t
In what tool? This is possible in ngspice; for tools like xschem it's a matter of getting to follow the ngspice syntax. Note that deep parameters are always a problem for layout (which does not have a way to represent passing of physical parameters through hierarchy) and should be avoided for that reason, generally, although there are times in which it is useful.
s
Sir using ngspice, just for simulation, matching 2 instance parameters, for sky 130 devices: cap and fets
t
@Saumeek Upadhyay: Should be something like this:
Copy code
.subckt inverter in out vdd vss w=1 l=0.15
X1 out in vdd vdd sky130_fd_pr__pfet_01v8 w={2.5*w} l={l}
X2 out in vss vss sky130_fd_pr__nfet_01v8 w={w} l={l}
.ends
parameters can be declared on the
.subckt
line, and can be used by reference as shown.
The example I posted above sets default values of w = 1 and l = 0.15; these can be changed on a per-instance basis.
s
Thank you very much sir. I apologize but is it possible to do this using ngspice in xschem
t
Xschem is all text-string based, so it is just a matter of, e.g., setting the value of W for a device to "{W}" and setting the subcircuit output line to include the text for the parameters.
s
Thank you sir