Hi, this is a basic question. I have an inverter m...
# xschem
n
Hi, this is a basic question. I have an inverter model from a extracted layout in magic (Fig 1) and I want to add that model in a testbench in xschem (Fig 2) could anyone indicate me, how can I add the spice description to a symbol, because I only know how to create symbols from schematics, but never from a spice file like this. Thanks in advance
s
Go through this manual page.
You can descend into the symbol and edit its global attributes (press 'q' in the symbol without anything selected), set
type=subcircuit
and add the following attribute at the end:
spice_sym_def="
.subckt inverter A Y VPWR VGND
...
...
...
.ends
"
that is copy the thesis_inv text into it. Alternatively you can do:
spice_sym_def=".include /path/to/thesis_inv.ext'
when generating the netlist ensure the pin order of the
inverter
symbol matches your extracted netlist. If the pin order does not match change the order in the text file above. You see above i have renamed
thesis_inv
to
inverter
since this is the name of the xschem symbol.
🌍 1
z
@Nelson Rodriguez Does this method of using (type=subcircuit) work for you?? Somehow this doesn't seem to work for me
However using type=primitive and setting device_model=".include path/to/file" works... But I am curious to get the other method working
s
@z-a-p-k-i-n-g ensure the text for
spice_sym_def
is properly quoted. If there are double quotes inside the (quoted) text these must be escaped (
\"
)
Copy code
spice_sym_def="...
...
...
..."
z
@Stefan Schippers Ig it's all good...but still it continues to expand .sch file instead of using the value of spice_sym_def attribute
s
@z-a-p-k-i-n-g do you have a recent
xschem
? this feature was added end of september 2022. if not try to update and rebuild. the spice_sym_def attribute must be placed in the symbol. Descend into the symbol, press 'q' and add the spice_sym_def attribute.
z
I am using ngspice-40...let me try rebuilding xschem🤞
@Stefan Schippers Thank you... rebuilding it solved the issue
🌍 1