I have a simple digital invert circuit using ASAP7 nmos and pmos transistors. When I use Synopsys HSPICE to simulate the below script, it throws an error Definition of model/subckt "nmos_rvt" is not found for the element "xinv1^xm1". Please specify a defined model/subckt name.
However, when I change xm0
to mm0
(and xm1 to mm1) everything works! What is wrong with using xm0
as the instance name? Where is this documented?
The script:
** Generated for: hspiceD
** Generated on: Feb 2 16:49:44 2021
** Design library name: demo
** Design cell name: invtest
** Design view name: schematic
.GLOBAL vdd!
.TEMP 25.0
.OPTION
+ ARTIST=2
+ INGOLD=2
+ PARHIER=LOCAL
+ PSF=2
.INCLUDE "7nm_TT.pm"
** Library name: asap7ssc7p5t
** Cell name: INVx1_ASAP7_75t_R
** View name: schematic
.subckt INVx1_ASAP7_75t_R a y vdd vss
xm1 y a vss vss nmos_rvt w=81e-9 l=20e-9 nfin=3
xm0 y a vdd vdd pmos_rvt w=81e-9 l=20e-9 nfin=3
.ends INVx1_ASAP7_75t_R
** End of subcircuit definition.
** Library name: demo
** Cell name: invtest
** View name: schematic
xinv1 in1 out1 vdd! 0 INVx1_ASAP7_75t_R
v0 vdd! 0 DC=700e-3
c0 out1 0 2e-15
VIN in1 0 0 pulse 0 0.7 0 50p 50p 2n 4n
.tran 10p 10n
.END
```
Best Answer
This is standard SPICE syntax and I suspect it is documented in many places. Instance names for MOSFETs must begin with
M
and instance names of subcircuits must begin withX
. Voltage sources start withV
, resistors start withR
, and so on. The first letter tells SPICE how to parse the rest of the line.It gets tricky when a MOSFET is actually described using a subcircuit rather than directly with a MOSFET model, but if it's a subcircuit then it needs to start with an
X
.