PySpice-org / PySpice

Simulate electronic circuit using Python and the Ngspice / Xyce simulators
https://pyspice.fabrice-salvaire.fr
GNU General Public License v3.0
660 stars 173 forks source link

SpiceLibary/SpiceParser can't handle foundry provided corner models #192

Open Fatsie opened 4 years ago

Fatsie commented 4 years ago

Details

Foundry spice transistor models normally are provided in different process corners (typical, fast, slow, ...). For this they may even use .param statement and recursive use of .lib of a parameterized transistor model. The structure of a spice model file I have is the following:

.lib TT
.param param1=... param2=...
.lib "models.lib" MOS
.endl

.lib SS
.param param1=... param2=...
.lib "models.lib" MOS
.endl

...

.lib MOS
.model nch.1 NMOS ( ... )
.model nch.2 NMOS ( ... )
...
.model pch.1 PMOS ( ... )
.mode pch.2 PMOS ( ... )
.endl

Environment (OS, Python version, PySpice version, simulator)

Linux Centos7, python 3.6.9, PySpice 1.3.2 from PyPi

Expected Behaviour

Being able to build a list of transistor models from the spice model file with different corner models.

Reproducing Problem & Actual Behaviour

SpiceLibrary(".") gives warning like:

Parser ignored: .param ...
Parser ignored: .lib 'models.lib' MOS
...

and no models are extracted from the file. The spice model file can be used directly from ngspice without a problem.

FabriceSalvaire commented 4 years ago

Could you provide file examples so as to check what is wrong ?