From 2dcb79d09cc4c1444591601ce2734a17681fb874 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 14 Feb 2018 22:04:23 +0100 Subject: [PATCH] GENmodel, GENinstance, change layout, #1/4, coccinelle semantic patch --- src/spicelib/analysis/cktdisto.c | 12 +++---- src/spicelib/analysis/dctrcurv.c | 12 +++---- src/spicelib/devices/asrc/asrcacld.c | 4 +-- src/spicelib/devices/asrc/asrcconv.c | 4 +-- src/spicelib/devices/asrc/asrcfbr.c | 4 +-- src/spicelib/devices/asrc/asrcload.c | 4 +-- src/spicelib/devices/asrc/asrcpzld.c | 4 +-- src/spicelib/devices/asrc/asrcset.c | 8 ++--- src/spicelib/devices/asrc/asrctemp.c | 4 +-- src/spicelib/devices/bjt/bjtacld.c | 6 ++-- src/spicelib/devices/bjt/bjtask.c | 6 ++-- src/spicelib/devices/bjt/bjtconv.c | 4 +-- src/spicelib/devices/bjt/bjtdisto.c | 6 ++-- src/spicelib/devices/bjt/bjtdset.c | 6 ++-- src/spicelib/devices/bjt/bjtgetic.c | 4 +-- src/spicelib/devices/bjt/bjtload.c | 6 ++-- src/spicelib/devices/bjt/bjtnoise.c | 6 ++-- src/spicelib/devices/bjt/bjtpzld.c | 6 ++-- src/spicelib/devices/bjt/bjtsacl.c | 6 ++-- src/spicelib/devices/bjt/bjtsetup.c | 12 +++---- src/spicelib/devices/bjt/bjtsload.c | 6 ++-- src/spicelib/devices/bjt/bjtsoachk.c | 4 +-- src/spicelib/devices/bjt/bjtsprt.c | 6 ++-- src/spicelib/devices/bjt/bjtsset.c | 6 ++-- src/spicelib/devices/bjt/bjtsupd.c | 6 ++-- src/spicelib/devices/bjt/bjttemp.c | 6 ++-- src/spicelib/devices/bjt/bjttrunc.c | 4 +-- src/spicelib/devices/bsim1/b1acld.c | 6 ++-- src/spicelib/devices/bsim1/b1cvtest.c | 6 ++-- src/spicelib/devices/bsim1/b1disto.c | 6 ++-- src/spicelib/devices/bsim1/b1dset.c | 6 ++-- src/spicelib/devices/bsim1/b1getic.c | 4 +-- src/spicelib/devices/bsim1/b1ld.c | 6 ++-- src/spicelib/devices/bsim1/b1noi.c | 4 +-- src/spicelib/devices/bsim1/b1pzld.c | 6 ++-- src/spicelib/devices/bsim1/b1set.c | 12 +++---- src/spicelib/devices/bsim1/b1temp.c | 6 ++-- src/spicelib/devices/bsim1/b1trunc.c | 4 +-- src/spicelib/devices/bsim2/b2acld.c | 6 ++-- src/spicelib/devices/bsim2/b2cvtest.c | 6 ++-- src/spicelib/devices/bsim2/b2getic.c | 4 +-- src/spicelib/devices/bsim2/b2ld.c | 6 ++-- src/spicelib/devices/bsim2/b2noi.c | 4 +-- src/spicelib/devices/bsim2/b2pzld.c | 6 ++-- src/spicelib/devices/bsim2/b2set.c | 12 +++---- src/spicelib/devices/bsim2/b2temp.c | 6 ++-- src/spicelib/devices/bsim2/b2trunc.c | 4 +-- src/spicelib/devices/bsim3/b3acld.c | 6 ++-- src/spicelib/devices/bsim3/b3cvtest.c | 6 ++-- src/spicelib/devices/bsim3/b3getic.c | 4 +-- src/spicelib/devices/bsim3/b3ld.c | 10 +++--- src/spicelib/devices/bsim3/b3noi.c | 6 ++-- src/spicelib/devices/bsim3/b3pzld.c | 6 ++-- src/spicelib/devices/bsim3/b3set.c | 24 ++++++------- src/spicelib/devices/bsim3/b3soachk.c | 4 +-- src/spicelib/devices/bsim3/b3temp.c | 6 ++-- src/spicelib/devices/bsim3/b3trunc.c | 6 ++-- .../devices/bsim3soi_dd/b3soiddacld.c | 6 ++-- .../devices/bsim3soi_dd/b3soiddcvtest.c | 6 ++-- .../devices/bsim3soi_dd/b3soiddgetic.c | 4 +-- src/spicelib/devices/bsim3soi_dd/b3soiddld.c | 6 ++-- src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c | 6 ++-- .../devices/bsim3soi_dd/b3soiddpzld.c | 6 ++-- src/spicelib/devices/bsim3soi_dd/b3soiddset.c | 12 +++---- .../devices/bsim3soi_dd/b3soiddtemp.c | 6 ++-- .../devices/bsim3soi_dd/b3soiddtrunc.c | 6 ++-- .../devices/bsim3soi_fd/b3soifdacld.c | 6 ++-- .../devices/bsim3soi_fd/b3soifdcvtest.c | 6 ++-- .../devices/bsim3soi_fd/b3soifdgetic.c | 4 +-- src/spicelib/devices/bsim3soi_fd/b3soifdld.c | 6 ++-- src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c | 6 ++-- .../devices/bsim3soi_fd/b3soifdpzld.c | 6 ++-- src/spicelib/devices/bsim3soi_fd/b3soifdset.c | 12 +++---- .../devices/bsim3soi_fd/b3soifdtemp.c | 6 ++-- .../devices/bsim3soi_fd/b3soifdtrunc.c | 6 ++-- .../devices/bsim3soi_pd/b3soipdacld.c | 6 ++-- .../devices/bsim3soi_pd/b3soipdcvtest.c | 6 ++-- .../devices/bsim3soi_pd/b3soipdgetic.c | 4 +-- src/spicelib/devices/bsim3soi_pd/b3soipdld.c | 6 ++-- src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c | 6 ++-- .../devices/bsim3soi_pd/b3soipdpzld.c | 6 ++-- src/spicelib/devices/bsim3soi_pd/b3soipdset.c | 12 +++---- .../devices/bsim3soi_pd/b3soipdtemp.c | 6 ++-- .../devices/bsim3soi_pd/b3soipdtrunc.c | 6 ++-- src/spicelib/devices/bsim3v0/b3v0acld.c | 6 ++-- src/spicelib/devices/bsim3v0/b3v0cvtest.c | 6 ++-- src/spicelib/devices/bsim3v0/b3v0getic.c | 4 +-- src/spicelib/devices/bsim3v0/b3v0ld.c | 6 ++-- src/spicelib/devices/bsim3v0/b3v0noi.c | 6 ++-- src/spicelib/devices/bsim3v0/b3v0pzld.c | 6 ++-- src/spicelib/devices/bsim3v0/b3v0set.c | 12 +++---- src/spicelib/devices/bsim3v0/b3v0temp.c | 6 ++-- src/spicelib/devices/bsim3v0/b3v0trunc.c | 6 ++-- src/spicelib/devices/bsim3v1/b3v1acld.c | 6 ++-- src/spicelib/devices/bsim3v1/b3v1cvtest.c | 6 ++-- src/spicelib/devices/bsim3v1/b3v1getic.c | 4 +-- src/spicelib/devices/bsim3v1/b3v1ld.c | 6 ++-- src/spicelib/devices/bsim3v1/b3v1noi.c | 6 ++-- src/spicelib/devices/bsim3v1/b3v1pzld.c | 6 ++-- src/spicelib/devices/bsim3v1/b3v1set.c | 12 +++---- src/spicelib/devices/bsim3v1/b3v1temp.c | 6 ++-- src/spicelib/devices/bsim3v1/b3v1trunc.c | 6 ++-- src/spicelib/devices/bsim3v32/b3v32acld.c | 6 ++-- src/spicelib/devices/bsim3v32/b3v32ask.c | 2 +- src/spicelib/devices/bsim3v32/b3v32cvtest.c | 6 ++-- src/spicelib/devices/bsim3v32/b3v32getic.c | 4 +-- src/spicelib/devices/bsim3v32/b3v32ld.c | 10 +++--- src/spicelib/devices/bsim3v32/b3v32noi.c | 6 ++-- src/spicelib/devices/bsim3v32/b3v32pzld.c | 6 ++-- src/spicelib/devices/bsim3v32/b3v32set.c | 24 ++++++------- src/spicelib/devices/bsim3v32/b3v32soachk.c | 4 +-- src/spicelib/devices/bsim3v32/b3v32temp.c | 6 ++-- src/spicelib/devices/bsim3v32/b3v32trunc.c | 6 ++-- src/spicelib/devices/bsim4/b4acld.c | 6 ++-- src/spicelib/devices/bsim4/b4cvtest.c | 6 ++-- src/spicelib/devices/bsim4/b4getic.c | 4 +-- src/spicelib/devices/bsim4/b4ld.c | 10 +++--- src/spicelib/devices/bsim4/b4noi.c | 6 ++-- src/spicelib/devices/bsim4/b4pzld.c | 6 ++-- src/spicelib/devices/bsim4/b4set.c | 24 ++++++------- src/spicelib/devices/bsim4/b4soachk.c | 4 +-- src/spicelib/devices/bsim4/b4temp.c | 6 ++-- src/spicelib/devices/bsim4/b4trunc.c | 6 ++-- src/spicelib/devices/bsim4v5/b4v5acld.c | 6 ++-- src/spicelib/devices/bsim4v5/b4v5cvtest.c | 6 ++-- src/spicelib/devices/bsim4v5/b4v5getic.c | 4 +-- src/spicelib/devices/bsim4v5/b4v5ld.c | 10 +++--- src/spicelib/devices/bsim4v5/b4v5noi.c | 6 ++-- src/spicelib/devices/bsim4v5/b4v5pzld.c | 6 ++-- src/spicelib/devices/bsim4v5/b4v5set.c | 24 ++++++------- src/spicelib/devices/bsim4v5/b4v5soachk.c | 4 +-- src/spicelib/devices/bsim4v5/b4v5temp.c | 6 ++-- src/spicelib/devices/bsim4v5/b4v5trunc.c | 6 ++-- src/spicelib/devices/bsim4v6/b4v6acld.c | 6 ++-- src/spicelib/devices/bsim4v6/b4v6cvtest.c | 6 ++-- src/spicelib/devices/bsim4v6/b4v6getic.c | 4 +-- src/spicelib/devices/bsim4v6/b4v6ld.c | 10 +++--- src/spicelib/devices/bsim4v6/b4v6noi.c | 6 ++-- src/spicelib/devices/bsim4v6/b4v6pzld.c | 6 ++-- src/spicelib/devices/bsim4v6/b4v6set.c | 24 ++++++------- src/spicelib/devices/bsim4v6/b4v6soachk.c | 4 +-- src/spicelib/devices/bsim4v6/b4v6temp.c | 6 ++-- src/spicelib/devices/bsim4v6/b4v6trunc.c | 6 ++-- src/spicelib/devices/bsim4v7/b4v7acld.c | 6 ++-- src/spicelib/devices/bsim4v7/b4v7cvtest.c | 6 ++-- src/spicelib/devices/bsim4v7/b4v7getic.c | 4 +-- src/spicelib/devices/bsim4v7/b4v7ld.c | 10 +++--- src/spicelib/devices/bsim4v7/b4v7noi.c | 6 ++-- src/spicelib/devices/bsim4v7/b4v7pzld.c | 6 ++-- src/spicelib/devices/bsim4v7/b4v7set.c | 24 ++++++------- src/spicelib/devices/bsim4v7/b4v7soachk.c | 4 +-- src/spicelib/devices/bsim4v7/b4v7temp.c | 6 ++-- src/spicelib/devices/bsim4v7/b4v7trunc.c | 6 ++-- src/spicelib/devices/bsimsoi/b4soiacld.c | 6 ++-- src/spicelib/devices/bsimsoi/b4soicvtest.c | 6 ++-- src/spicelib/devices/bsimsoi/b4soigetic.c | 4 +-- src/spicelib/devices/bsimsoi/b4soild.c | 10 +++--- src/spicelib/devices/bsimsoi/b4soinoi.c | 6 ++-- src/spicelib/devices/bsimsoi/b4soipzld.c | 6 ++-- src/spicelib/devices/bsimsoi/b4soiset.c | 24 ++++++------- src/spicelib/devices/bsimsoi/b4soisoachk.c | 4 +-- src/spicelib/devices/bsimsoi/b4soitemp.c | 6 ++-- src/spicelib/devices/bsimsoi/b4soitrunc.c | 6 ++-- src/spicelib/devices/cap/capacld.c | 6 ++-- src/spicelib/devices/cap/capgetic.c | 4 +-- src/spicelib/devices/cap/capload.c | 6 ++-- src/spicelib/devices/cap/cappzld.c | 6 ++-- src/spicelib/devices/cap/capsacl.c | 6 ++-- src/spicelib/devices/cap/capsetup.c | 6 ++-- src/spicelib/devices/cap/capsload.c | 6 ++-- src/spicelib/devices/cap/capsoachk.c | 4 +-- src/spicelib/devices/cap/capsprt.c | 6 ++-- src/spicelib/devices/cap/capsset.c | 6 ++-- src/spicelib/devices/cap/capsupd.c | 6 ++-- src/spicelib/devices/cap/captemp.c | 6 ++-- src/spicelib/devices/cap/captrunc.c | 6 ++-- src/spicelib/devices/cccs/cccsload.c | 6 ++-- src/spicelib/devices/cccs/cccspzld.c | 6 ++-- src/spicelib/devices/cccs/cccssacl.c | 6 ++-- src/spicelib/devices/cccs/cccsset.c | 6 ++-- src/spicelib/devices/cccs/cccssld.c | 6 ++-- src/spicelib/devices/cccs/cccssprt.c | 6 ++-- src/spicelib/devices/cccs/cccssset.c | 6 ++-- src/spicelib/devices/ccvs/ccvsfbr.c | 6 ++-- src/spicelib/devices/ccvs/ccvsload.c | 6 ++-- src/spicelib/devices/ccvs/ccvspzld.c | 6 ++-- src/spicelib/devices/ccvs/ccvssacl.c | 6 ++-- src/spicelib/devices/ccvs/ccvsset.c | 12 +++---- src/spicelib/devices/ccvs/ccvssld.c | 6 ++-- src/spicelib/devices/ccvs/ccvssprt.c | 6 ++-- src/spicelib/devices/ccvs/ccvssset.c | 6 ++-- src/spicelib/devices/cpl/cplload.c | 14 ++++---- src/spicelib/devices/cpl/cplsetup.c | 24 ++++++------- src/spicelib/devices/csw/cswacld.c | 6 ++-- src/spicelib/devices/csw/cswload.c | 6 ++-- src/spicelib/devices/csw/cswnoise.c | 4 +-- src/spicelib/devices/csw/cswpzld.c | 6 ++-- src/spicelib/devices/csw/cswsetup.c | 6 ++-- src/spicelib/devices/csw/cswtrunc.c | 6 ++-- src/spicelib/devices/dio/dioacld.c | 6 ++-- src/spicelib/devices/dio/dioconv.c | 6 ++-- src/spicelib/devices/dio/diodisto.c | 6 ++-- src/spicelib/devices/dio/diodset.c | 6 ++-- src/spicelib/devices/dio/diogetic.c | 4 +-- src/spicelib/devices/dio/dioload.c | 6 ++-- src/spicelib/devices/dio/dionoise.c | 4 +-- src/spicelib/devices/dio/diopzld.c | 6 ++-- src/spicelib/devices/dio/diosacl.c | 6 ++-- src/spicelib/devices/dio/diosetup.c | 12 +++---- src/spicelib/devices/dio/diosload.c | 6 ++-- src/spicelib/devices/dio/diosoachk.c | 4 +-- src/spicelib/devices/dio/diosprt.c | 6 ++-- src/spicelib/devices/dio/diosset.c | 6 ++-- src/spicelib/devices/dio/diosupd.c | 6 ++-- src/spicelib/devices/dio/diotemp.c | 4 +-- src/spicelib/devices/dio/diotrunc.c | 4 +-- src/spicelib/devices/hfet1/hfetacl.c | 6 ++-- src/spicelib/devices/hfet1/hfetgetic.c | 4 +-- src/spicelib/devices/hfet1/hfetload.c | 6 ++-- src/spicelib/devices/hfet1/hfetpzl.c | 6 ++-- src/spicelib/devices/hfet1/hfetsetup.c | 12 +++---- src/spicelib/devices/hfet1/hfettemp.c | 6 ++-- src/spicelib/devices/hfet1/hfettrunc.c | 4 +-- src/spicelib/devices/hfet2/hfet2acl.c | 6 ++-- src/spicelib/devices/hfet2/hfet2getic.c | 4 +-- src/spicelib/devices/hfet2/hfet2load.c | 6 ++-- src/spicelib/devices/hfet2/hfet2pzl.c | 6 ++-- src/spicelib/devices/hfet2/hfet2setup.c | 12 +++---- src/spicelib/devices/hfet2/hfet2temp.c | 6 ++-- src/spicelib/devices/hfet2/hfet2trunc.c | 6 ++-- src/spicelib/devices/hisim2/hsm2acld.c | 4 +-- src/spicelib/devices/hisim2/hsm2cvtest.c | 6 ++-- src/spicelib/devices/hisim2/hsm2getic.c | 4 +-- src/spicelib/devices/hisim2/hsm2ld.c | 10 +++--- src/spicelib/devices/hisim2/hsm2noi.c | 6 ++-- src/spicelib/devices/hisim2/hsm2pzld.c | 6 ++-- src/spicelib/devices/hisim2/hsm2set.c | 24 ++++++------- src/spicelib/devices/hisim2/hsm2soachk.c | 4 +-- src/spicelib/devices/hisim2/hsm2temp.c | 4 +-- src/spicelib/devices/hisim2/hsm2trunc.c | 6 ++-- src/spicelib/devices/hisimhv1/hsmhvacld.c | 4 +-- src/spicelib/devices/hisimhv1/hsmhvcvtest.c | 6 ++-- src/spicelib/devices/hisimhv1/hsmhvgetic.c | 4 +-- src/spicelib/devices/hisimhv1/hsmhvld.c | 6 ++-- src/spicelib/devices/hisimhv1/hsmhvnoi.c | 6 ++-- src/spicelib/devices/hisimhv1/hsmhvpzld.c | 6 ++-- src/spicelib/devices/hisimhv1/hsmhvset.c | 12 +++---- src/spicelib/devices/hisimhv1/hsmhvsoachk.c | 4 +-- src/spicelib/devices/hisimhv1/hsmhvtemp.c | 4 +-- src/spicelib/devices/hisimhv1/hsmhvtrunc.c | 6 ++-- src/spicelib/devices/hisimhv2/hsmhv2acld.c | 4 +-- src/spicelib/devices/hisimhv2/hsmhv2cvtest.c | 6 ++-- src/spicelib/devices/hisimhv2/hsmhv2getic.c | 4 +-- src/spicelib/devices/hisimhv2/hsmhv2ld.c | 6 ++-- src/spicelib/devices/hisimhv2/hsmhv2noi.c | 6 ++-- src/spicelib/devices/hisimhv2/hsmhv2pzld.c | 6 ++-- src/spicelib/devices/hisimhv2/hsmhv2set.c | 12 +++---- src/spicelib/devices/hisimhv2/hsmhv2soachk.c | 4 +-- src/spicelib/devices/hisimhv2/hsmhv2temp.c | 4 +-- src/spicelib/devices/hisimhv2/hsmhv2trunc.c | 6 ++-- src/spicelib/devices/ind/indacld.c | 6 ++-- src/spicelib/devices/ind/indload.c | 18 +++++----- src/spicelib/devices/ind/indpzld.c | 6 ++-- src/spicelib/devices/ind/indsacl.c | 18 +++++----- src/spicelib/devices/ind/indsetup.c | 12 +++---- src/spicelib/devices/ind/indsload.c | 18 +++++----- src/spicelib/devices/ind/indsprt.c | 6 ++-- src/spicelib/devices/ind/indsset.c | 6 ++-- src/spicelib/devices/ind/indsupd.c | 18 +++++----- src/spicelib/devices/ind/indtemp.c | 6 ++-- src/spicelib/devices/ind/indtrunc.c | 6 ++-- src/spicelib/devices/ind/mutacld.c | 6 ++-- src/spicelib/devices/ind/mutpzld.c | 6 ++-- src/spicelib/devices/ind/mutsetup.c | 4 +-- src/spicelib/devices/ind/mutsprt.c | 6 ++-- src/spicelib/devices/ind/mutsset.c | 6 ++-- src/spicelib/devices/ind/muttemp.c | 4 +-- src/spicelib/devices/isrc/isrcacct.c | 6 ++-- src/spicelib/devices/isrc/isrcacld.c | 6 ++-- src/spicelib/devices/isrc/isrcload.c | 6 ++-- src/spicelib/devices/isrc/isrctemp.c | 6 ++-- src/spicelib/devices/jfet/jfetacld.c | 6 ++-- src/spicelib/devices/jfet/jfetdist.c | 6 ++-- src/spicelib/devices/jfet/jfetdset.c | 6 ++-- src/spicelib/devices/jfet/jfetic.c | 4 +-- src/spicelib/devices/jfet/jfetload.c | 6 ++-- src/spicelib/devices/jfet/jfetnoi.c | 4 +-- src/spicelib/devices/jfet/jfetpzld.c | 6 ++-- src/spicelib/devices/jfet/jfetset.c | 12 +++---- src/spicelib/devices/jfet/jfettemp.c | 6 ++-- src/spicelib/devices/jfet/jfettrun.c | 4 +-- src/spicelib/devices/jfet2/jfet2acld.c | 6 ++-- src/spicelib/devices/jfet2/jfet2ic.c | 4 +-- src/spicelib/devices/jfet2/jfet2load.c | 6 ++-- src/spicelib/devices/jfet2/jfet2noi.c | 4 +-- src/spicelib/devices/jfet2/jfet2set.c | 12 +++---- src/spicelib/devices/jfet2/jfet2temp.c | 6 ++-- src/spicelib/devices/jfet2/jfet2trun.c | 4 +-- src/spicelib/devices/ltra/ltraacct.c | 12 +++---- src/spicelib/devices/ltra/ltraacld.c | 6 ++-- src/spicelib/devices/ltra/ltraask.c | 12 +++---- src/spicelib/devices/ltra/ltraload.c | 6 ++-- src/spicelib/devices/ltra/ltraset.c | 12 +++---- src/spicelib/devices/ltra/ltratemp.c | 6 ++-- src/spicelib/devices/ltra/ltratrun.c | 6 ++-- src/spicelib/devices/mes/mesacl.c | 6 ++-- src/spicelib/devices/mes/mesdisto.c | 6 ++-- src/spicelib/devices/mes/mesdset.c | 6 ++-- src/spicelib/devices/mes/mesgetic.c | 4 +-- src/spicelib/devices/mes/mesload.c | 6 ++-- src/spicelib/devices/mes/mesnoise.c | 4 +-- src/spicelib/devices/mes/mespzld.c | 6 ++-- src/spicelib/devices/mes/messetup.c | 12 +++---- src/spicelib/devices/mes/mestemp.c | 2 +- src/spicelib/devices/mes/mestrunc.c | 4 +-- src/spicelib/devices/mesa/mesaacl.c | 6 ++-- src/spicelib/devices/mesa/mesagetic.c | 4 +-- src/spicelib/devices/mesa/mesaload.c | 6 ++-- src/spicelib/devices/mesa/mesapzl.c | 6 ++-- src/spicelib/devices/mesa/mesasetup.c | 12 +++---- src/spicelib/devices/mesa/mesatemp.c | 6 ++-- src/spicelib/devices/mesa/mesatrunc.c | 6 ++-- src/spicelib/devices/mos1/mos1acld.c | 6 ++-- src/spicelib/devices/mos1/mos1ask.c | 8 ++--- src/spicelib/devices/mos1/mos1conv.c | 6 ++-- src/spicelib/devices/mos1/mos1dist.c | 6 ++-- src/spicelib/devices/mos1/mos1dset.c | 6 ++-- src/spicelib/devices/mos1/mos1ic.c | 4 +-- src/spicelib/devices/mos1/mos1load.c | 6 ++-- src/spicelib/devices/mos1/mos1noi.c | 4 +-- src/spicelib/devices/mos1/mos1pzld.c | 6 ++-- src/spicelib/devices/mos1/mos1sacl.c | 6 ++-- src/spicelib/devices/mos1/mos1set.c | 12 +++---- src/spicelib/devices/mos1/mos1sld.c | 6 ++-- src/spicelib/devices/mos1/mos1sprt.c | 6 ++-- src/spicelib/devices/mos1/mos1sset.c | 6 ++-- src/spicelib/devices/mos1/mos1supd.c | 6 ++-- src/spicelib/devices/mos1/mos1temp.c | 6 ++-- src/spicelib/devices/mos1/mos1trun.c | 4 +-- src/spicelib/devices/mos2/mos2acld.c | 6 ++-- src/spicelib/devices/mos2/mos2ask.c | 8 ++--- src/spicelib/devices/mos2/mos2conv.c | 6 ++-- src/spicelib/devices/mos2/mos2dist.c | 6 ++-- src/spicelib/devices/mos2/mos2dset.c | 6 ++-- src/spicelib/devices/mos2/mos2ic.c | 4 +-- src/spicelib/devices/mos2/mos2load.c | 6 ++-- src/spicelib/devices/mos2/mos2noi.c | 4 +-- src/spicelib/devices/mos2/mos2pzld.c | 6 ++-- src/spicelib/devices/mos2/mos2sacl.c | 6 ++-- src/spicelib/devices/mos2/mos2set.c | 12 +++---- src/spicelib/devices/mos2/mos2sld.c | 6 ++-- src/spicelib/devices/mos2/mos2sprt.c | 6 ++-- src/spicelib/devices/mos2/mos2sset.c | 6 ++-- src/spicelib/devices/mos2/mos2supd.c | 6 ++-- src/spicelib/devices/mos2/mos2temp.c | 6 ++-- src/spicelib/devices/mos2/mos2trun.c | 4 +-- src/spicelib/devices/mos3/mos3acld.c | 6 ++-- src/spicelib/devices/mos3/mos3ask.c | 18 +++++----- src/spicelib/devices/mos3/mos3conv.c | 6 ++-- src/spicelib/devices/mos3/mos3dist.c | 6 ++-- src/spicelib/devices/mos3/mos3dset.c | 6 ++-- src/spicelib/devices/mos3/mos3ic.c | 4 +-- src/spicelib/devices/mos3/mos3load.c | 6 ++-- src/spicelib/devices/mos3/mos3noi.c | 4 +-- src/spicelib/devices/mos3/mos3pzld.c | 6 ++-- src/spicelib/devices/mos3/mos3sacl.c | 6 ++-- src/spicelib/devices/mos3/mos3set.c | 12 +++---- src/spicelib/devices/mos3/mos3sld.c | 6 ++-- src/spicelib/devices/mos3/mos3sprt.c | 6 ++-- src/spicelib/devices/mos3/mos3sset.c | 6 ++-- src/spicelib/devices/mos3/mos3supd.c | 6 ++-- src/spicelib/devices/mos3/mos3temp.c | 6 ++-- src/spicelib/devices/mos3/mos3trun.c | 4 +-- src/spicelib/devices/mos6/mos6ask.c | 8 ++--- src/spicelib/devices/mos6/mos6conv.c | 6 ++-- src/spicelib/devices/mos6/mos6ic.c | 4 +-- src/spicelib/devices/mos6/mos6load.c | 6 ++-- src/spicelib/devices/mos6/mos6set.c | 12 +++---- src/spicelib/devices/mos6/mos6temp.c | 6 ++-- src/spicelib/devices/mos6/mos6trun.c | 4 +-- src/spicelib/devices/mos9/mos9acld.c | 6 ++-- src/spicelib/devices/mos9/mos9ask.c | 18 +++++----- src/spicelib/devices/mos9/mos9conv.c | 6 ++-- src/spicelib/devices/mos9/mos9dist.c | 6 ++-- src/spicelib/devices/mos9/mos9dset.c | 6 ++-- src/spicelib/devices/mos9/mos9ic.c | 4 +-- src/spicelib/devices/mos9/mos9load.c | 6 ++-- src/spicelib/devices/mos9/mos9noi.c | 4 +-- src/spicelib/devices/mos9/mos9pzld.c | 6 ++-- src/spicelib/devices/mos9/mos9sacl.c | 6 ++-- src/spicelib/devices/mos9/mos9set.c | 12 +++---- src/spicelib/devices/mos9/mos9sld.c | 6 ++-- src/spicelib/devices/mos9/mos9sprt.c | 6 ++-- src/spicelib/devices/mos9/mos9sset.c | 6 ++-- src/spicelib/devices/mos9/mos9supd.c | 6 ++-- src/spicelib/devices/mos9/mos9temp.c | 6 ++-- src/spicelib/devices/mos9/mos9trun.c | 4 +-- src/spicelib/devices/nbjt/nbjtacld.c | 6 ++-- src/spicelib/devices/nbjt/nbjtdump.c | 12 +++---- src/spicelib/devices/nbjt/nbjtload.c | 8 ++--- src/spicelib/devices/nbjt/nbjtpzld.c | 6 ++-- src/spicelib/devices/nbjt/nbjtset.c | 6 ++-- src/spicelib/devices/nbjt/nbjttemp.c | 6 ++-- src/spicelib/devices/nbjt/nbjttrun.c | 6 ++-- src/spicelib/devices/nbjt2/nbt2acld.c | 6 ++-- src/spicelib/devices/nbjt2/nbt2dump.c | 12 +++---- src/spicelib/devices/nbjt2/nbt2load.c | 8 ++--- src/spicelib/devices/nbjt2/nbt2pzld.c | 6 ++-- src/spicelib/devices/nbjt2/nbt2set.c | 6 ++-- src/spicelib/devices/nbjt2/nbt2temp.c | 6 ++-- src/spicelib/devices/nbjt2/nbt2trun.c | 6 ++-- src/spicelib/devices/ndev/ndevaccept.c | 8 ++--- src/spicelib/devices/ndev/ndevload.c | 12 +++---- src/spicelib/devices/ndev/ndevset.c | 6 ++-- src/spicelib/devices/numd/numdacld.c | 6 ++-- src/spicelib/devices/numd/numddump.c | 12 +++---- src/spicelib/devices/numd/numdload.c | 8 ++--- src/spicelib/devices/numd/numdpzld.c | 6 ++-- src/spicelib/devices/numd/numdset.c | 6 ++-- src/spicelib/devices/numd/numdtemp.c | 6 ++-- src/spicelib/devices/numd/numdtrun.c | 6 ++-- src/spicelib/devices/numd2/nud2acld.c | 6 ++-- src/spicelib/devices/numd2/nud2dump.c | 12 +++---- src/spicelib/devices/numd2/nud2load.c | 8 ++--- src/spicelib/devices/numd2/nud2pzld.c | 6 ++-- src/spicelib/devices/numd2/nud2set.c | 6 ++-- src/spicelib/devices/numd2/nud2temp.c | 6 ++-- src/spicelib/devices/numd2/nud2trun.c | 6 ++-- src/spicelib/devices/numos/nummacld.c | 6 ++-- src/spicelib/devices/numos/nummdump.c | 12 +++---- src/spicelib/devices/numos/nummload.c | 8 ++--- src/spicelib/devices/numos/nummpzld.c | 6 ++-- src/spicelib/devices/numos/nummset.c | 6 ++-- src/spicelib/devices/numos/nummtemp.c | 6 ++-- src/spicelib/devices/numos/nummtrun.c | 6 ++-- src/spicelib/devices/res/resload.c | 12 +++---- src/spicelib/devices/res/resnoise.c | 6 ++-- src/spicelib/devices/res/respzld.c | 6 ++-- src/spicelib/devices/res/ressacl.c | 6 ++-- src/spicelib/devices/res/ressetup.c | 6 ++-- src/spicelib/devices/res/ressload.c | 6 ++-- src/spicelib/devices/res/ressoachk.c | 4 +-- src/spicelib/devices/res/ressprt.c | 6 ++-- src/spicelib/devices/res/ressset.c | 6 ++-- src/spicelib/devices/res/restemp.c | 8 ++--- src/spicelib/devices/soi3/soi3acld.c | 6 ++-- src/spicelib/devices/soi3/soi3conv.c | 6 ++-- src/spicelib/devices/soi3/soi3ic.c | 4 +-- src/spicelib/devices/soi3/soi3load.c | 6 ++-- src/spicelib/devices/soi3/soi3nois.c | 4 +-- src/spicelib/devices/soi3/soi3set.c | 12 +++---- src/spicelib/devices/soi3/soi3temp.c | 6 ++-- src/spicelib/devices/soi3/soi3trun.c | 4 +-- src/spicelib/devices/sw/swacload.c | 6 ++-- src/spicelib/devices/sw/swload.c | 6 ++-- src/spicelib/devices/sw/swnoise.c | 4 +-- src/spicelib/devices/sw/swpzload.c | 6 ++-- src/spicelib/devices/sw/swsetup.c | 6 ++-- src/spicelib/devices/sw/swtrunc.c | 6 ++-- src/spicelib/devices/tra/traacct.c | 6 ++-- src/spicelib/devices/tra/traacld.c | 6 ++-- src/spicelib/devices/tra/traload.c | 6 ++-- src/spicelib/devices/tra/trasetup.c | 12 +++---- src/spicelib/devices/tra/tratemp.c | 6 ++-- src/spicelib/devices/tra/tratrunc.c | 6 ++-- src/spicelib/devices/txl/txlacct.c | 12 +++---- src/spicelib/devices/txl/txlfbr.c | 6 ++-- src/spicelib/devices/txl/txlload.c | 14 ++++---- src/spicelib/devices/txl/txlsetup.c | 22 ++++++------ src/spicelib/devices/urc/urcsetup.c | 12 +++---- src/spicelib/devices/vbic/vbicacld.c | 6 ++-- src/spicelib/devices/vbic/vbicconv.c | 4 +-- src/spicelib/devices/vbic/vbicgetic.c | 4 +-- src/spicelib/devices/vbic/vbicload.c | 6 ++-- src/spicelib/devices/vbic/vbicnoise.c | 6 ++-- src/spicelib/devices/vbic/vbicpzld.c | 6 ++-- src/spicelib/devices/vbic/vbicsetup.c | 12 +++---- src/spicelib/devices/vbic/vbicsoachk.c | 4 +-- src/spicelib/devices/vbic/vbictemp.c | 6 ++-- src/spicelib/devices/vbic/vbictrunc.c | 6 ++-- src/spicelib/devices/vccs/vccsload.c | 6 ++-- src/spicelib/devices/vccs/vccspzld.c | 6 ++-- src/spicelib/devices/vccs/vccssacl.c | 6 ++-- src/spicelib/devices/vccs/vccsset.c | 6 ++-- src/spicelib/devices/vccs/vccssld.c | 6 ++-- src/spicelib/devices/vccs/vccssprt.c | 6 ++-- src/spicelib/devices/vccs/vccssset.c | 6 ++-- src/spicelib/devices/vcvs/vcvsfbr.c | 6 ++-- src/spicelib/devices/vcvs/vcvsload.c | 6 ++-- src/spicelib/devices/vcvs/vcvspzld.c | 6 ++-- src/spicelib/devices/vcvs/vcvssacl.c | 6 ++-- src/spicelib/devices/vcvs/vcvsset.c | 12 +++---- src/spicelib/devices/vcvs/vcvssld.c | 6 ++-- src/spicelib/devices/vcvs/vcvssprt.c | 6 ++-- src/spicelib/devices/vcvs/vcvssset.c | 6 ++-- src/spicelib/devices/vsrc/vsrcacct.c | 6 ++-- src/spicelib/devices/vsrc/vsrcacld.c | 6 ++-- src/spicelib/devices/vsrc/vsrcfbr.c | 6 ++-- src/spicelib/devices/vsrc/vsrcload.c | 6 ++-- src/spicelib/devices/vsrc/vsrcpzld.c | 6 ++-- src/spicelib/devices/vsrc/vsrcpzs.c | 6 ++-- src/spicelib/devices/vsrc/vsrcset.c | 12 +++---- src/spicelib/devices/vsrc/vsrctemp.c | 6 ++-- src/xspice/cm/cmmeters.c | 36 +++++++++---------- src/xspice/evt/evtload.c | 2 +- src/xspice/mif/mifask.c | 2 +- src/xspice/mif/mifconvt.c | 4 +-- src/xspice/mif/mifdelete.c | 2 +- src/xspice/mif/mifload.c | 4 +-- src/xspice/mif/mifsetup.c | 14 ++++---- src/xspice/mif/miftrunc.c | 4 +-- 511 files changed, 1736 insertions(+), 1736 deletions(-) diff --git a/src/spicelib/analysis/cktdisto.c b/src/spicelib/analysis/cktdisto.c index 824218f5a..334c15ac9 100644 --- a/src/spicelib/analysis/cktdisto.c +++ b/src/spicelib/analysis/cktdisto.c @@ -89,9 +89,9 @@ CKTdisto (CKTcircuit *ckt, int mode) VSRCinstance *here; VSRCmodel *model; for(model = (VSRCmodel *)ckt->CKThead[vcode];model != NULL; - model=model->VSRCnextModel){ - for(here=model->VSRCinstances;here!=NULL; - here=here->VSRCnextInstance) { + model=VSRCnextModel(model)){ + for(here=VSRCinstances(model);here!=NULL; + here=VSRCnextInstance(here)) { /* check if the source has a distortion input*/ @@ -125,9 +125,9 @@ if (((here->VSRCdF1given) && (mode == D_RHSF1)) || ISRCmodel *model; for(model= (ISRCmodel *)ckt->CKThead[icode];model != NULL; - model=model->ISRCnextModel){ - for(here=model->ISRCinstances;here!=NULL; - here=here->ISRCnextInstance) { + model=ISRCnextModel(model)){ + for(here=ISRCinstances(model);here!=NULL; + here=ISRCnextInstance(here)) { /* check if the source has a distortion input*/ diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index dec1e4475..80b7ec21d 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -90,8 +90,8 @@ DCtrCurv(CKTcircuit *ckt, int restart) RESinstance *here; RESmodel *model; - for (model = (RESmodel *)ckt->CKThead[rcode]; model; model = model->RESnextModel) - for (here = model->RESinstances; here; here = here->RESnextInstance) + for (model = (RESmodel *)ckt->CKThead[rcode]; model; model = RESnextModel(model)) + for (here = RESinstances(model); here; here = RESnextInstance(here)) if (here->RESname == job->TRCVvName[i]) { job->TRCVvElt[i] = (GENinstance *)here; job->TRCVvSave[i] = here->RESresist; @@ -109,8 +109,8 @@ DCtrCurv(CKTcircuit *ckt, int restart) VSRCinstance *here; VSRCmodel *model; - for (model = (VSRCmodel *)ckt->CKThead[vcode]; model; model = model->VSRCnextModel) - for (here = model->VSRCinstances; here; here = here->VSRCnextInstance) + for (model = (VSRCmodel *)ckt->CKThead[vcode]; model; model = VSRCnextModel(model)) + for (here = VSRCinstances(model); here; here = VSRCnextInstance(here)) if (here->VSRCname == job->TRCVvName[i]) { job->TRCVvElt[i] = (GENinstance *)here; job->TRCVvSave[i] = here->VSRCdcValue; @@ -127,8 +127,8 @@ DCtrCurv(CKTcircuit *ckt, int restart) ISRCinstance *here; ISRCmodel *model; - for (model = (ISRCmodel *)ckt->CKThead[icode]; model; model = model->ISRCnextModel) - for (here = model->ISRCinstances; here; here = here->ISRCnextInstance) + for (model = (ISRCmodel *)ckt->CKThead[icode]; model; model = ISRCnextModel(model)) + for (here = ISRCinstances(model); here; here = ISRCnextInstance(here)) if (here->ISRCname == job->TRCVvName[i]) { job->TRCVvElt[i] = (GENinstance *)here; job->TRCVvSave[i] = here->ISRCdcValue; diff --git a/src/spicelib/devices/asrc/asrcacld.c b/src/spicelib/devices/asrc/asrcacld.c index 2ab34c00f..115dd678c 100644 --- a/src/spicelib/devices/asrc/asrcacld.c +++ b/src/spicelib/devices/asrc/asrcacld.c @@ -28,8 +28,8 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); - for (; model; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { + for (; model; model = ASRCnextModel(model)) { + for (here = ASRCinstances(model); here; here = ASRCnextInstance(here)) { difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15; factor = 1.0 diff --git a/src/spicelib/devices/asrc/asrcconv.c b/src/spicelib/devices/asrc/asrcconv.c index 1ec374271..4fa584a74 100644 --- a/src/spicelib/devices/asrc/asrcconv.c +++ b/src/spicelib/devices/asrc/asrcconv.c @@ -21,8 +21,8 @@ ASRCconvTest(GENmodel *inModel, CKTcircuit *ckt) double tol; double rhs; - for (; model; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { + for (; model; model = ASRCnextModel(model)) { + for (here = ASRCinstances(model); here; here = ASRCnextInstance(here)) { i = here->ASRCtree->numVars; if (asrc_nvals < i) { diff --git a/src/spicelib/devices/asrc/asrcfbr.c b/src/spicelib/devices/asrc/asrcfbr.c index f6c224add..acbf9c9fa 100644 --- a/src/spicelib/devices/asrc/asrcfbr.c +++ b/src/spicelib/devices/asrc/asrcfbr.c @@ -19,8 +19,8 @@ ASRCfindBr(CKTcircuit *ckt, GENmodel *inputModel, IFuid name) int error; CKTnode *tmp; - for (; model; model = model->ASRCnextModel) - for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) + for (; model; model = ASRCnextModel(model)) + for (here = ASRCinstances(model); here; here = ASRCnextInstance(here)) if (here->ASRCname == name) { if (here->ASRCbranch == 0) { error = CKTmkCur(ckt, &tmp, here->ASRCname, "branch"); diff --git a/src/spicelib/devices/asrc/asrcload.c b/src/spicelib/devices/asrc/asrcload.c index 9adc5a748..35bb5b152 100644 --- a/src/spicelib/devices/asrc/asrcload.c +++ b/src/spicelib/devices/asrc/asrcload.c @@ -29,8 +29,8 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt) double difference; double factor; - for (; model; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here; here=here->ASRCnextInstance) { + for (; model; model = ASRCnextModel(model)) { + for (here = ASRCinstances(model); here; here=ASRCnextInstance(here)) { difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15; factor = 1.0 diff --git a/src/spicelib/devices/asrc/asrcpzld.c b/src/spicelib/devices/asrc/asrcpzld.c index 16419f4be..48110bd9f 100644 --- a/src/spicelib/devices/asrc/asrcpzld.c +++ b/src/spicelib/devices/asrc/asrcpzld.c @@ -27,8 +27,8 @@ ASRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(s); - for (; model; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { + for (; model; model = ASRCnextModel(model)) { + for (here = ASRCinstances(model); here; here = ASRCnextInstance(here)) { difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15; factor = 1.0 diff --git a/src/spicelib/devices/asrc/asrcset.c b/src/spicelib/devices/asrc/asrcset.c index 89d30a9bd..f97ff035c 100644 --- a/src/spicelib/devices/asrc/asrcset.c +++ b/src/spicelib/devices/asrc/asrcset.c @@ -31,8 +31,8 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) NG_IGNORE(states); - for (; model; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here; here=here->ASRCnextInstance) { + for (; model; model = ASRCnextModel(model)) { + for (here = ASRCinstances(model); here; here=ASRCnextInstance(here)) { if (!here->ASRCtree) return E_PARMVAL; @@ -126,8 +126,8 @@ ASRCunsetup(GENmodel *inModel, CKTcircuit *ckt) ASRCmodel *model = (ASRCmodel *) inModel; ASRCinstance *here; - for (; model; model = model->ASRCnextModel) - for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { + for (; model; model = ASRCnextModel(model)) + for (here = ASRCinstances(model); here; here = ASRCnextInstance(here)) { if (here->ASRCbranch > 0) CKTdltNNum(ckt, here->ASRCbranch); here->ASRCbranch = 0; diff --git a/src/spicelib/devices/asrc/asrctemp.c b/src/spicelib/devices/asrc/asrctemp.c index 469018eaa..5e316b903 100644 --- a/src/spicelib/devices/asrc/asrctemp.c +++ b/src/spicelib/devices/asrc/asrctemp.c @@ -15,8 +15,8 @@ ASRCtemp(GENmodel *inModel, CKTcircuit *ckt) ASRCmodel *model = (ASRCmodel *) inModel; ASRCinstance *here; - for (; model; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { + for (; model; model = ASRCnextModel(model)) { + for (here = ASRCinstances(model); here; here = ASRCnextInstance(here)) { /* Default Value Processing for Source Instance */ diff --git a/src/spicelib/devices/bjt/bjtacld.c b/src/spicelib/devices/bjt/bjtacld.c index 30bc78ee1..fcdfa7cb3 100644 --- a/src/spicelib/devices/bjt/bjtacld.c +++ b/src/spicelib/devices/bjt/bjtacld.c @@ -37,9 +37,9 @@ BJTacLoad(GENmodel *inModel, CKTcircuit *ckt) double xcmcb; double m; - for( ; model != NULL; model = model->BJTnextModel) { - for( here = model->BJTinstances; here!= NULL; - here = here->BJTnextInstance) { + for( ; model != NULL; model = BJTnextModel(model)) { + for( here = BJTinstances(model); here!= NULL; + here = BJTnextInstance(here)) { m = here->BJTm; diff --git a/src/spicelib/devices/bjt/bjtask.c b/src/spicelib/devices/bjt/bjtask.c index cf14cb42a..f40676907 100644 --- a/src/spicelib/devices/bjt/bjtask.c +++ b/src/spicelib/devices/bjt/bjtask.c @@ -96,7 +96,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue return(OK); case BJT_QUEST_CB: value->rValue = *(ckt->CKTstate0 + here->BJTcb); - if (here->BJTmodPtr->BJTsubs==LATERAL) { + if (BJTmodPtr(here)->BJTsubs==LATERAL) { value->rValue -= *(ckt->CKTstate0 + here->BJTcdsub); if ((ckt->CKTcurrentAnalysis & DOING_TRAN) && !(ckt->CKTmode & MODETRANOP)) { @@ -248,7 +248,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue (ckt->CKTmode & MODETRANOP)) { value->rValue = 0; } else { - value->rValue = -(here->BJTmodPtr->BJTsubs * + value->rValue = -(BJTmodPtr(here)->BJTsubs * (*(ckt->CKTstate0 + here->BJTcqsub) + *(ckt->CKTstate0 + here->BJTcdsub))); } @@ -263,7 +263,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue } else { value->rValue = -*(ckt->CKTstate0 + here->BJTcc); value->rValue -= *(ckt->CKTstate0 + here->BJTcb); - if (here->BJTmodPtr->BJTsubs==VERTICAL) { + if (BJTmodPtr(here)->BJTsubs==VERTICAL) { value->rValue += *(ckt->CKTstate0 + here->BJTcdsub); if ((ckt->CKTcurrentAnalysis & DOING_TRAN) && !(ckt->CKTmode & MODETRANOP)) { diff --git a/src/spicelib/devices/bjt/bjtconv.c b/src/spicelib/devices/bjt/bjtconv.c index 21201e7b8..515499e81 100644 --- a/src/spicelib/devices/bjt/bjtconv.c +++ b/src/spicelib/devices/bjt/bjtconv.c @@ -32,8 +32,8 @@ BJTconvTest(GENmodel *inModel, CKTcircuit *ckt) - for( ; model != NULL; model = model->BJTnextModel) { - for(here=model->BJTinstances;here!=NULL;here = here->BJTnextInstance){ + for( ; model != NULL; model = BJTnextModel(model)) { + for(here=BJTinstances(model);here!=NULL;here = BJTnextInstance(here)){ vbe=model->BJTtype*( *(ckt->CKTrhsOld+here->BJTbasePrimeNode)- diff --git a/src/spicelib/devices/bjt/bjtdisto.c b/src/spicelib/devices/bjt/bjtdisto.c index ff85a4625..353f10b89 100644 --- a/src/spicelib/devices/bjt/bjtdisto.c +++ b/src/spicelib/devices/bjt/bjtdisto.c @@ -52,12 +52,12 @@ BJTdisto(int mode, GENmodel *genmodel, CKTcircuit *ckt) (mode == D_2F1MF2)) { /* loop through all the BJT models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { td = model->BJTexcessPhaseFactor; /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { /* getting Volterra kernels */ /* until further notice x = vbe, y = vbc, z= vbed */ diff --git a/src/spicelib/devices/bjt/bjtdset.c b/src/spicelib/devices/bjt/bjtdset.c index 26f65b968..9236dd291 100644 --- a/src/spicelib/devices/bjt/bjtdset.c +++ b/src/spicelib/devices/bjt/bjtdset.c @@ -141,11 +141,11 @@ int BJTdSetup(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { vt = here->BJTtemp * CONSTKoverQ; diff --git a/src/spicelib/devices/bjt/bjtgetic.c b/src/spicelib/devices/bjt/bjtgetic.c index 9fa51f32b..7bc1fa500 100644 --- a/src/spicelib/devices/bjt/bjtgetic.c +++ b/src/spicelib/devices/bjt/bjtgetic.c @@ -29,8 +29,8 @@ BJTgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->BJTnextModel) { - for(here = model->BJTinstances; here ; here = here->BJTnextInstance) { + for( ; model ; model = BJTnextModel(model)) { + for(here = BJTinstances(model); here ; here = BJTnextInstance(here)) { if(!here->BJTicVBEGiven) { here->BJTicVBE = diff --git a/src/spicelib/devices/bjt/bjtload.c b/src/spicelib/devices/bjt/bjtload.c index 82c25d278..f44e4f1bf 100644 --- a/src/spicelib/devices/bjt/bjtload.c +++ b/src/spicelib/devices/bjt/bjtload.c @@ -139,11 +139,11 @@ BJTload(GENmodel *inModel, CKTcircuit *ckt) double m; /* loop through all the models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { vt = here->BJTtemp * CONSTKoverQ; diff --git a/src/spicelib/devices/bjt/bjtnoise.c b/src/spicelib/devices/bjt/bjtnoise.c index b17a40e42..8cbf4b48c 100644 --- a/src/spicelib/devices/bjt/bjtnoise.c +++ b/src/spicelib/devices/bjt/bjtnoise.c @@ -50,9 +50,9 @@ BJTnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; -for (model=firstModel; model != NULL; model=model->BJTnextModel) { - for (inst=model->BJTinstances; inst != NULL; - inst=inst->BJTnextInstance) { +for (model=firstModel; model != NULL; model=BJTnextModel(model)) { + for (inst=BJTinstances(model); inst != NULL; + inst=BJTnextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/bjt/bjtpzld.c b/src/spicelib/devices/bjt/bjtpzld.c index 92de1f2eb..eca48c04f 100644 --- a/src/spicelib/devices/bjt/bjtpzld.c +++ b/src/spicelib/devices/bjt/bjtpzld.c @@ -33,9 +33,9 @@ BJTpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double xcmcb; double m; - for( ; model != NULL; model = model->BJTnextModel) { - for( here = model->BJTinstances; here!= NULL; - here = here->BJTnextInstance) { + for( ; model != NULL; model = BJTnextModel(model)) { + for( here = BJTinstances(model); here!= NULL; + here = BJTnextInstance(here)) { m = here->BJTm; diff --git a/src/spicelib/devices/bjt/bjtsacl.c b/src/spicelib/devices/bjt/bjtsacl.c index e083982f2..38ad2a9e4 100644 --- a/src/spicelib/devices/bjt/bjtsacl.c +++ b/src/spicelib/devices/bjt/bjtsacl.c @@ -92,11 +92,11 @@ BJTsAcLoad(GENmodel *inModel, CKTcircuit *ckt) info->SENstatus = PERTURBATION; /* loop through all the models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { /* save the unperturbed values in the state vector */ diff --git a/src/spicelib/devices/bjt/bjtsetup.c b/src/spicelib/devices/bjt/bjtsetup.c index 239914838..e2cc3d3ba 100644 --- a/src/spicelib/devices/bjt/bjtsetup.c +++ b/src/spicelib/devices/bjt/bjtsetup.c @@ -32,7 +32,7 @@ BJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the diode models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { if(model->BJTtype != NPN && model->BJTtype != PNP) { model->BJTtype = NPN; @@ -345,8 +345,8 @@ BJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) */ /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -476,10 +476,10 @@ BJTunsetup( BJTinstance *here; for (model = (BJTmodel *)inModel; model != NULL; - model = model->BJTnextModel) + model = BJTnextModel(model)) { - for (here = model->BJTinstances; here != NULL; - here=here->BJTnextInstance) + for (here = BJTinstances(model); here != NULL; + here=BJTnextInstance(here)) { if (here->BJTemitPrimeNode > 0 && here->BJTemitPrimeNode != here->BJTemitNode) diff --git a/src/spicelib/devices/bjt/bjtsload.c b/src/spicelib/devices/bjt/bjtsload.c index 09abc5f14..46b8b6c95 100644 --- a/src/spicelib/devices/bjt/bjtsload.c +++ b/src/spicelib/devices/bjt/bjtsload.c @@ -86,11 +86,11 @@ BJTsLoad(GENmodel *inModel, CKTcircuit *ckt) info->SENstatus = PERTURBATION; /* loop through all the models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { #ifdef SENSDEBUG printf("base = %d , baseprm = %d ,col = %d, colprm = %d\n", diff --git a/src/spicelib/devices/bjt/bjtsoachk.c b/src/spicelib/devices/bjt/bjtsoachk.c index 31cad7952..b13d85d27 100644 --- a/src/spicelib/devices/bjt/bjtsoachk.c +++ b/src/spicelib/devices/bjt/bjtsoachk.c @@ -30,9 +30,9 @@ BJTsoaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->BJTnextModel) { + for (; model; model = BJTnextModel(model)) { - for (here = model->BJTinstances; here; here=here->BJTnextInstance) { + for (here = BJTinstances(model); here; here=BJTnextInstance(here)) { vbe = fabs(ckt->CKTrhsOld [here->BJTbasePrimeNode] - ckt->CKTrhsOld [here->BJTemitPrimeNode]); diff --git a/src/spicelib/devices/bjt/bjtsprt.c b/src/spicelib/devices/bjt/bjtsprt.c index dcc947ddb..3963d6ba1 100644 --- a/src/spicelib/devices/bjt/bjtsprt.c +++ b/src/spicelib/devices/bjt/bjtsprt.c @@ -27,13 +27,13 @@ BJTsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("BJTS-----------------\n"); /* loop through all the BJT models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { printf("Model name:%s\n",model->BJTmodName); /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { ckt->CKTsenInfo->SEN_parmVal[here->BJTsenParmNo] = here->BJTarea; diff --git a/src/spicelib/devices/bjt/bjtsset.c b/src/spicelib/devices/bjt/bjtsset.c index 1b7664ebc..78753aca2 100644 --- a/src/spicelib/devices/bjt/bjtsset.c +++ b/src/spicelib/devices/bjt/bjtsset.c @@ -30,12 +30,12 @@ BJTsSetup(SENstruct *info, GENmodel *inModel) #endif /* STEPDEBUG */ /* loop through all the diode models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { if(here->BJTsenParmNo){ here->BJTsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/bjt/bjtsupd.c b/src/spicelib/devices/bjt/bjtsupd.c index f76ef8f71..e962fc957 100644 --- a/src/spicelib/devices/bjt/bjtsupd.c +++ b/src/spicelib/devices/bjt/bjtsupd.c @@ -43,11 +43,11 @@ BJTsUpdate(GENmodel *inModel, CKTcircuit *ckt) printf("CKTtime = %.5e\n",ckt->CKTtime); #endif /* SENSDEBUG */ /* loop through all the BJT models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { sxpbe = 0; sxpbc = 0; diff --git a/src/spicelib/devices/bjt/bjttemp.c b/src/spicelib/devices/bjt/bjttemp.c index 89e62c2c8..40f803b89 100644 --- a/src/spicelib/devices/bjt/bjttemp.c +++ b/src/spicelib/devices/bjt/bjttemp.c @@ -38,7 +38,7 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt) double dt; /* loop through all the bipolar models */ - for( ; model != NULL; model = model->BJTnextModel ) { + for( ; model != NULL; model = BJTnextModel(model)) { if(!model->BJTtnomGiven) model->BJTtnom = ckt->CKTnomTemp; vtnom = CONSTKoverQ * model->BJTtnom; @@ -100,8 +100,8 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt) (1 + model->BJTjunctionExpBC); /* loop through all the instances of the model */ - for (here = model->BJTinstances; here != NULL ; - here=here->BJTnextInstance) { + for (here = BJTinstances(model); here != NULL ; + here=BJTnextInstance(here)) { double arg1, pbfact1, egfet1; if(!here->BJTdtempGiven) diff --git a/src/spicelib/devices/bjt/bjttrunc.c b/src/spicelib/devices/bjt/bjttrunc.c index b00afac97..abee58deb 100644 --- a/src/spicelib/devices/bjt/bjttrunc.c +++ b/src/spicelib/devices/bjt/bjttrunc.c @@ -24,8 +24,8 @@ BJTtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) BJTmodel *model = (BJTmodel*)inModel; BJTinstance *here; - for( ; model != NULL; model = model->BJTnextModel) { - for(here=model->BJTinstances;here!=NULL;here = here->BJTnextInstance){ + for( ; model != NULL; model = BJTnextModel(model)) { + for(here=BJTinstances(model);here!=NULL;here = BJTnextInstance(here)){ CKTterr(here->BJTqbe,ckt,timeStep); CKTterr(here->BJTqbc,ckt,timeStep); diff --git a/src/spicelib/devices/bsim1/b1acld.c b/src/spicelib/devices/bsim1/b1acld.c index a875125d6..f4fb90638 100644 --- a/src/spicelib/devices/bsim1/b1acld.c +++ b/src/spicelib/devices/bsim1/b1acld.c @@ -53,9 +53,9 @@ B1acLoad(GENmodel *inModel, CKTcircuit *ckt) double m; /* parallel multiplier */ omega = ckt->CKTomega; - for( ; model != NULL; model = model->B1nextModel) { - for(here = model->B1instances; here!= NULL; - here = here->B1nextInstance) { + for( ; model != NULL; model = B1nextModel(model)) { + for(here = B1instances(model); here!= NULL; + here = B1nextInstance(here)) { if (here->B1mode >= 0) { xnrm=1; diff --git a/src/spicelib/devices/bsim1/b1cvtest.c b/src/spicelib/devices/bsim1/b1cvtest.c index a17d7c0b1..df0b0be60 100644 --- a/src/spicelib/devices/bsim1/b1cvtest.c +++ b/src/spicelib/devices/bsim1/b1cvtest.c @@ -41,11 +41,11 @@ B1convTest(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the B1 device models */ - for( ; model != NULL; model = model->B1nextModel ) { + for( ; model != NULL; model = B1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B1instances; here != NULL ; - here=here->B1nextInstance) { + for (here = B1instances(model); here != NULL ; + here=B1nextInstance(here)) { vbs = model->B1type * ( *(ckt->CKTrhsOld+here->B1bNode) - diff --git a/src/spicelib/devices/bsim1/b1disto.c b/src/spicelib/devices/bsim1/b1disto.c index 48ce2986f..f53302afd 100644 --- a/src/spicelib/devices/bsim1/b1disto.c +++ b/src/spicelib/devices/bsim1/b1disto.c @@ -46,11 +46,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the B1 models */ -for( ; model != NULL; model = model->B1nextModel ) { +for( ; model != NULL; model = B1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B1instances; here != NULL ; - here=here->B1nextInstance) { + for (here = B1instances(model); here != NULL ; + here=B1nextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/bsim1/b1dset.c b/src/spicelib/devices/bsim1/b1dset.c index 820e555cb..89bab068c 100644 --- a/src/spicelib/devices/bsim1/b1dset.c +++ b/src/spicelib/devices/bsim1/b1dset.c @@ -125,11 +125,11 @@ B1dSetup(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the B1 device models */ - for( ; model != NULL; model = model->B1nextModel ) { + for( ; model != NULL; model = B1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B1instances; here != NULL ; - here=here->B1nextInstance) { + for (here = B1instances(model); here != NULL ; + here=B1nextInstance(here)) { EffectiveLength=here->B1l - model->B1deltaL * 1.e-6;/* m */ DrainArea = here->B1m * here->B1drainArea; diff --git a/src/spicelib/devices/bsim1/b1getic.c b/src/spicelib/devices/bsim1/b1getic.c index 71e073c82..0c27248f9 100644 --- a/src/spicelib/devices/bsim1/b1getic.c +++ b/src/spicelib/devices/bsim1/b1getic.c @@ -23,8 +23,8 @@ B1getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->B1nextModel) { - for(here = model->B1instances; here ; here = here->B1nextInstance) { + for( ; model ; model = B1nextModel(model)) { + for(here = B1instances(model); here ; here = B1nextInstance(here)) { if(!here->B1icVBSGiven) { here->B1icVBS = diff --git a/src/spicelib/devices/bsim1/b1ld.c b/src/spicelib/devices/bsim1/b1ld.c index 049b1a336..bc8633b6c 100644 --- a/src/spicelib/devices/bsim1/b1ld.c +++ b/src/spicelib/devices/bsim1/b1ld.c @@ -129,11 +129,11 @@ B1load(GENmodel *inModel, CKTcircuit *ckt) double m; /* parallel multiplier */ /* loop through all the B1 device models */ - for( ; model != NULL; model = model->B1nextModel ) { + for( ; model != NULL; model = B1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B1instances; here != NULL ; - here=here->B1nextInstance) { + for (here = B1instances(model); here != NULL ; + here=B1nextInstance(here)) { EffectiveLength=here->B1l - model->B1deltaL * 1.e-6;/* m */ DrainArea = here->B1drainArea; diff --git a/src/spicelib/devices/bsim1/b1noi.c b/src/spicelib/devices/bsim1/b1noi.c index 6b66b4f58..f79b1bade 100644 --- a/src/spicelib/devices/bsim1/b1noi.c +++ b/src/spicelib/devices/bsim1/b1noi.c @@ -45,8 +45,8 @@ B1noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->B1nextModel) { - for (inst=model->B1instances; inst != NULL; inst=inst->B1nextInstance) { + for (model=firstModel; model != NULL; model=B1nextModel(model)) { + for (inst=B1instances(model); inst != NULL; inst=B1nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/bsim1/b1pzld.c b/src/spicelib/devices/bsim1/b1pzld.c index d97a7b848..4cf41458d 100644 --- a/src/spicelib/devices/bsim1/b1pzld.c +++ b/src/spicelib/devices/bsim1/b1pzld.c @@ -53,9 +53,9 @@ B1pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double m; - for( ; model != NULL; model = model->B1nextModel) { - for(here = model->B1instances; here!= NULL; - here = here->B1nextInstance) { + for( ; model != NULL; model = B1nextModel(model)) { + for(here = B1instances(model); here!= NULL; + here = B1nextInstance(here)) { if (here->B1mode >= 0) { xnrm=1; diff --git a/src/spicelib/devices/bsim1/b1set.c b/src/spicelib/devices/bsim1/b1set.c index 58d1f2e41..af910fe7b 100644 --- a/src/spicelib/devices/bsim1/b1set.c +++ b/src/spicelib/devices/bsim1/b1set.c @@ -25,7 +25,7 @@ B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, CKTnode *tmp; /* loop through all the B1 device models */ - for( ; model != NULL; model = model->B1nextModel ) { + for( ; model != NULL; model = B1nextModel(model)) { /* Default value Processing for B1 MOSFET Models */ if( ! model->B1typeGiven) { @@ -270,8 +270,8 @@ B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, } /* loop through all the instances of the model */ - for (here = model->B1instances; here != NULL ; - here=here->B1nextInstance) { + for (here = B1instances(model); here != NULL ; + here=B1nextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -407,10 +407,10 @@ B1unsetup(GENmodel *inModel, CKTcircuit *ckt) B1instance *here; for (model = (B1model *)inModel; model != NULL; - model = model->B1nextModel) + model = B1nextModel(model)) { - for (here = model->B1instances; here != NULL; - here=here->B1nextInstance) + for (here = B1instances(model); here != NULL; + here=B1nextInstance(here)) { if (here->B1sNodePrime > 0 && here->B1sNodePrime != here->B1sNode) diff --git a/src/spicelib/devices/bsim1/b1temp.c b/src/spicelib/devices/bsim1/b1temp.c index 82415e5b2..167801ae1 100644 --- a/src/spicelib/devices/bsim1/b1temp.c +++ b/src/spicelib/devices/bsim1/b1temp.c @@ -30,7 +30,7 @@ B1temp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the B1 device models */ - for( ; model != NULL; model = model->B1nextModel ) { + for( ; model != NULL; model = B1nextModel(model)) { /* Default value Processing for B1 MOSFET Models */ /* Some Limiting for Model Parameters */ @@ -45,8 +45,8 @@ B1temp(GENmodel *inModel, CKTcircuit *ckt) model->B1Cox = Cox; /* unit: F/cm**2 */ /* loop through all the instances of the model */ - for (here = model->B1instances; here != NULL ; - here=here->B1nextInstance) { + for (here = B1instances(model); here != NULL ; + here=B1nextInstance(here)) { if( (EffChanLength = here->B1l - model->B1deltaL *1e-6 )<=0) { SPfrontEnd->IFerrorf (ERR_FATAL, diff --git a/src/spicelib/devices/bsim1/b1trunc.c b/src/spicelib/devices/bsim1/b1trunc.c index 148cc6040..114d6e0c4 100644 --- a/src/spicelib/devices/bsim1/b1trunc.c +++ b/src/spicelib/devices/bsim1/b1trunc.c @@ -19,8 +19,8 @@ B1trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) double debugtemp; #endif /* STEPDEBUG */ - for( ; model != NULL; model = model->B1nextModel) { - for(here=model->B1instances;here!=NULL;here = here->B1nextInstance){ + for( ; model != NULL; model = B1nextModel(model)) { + for(here=B1instances(model);here!=NULL;here = B1nextInstance(here)){ #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsim2/b2acld.c b/src/spicelib/devices/bsim2/b2acld.c index 1ba8a314d..5368feece 100644 --- a/src/spicelib/devices/bsim2/b2acld.c +++ b/src/spicelib/devices/bsim2/b2acld.c @@ -54,9 +54,9 @@ B2acLoad(GENmodel *inModel, CKTcircuit *ckt) double m; /* parallel multiplier */ omega = ckt->CKTomega; - for( ; model != NULL; model = model->B2nextModel) { - for(here = model->B2instances; here!= NULL; - here = here->B2nextInstance) { + for( ; model != NULL; model = B2nextModel(model)) { + for(here = B2instances(model); here!= NULL; + here = B2nextInstance(here)) { if (here->B2mode >= 0) { xnrm=1; diff --git a/src/spicelib/devices/bsim2/b2cvtest.c b/src/spicelib/devices/bsim2/b2cvtest.c index 4b896960a..5ebb0b2f9 100644 --- a/src/spicelib/devices/bsim2/b2cvtest.c +++ b/src/spicelib/devices/bsim2/b2cvtest.c @@ -41,11 +41,11 @@ B2convTest(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the B2 device models */ - for( ; model != NULL; model = model->B2nextModel ) { + for( ; model != NULL; model = B2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B2instances; here != NULL ; - here=here->B2nextInstance) { + for (here = B2instances(model); here != NULL ; + here=B2nextInstance(here)) { vbs = model->B2type * ( *(ckt->CKTrhsOld+here->B2bNode) - diff --git a/src/spicelib/devices/bsim2/b2getic.c b/src/spicelib/devices/bsim2/b2getic.c index 9b9fca5e9..7edf25c6a 100644 --- a/src/spicelib/devices/bsim2/b2getic.c +++ b/src/spicelib/devices/bsim2/b2getic.c @@ -23,8 +23,8 @@ B2getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->B2nextModel) { - for(here = model->B2instances; here ; here = here->B2nextInstance) { + for( ; model ; model = B2nextModel(model)) { + for(here = B2instances(model); here ; here = B2nextInstance(here)) { if(!here->B2icVBSGiven) { here->B2icVBS = diff --git a/src/spicelib/devices/bsim2/b2ld.c b/src/spicelib/devices/bsim2/b2ld.c index 1dca6b163..a84bdf671 100644 --- a/src/spicelib/devices/bsim2/b2ld.c +++ b/src/spicelib/devices/bsim2/b2ld.c @@ -130,11 +130,11 @@ B2load(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the B2 device models */ - for( ; model != NULL; model = model->B2nextModel ) { + for( ; model != NULL; model = B2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B2instances; here != NULL ; - here=here->B2nextInstance) { + for (here = B2instances(model); here != NULL ; + here=B2nextInstance(here)) { EffectiveLength=here->B2l - model->B2deltaL * 1.e-6;/* m */ DrainArea = here->B2drainArea; diff --git a/src/spicelib/devices/bsim2/b2noi.c b/src/spicelib/devices/bsim2/b2noi.c index 7ff1ac9f1..45df28ae0 100644 --- a/src/spicelib/devices/bsim2/b2noi.c +++ b/src/spicelib/devices/bsim2/b2noi.c @@ -45,8 +45,8 @@ B2noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->B2nextModel) { - for (inst=model->B2instances; inst != NULL; inst=inst->B2nextInstance) { + for (model=firstModel; model != NULL; model=B2nextModel(model)) { + for (inst=B2instances(model); inst != NULL; inst=B2nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/bsim2/b2pzld.c b/src/spicelib/devices/bsim2/b2pzld.c index 6ee62b96c..e0b75eea5 100644 --- a/src/spicelib/devices/bsim2/b2pzld.c +++ b/src/spicelib/devices/bsim2/b2pzld.c @@ -53,9 +53,9 @@ B2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double m; - for( ; model != NULL; model = model->B2nextModel) { - for(here = model->B2instances; here!= NULL; - here = here->B2nextInstance) { + for( ; model != NULL; model = B2nextModel(model)) { + for(here = B2instances(model); here!= NULL; + here = B2nextInstance(here)) { if (here->B2mode >= 0) { xnrm=1; diff --git a/src/spicelib/devices/bsim2/b2set.c b/src/spicelib/devices/bsim2/b2set.c index 9f3895234..c868d4811 100644 --- a/src/spicelib/devices/bsim2/b2set.c +++ b/src/spicelib/devices/bsim2/b2set.c @@ -24,7 +24,7 @@ B2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the B2 device models */ - for( ; model != NULL; model = model->B2nextModel ) { + for( ; model != NULL; model = B2nextModel(model)) { /* Default value Processing for B2 MOSFET Models */ if( ! model->B2typeGiven) { @@ -431,8 +431,8 @@ B2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->B2instances; here != NULL ; - here=here->B2nextInstance) { + for (here = B2instances(model); here != NULL ; + here=B2nextInstance(here)) { /* allocate a chunk of the state vector */ here->B2states = *states; @@ -576,10 +576,10 @@ B2unsetup( B2instance *here; for (model = (B2model *)inModel; model != NULL; - model = model->B2nextModel) + model = B2nextModel(model)) { - for (here = model->B2instances; here != NULL; - here=here->B2nextInstance) + for (here = B2instances(model); here != NULL; + here=B2nextInstance(here)) { if (here->B2sNodePrime > 0 && here->B2sNodePrime != here->B2sNode) diff --git a/src/spicelib/devices/bsim2/b2temp.c b/src/spicelib/devices/bsim2/b2temp.c index 0d45b121b..6f1c826c7 100644 --- a/src/spicelib/devices/bsim2/b2temp.c +++ b/src/spicelib/devices/bsim2/b2temp.c @@ -30,7 +30,7 @@ B2temp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the B2 device models */ - for( ; model != NULL; model = model->B2nextModel ) { + for( ; model != NULL; model = B2nextModel(model)) { /* Default value Processing for B2 MOSFET Models */ /* Some Limiting for Model Parameters */ @@ -50,8 +50,8 @@ B2temp(GENmodel *inModel, CKTcircuit *ckt) pLastKnot = NULL; /* loop through all the instances of the model */ - for (here = model->B2instances; here != NULL ; - here=here->B2nextInstance) { + for (here = B2instances(model); here != NULL ; + here=B2nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim2/b2trunc.c b/src/spicelib/devices/bsim2/b2trunc.c index bb186089e..1f25f30e0 100644 --- a/src/spicelib/devices/bsim2/b2trunc.c +++ b/src/spicelib/devices/bsim2/b2trunc.c @@ -18,8 +18,8 @@ B2trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) double debugtemp; #endif /* STEPDEBUG */ - for( ; model != NULL; model = model->B2nextModel) { - for(here=model->B2instances;here!=NULL;here = here->B2nextInstance){ + for( ; model != NULL; model = B2nextModel(model)) { + for(here=B2instances(model);here!=NULL;here = B2nextInstance(here)){ #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsim3/b3acld.c b/src/spicelib/devices/bsim3/b3acld.c index b2fe4590c..508ea0c60 100644 --- a/src/spicelib/devices/bsim3/b3acld.c +++ b/src/spicelib/devices/bsim3/b3acld.c @@ -43,9 +43,9 @@ double xcsbbi, xcggbi, xcgdbi, xcgsbi, xcgbbi; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM3nextModel) - { for (here = model->BSIM3instances; here!= NULL; - here = here->BSIM3nextInstance) + for (; model != NULL; model = BSIM3nextModel(model)) + { for (here = BSIM3instances(model); here!= NULL; + here = BSIM3nextInstance(here)) { Csd = -(here->BSIM3cddb + here->BSIM3cgdb + here->BSIM3cbdb); Csg = -(here->BSIM3cdgb + here->BSIM3cggb + here->BSIM3cbgb); diff --git a/src/spicelib/devices/bsim3/b3cvtest.c b/src/spicelib/devices/bsim3/b3cvtest.c index ee22a8a21..d8bab342e 100644 --- a/src/spicelib/devices/bsim3/b3cvtest.c +++ b/src/spicelib/devices/bsim3/b3cvtest.c @@ -29,10 +29,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the BSIM3 device models */ - for (; model != NULL; model = model->BSIM3nextModel) + for (; model != NULL; model = BSIM3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3instances; here != NULL ; - here=here->BSIM3nextInstance) + for (here = BSIM3instances(model); here != NULL ; + here=BSIM3nextInstance(here)) { vbs = model->BSIM3type * (*(ckt->CKTrhsOld+here->BSIM3bNode) diff --git a/src/spicelib/devices/bsim3/b3getic.c b/src/spicelib/devices/bsim3/b3getic.c index 6bec0e56b..00467f176 100644 --- a/src/spicelib/devices/bsim3/b3getic.c +++ b/src/spicelib/devices/bsim3/b3getic.c @@ -23,8 +23,8 @@ CKTcircuit *ckt) BSIM3model *model = (BSIM3model*)inModel; BSIM3instance *here; - for (; model ; model = model->BSIM3nextModel) - { for (here = model->BSIM3instances; here; here = here->BSIM3nextInstance) + for (; model ; model = BSIM3nextModel(model)) + { for (here = BSIM3instances(model); here; here = BSIM3nextInstance(here)) { if (!here->BSIM3icVBSGiven) { here->BSIM3icVBS = *(ckt->CKTrhs + here->BSIM3bNode) diff --git a/src/spicelib/devices/bsim3/b3ld.c b/src/spicelib/devices/bsim3/b3ld.c index 8f55f0a0a..c85c990c4 100644 --- a/src/spicelib/devices/bsim3/b3ld.c +++ b/src/spicelib/devices/bsim3/b3ld.c @@ -65,7 +65,7 @@ CKTcircuit *ckt) int BSIM3LoadOMP(BSIM3instance *here, CKTcircuit *ckt) { -BSIM3model *model = here->BSIM3modPtr; +BSIM3model *model = BSIM3modPtr(here); #else BSIM3model *model = (BSIM3model*)inModel; BSIM3instance *here; @@ -179,9 +179,9 @@ ChargeComputationNeeded = ((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC))) ? 1 : 0; #ifndef USE_OMP -for (; model != NULL; model = model->BSIM3nextModel) -{ for (here = model->BSIM3instances; here != NULL; - here = here->BSIM3nextInstance) +for (; model != NULL; model = BSIM3nextModel(model)) +{ for (here = BSIM3instances(model); here != NULL; + here = BSIM3nextInstance(here)) { #endif Check = 1; @@ -3136,7 +3136,7 @@ void BSIM3LoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for(idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->BSIM3modPtr; + model = BSIM3modPtr(here); /* Update b for Ax = b */ (*(ckt->CKTrhs + here->BSIM3gNode) -= here->BSIM3rhsG); (*(ckt->CKTrhs + here->BSIM3bNode) -= here->BSIM3rhsB); diff --git a/src/spicelib/devices/bsim3/b3noi.c b/src/spicelib/devices/bsim3/b3noi.c index f38db144e..6d1edfb06 100644 --- a/src/spicelib/devices/bsim3/b3noi.c +++ b/src/spicelib/devices/bsim3/b3noi.c @@ -139,9 +139,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM3nextModel) - { for (here = model->BSIM3instances; here != NULL; - here = here->BSIM3nextInstance) + for (; model != NULL; model = BSIM3nextModel(model)) + { for (here = BSIM3instances(model); here != NULL; + here = BSIM3nextInstance(here)) { pParam = here->pParam; switch (operation) { case N_OPEN: diff --git a/src/spicelib/devices/bsim3/b3pzld.c b/src/spicelib/devices/bsim3/b3pzld.c index b5fcb35a0..32343cee7 100644 --- a/src/spicelib/devices/bsim3/b3pzld.c +++ b/src/spicelib/devices/bsim3/b3pzld.c @@ -37,9 +37,9 @@ double T1, CoxWL, qcheq, Cdg, Cdd, Cds, Csg, Csd, Css; double ScalingFactor = 1.0e-9; double m; - for (; model != NULL; model = model->BSIM3nextModel) - { for (here = model->BSIM3instances; here!= NULL; - here = here->BSIM3nextInstance) + for (; model != NULL; model = BSIM3nextModel(model)) + { for (here = BSIM3instances(model); here!= NULL; + here = BSIM3nextInstance(here)) { if (here->BSIM3mode >= 0) { Gm = here->BSIM3gm; diff --git a/src/spicelib/devices/bsim3/b3set.c b/src/spicelib/devices/bsim3/b3set.c index d4be61cbc..3480b47ee 100644 --- a/src/spicelib/devices/bsim3/b3set.c +++ b/src/spicelib/devices/bsim3/b3set.c @@ -49,7 +49,7 @@ BSIM3instance **InstArray; /* loop through all the BSIM3 device models */ - for( ; model != NULL; model = model->BSIM3nextModel ) + for( ; model != NULL; model = BSIM3nextModel(model)) { /* Default value Processing for BSIM3 MOSFET Models */ if (!model->BSIM3typeGiven) @@ -920,8 +920,8 @@ BSIM3instance **InstArray; model->BSIM3vbdrMax = 1e99; /* loop through all the instances of the model */ - for (here = model->BSIM3instances; here != NULL ; - here=here->BSIM3nextInstance) + for (here = BSIM3instances(model); here != NULL ; + here=BSIM3nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM3states = *states; @@ -1129,11 +1129,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ /* loop through all the BSIM3 device models to count the number of instances */ - for( ; model != NULL; model = model->BSIM3nextModel ) + for( ; model != NULL; model = BSIM3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3instances; here != NULL ; - here=here->BSIM3nextInstance) + for (here = BSIM3instances(model); here != NULL ; + here=BSIM3nextInstance(here)) { InstCount++; } @@ -1146,11 +1146,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ model->BSIM3InstCount = InstCount; model->BSIM3InstanceArray = InstArray; idx = 0; - for( ; model != NULL; model = model->BSIM3nextModel ) + for( ; model != NULL; model = BSIM3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3instances; here != NULL ; - here=here->BSIM3nextInstance) + for (here = BSIM3instances(model); here != NULL ; + here=BSIM3nextInstance(here)) { InstArray[idx] = here; idx++; @@ -1170,10 +1170,10 @@ BSIM3unsetup( BSIM3instance *here; for (model = (BSIM3model *)inModel; model != NULL; - model = model->BSIM3nextModel) + model = BSIM3nextModel(model)) { - for (here = model->BSIM3instances; here != NULL; - here=here->BSIM3nextInstance) + for (here = BSIM3instances(model); here != NULL; + here=BSIM3nextInstance(here)) { if (here->BSIM3qNode > 0) CKTdltNNum(ckt, here->BSIM3qNode); diff --git a/src/spicelib/devices/bsim3/b3soachk.c b/src/spicelib/devices/bsim3/b3soachk.c index 53d43467e..324715b7d 100644 --- a/src/spicelib/devices/bsim3/b3soachk.c +++ b/src/spicelib/devices/bsim3/b3soachk.c @@ -33,9 +33,9 @@ BSIM3soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->BSIM3nextModel) { + for (; model; model = BSIM3nextModel(model)) { - for (here = model->BSIM3instances; here; here = here->BSIM3nextInstance) { + for (here = BSIM3instances(model); here; here = BSIM3nextInstance(here)) { vgs = ckt->CKTrhsOld [here->BSIM3gNode] - ckt->CKTrhsOld [here->BSIM3sNodePrime]; diff --git a/src/spicelib/devices/bsim3/b3temp.c b/src/spicelib/devices/bsim3/b3temp.c index af20b4e3d..19bd337f5 100644 --- a/src/spicelib/devices/bsim3/b3temp.c +++ b/src/spicelib/devices/bsim3/b3temp.c @@ -44,7 +44,7 @@ double Nvtm, SourceSatCurrent, DrainSatCurrent; int Size_Not_Found, error; /* loop through all the BSIM3 device models */ - for (; model != NULL; model = model->BSIM3nextModel) + for (; model != NULL; model = BSIM3nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM3bulkJctPotential < 0.1) { model->BSIM3bulkJctPotential = 0.1; @@ -143,8 +143,8 @@ int Size_Not_Found, error; /* loop through all the instances of the model */ /* MCJ: Length and Width not initialized */ - for (here = model->BSIM3instances; here != NULL; - here = here->BSIM3nextInstance) + for (here = BSIM3instances(model); here != NULL; + here = BSIM3nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim3/b3trunc.c b/src/spicelib/devices/bsim3/b3trunc.c index 75e6ede60..42c539665 100644 --- a/src/spicelib/devices/bsim3/b3trunc.c +++ b/src/spicelib/devices/bsim3/b3trunc.c @@ -28,9 +28,9 @@ BSIM3instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM3nextModel) - { for (here = model->BSIM3instances; here != NULL; - here = here->BSIM3nextInstance) + for (; model != NULL; model = BSIM3nextModel(model)) + { for (here = BSIM3instances(model); here != NULL; + here = BSIM3nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c b/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c index 38cffecbb..91f68efd7 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c @@ -48,11 +48,11 @@ FILE *fpdebug = NULL; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->B3SOIDDnextModel) + for (; model != NULL; model = B3SOIDDnextModel(model)) { - for (here = model->B3SOIDDinstances; here!= NULL; - here = here->B3SOIDDnextInstance) + for (here = B3SOIDDinstances(model); here!= NULL; + here = B3SOIDDnextInstance(here)) { selfheat = (model->B3SOIDDshMod == 1) && (here->B3SOIDDrth0 != 0.0); if (here->B3SOIDDdebugMod > 2) diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddcvtest.c b/src/spicelib/devices/bsim3soi_dd/b3soiddcvtest.c index 4f2ca4446..61ca19895 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddcvtest.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddcvtest.c @@ -29,10 +29,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the B3SOIDD device models */ - for (; model != NULL; model = model->B3SOIDDnextModel) + for (; model != NULL; model = B3SOIDDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B3SOIDDinstances; here != NULL ; - here=here->B3SOIDDnextInstance) + for (here = B3SOIDDinstances(model); here != NULL ; + here=B3SOIDDnextInstance(here)) { vbs = model->B3SOIDDtype * (*(ckt->CKTrhsOld+here->B3SOIDDbNode) diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddgetic.c b/src/spicelib/devices/bsim3soi_dd/b3soiddgetic.c index c46293f24..3cbf187a5 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddgetic.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddgetic.c @@ -23,8 +23,8 @@ B3SOIDDgetic(GENmodel *inModel, CKTcircuit *ckt) B3SOIDDmodel *model = (B3SOIDDmodel*)inModel; B3SOIDDinstance *here; - for (; model ; model = model->B3SOIDDnextModel) - { for (here = model->B3SOIDDinstances; here; here = here->B3SOIDDnextInstance) + for (; model ; model = B3SOIDDnextModel(model)) + { for (here = B3SOIDDinstances(model); here; here = B3SOIDDnextInstance(here)) { if(!here->B3SOIDDicVBSGiven) { here->B3SOIDDicVBS = *(ckt->CKTrhs + here->B3SOIDDbNode) diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddld.c b/src/spicelib/devices/bsim3soi_dd/b3soiddld.c index e7c401d25..388fc1aad 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddld.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddld.c @@ -304,9 +304,9 @@ char nanmessage [12]; double m; - for (; model != NULL; model = model->B3SOIDDnextModel) -{ for (here = model->B3SOIDDinstances; here != NULL; - here = here->B3SOIDDnextInstance) + for (; model != NULL; model = B3SOIDDnextModel(model)) +{ for (here = B3SOIDDinstances(model); here != NULL; + here = B3SOIDDnextInstance(here)) { Check = 0; ByPass = 0; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c b/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c index 41036ccdb..94c37df30 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c @@ -127,9 +127,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->B3SOIDDnextModel) - { for (here = model->B3SOIDDinstances; here != NULL; - here = here->B3SOIDDnextInstance) + for (; model != NULL; model = B3SOIDDnextModel(model)) + { for (here = B3SOIDDinstances(model); here != NULL; + here = B3SOIDDnextInstance(here)) { pParam = here->pParam; switch (operation) diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c b/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c index 16980a795..c2c02bfae 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c @@ -34,9 +34,9 @@ double m; NG_IGNORE(ckt); - for (; model != NULL; model = model->B3SOIDDnextModel) - { for (here = model->B3SOIDDinstances; here!= NULL; - here = here->B3SOIDDnextInstance) + for (; model != NULL; model = B3SOIDDnextModel(model)) + { for (here = B3SOIDDinstances(model); here!= NULL; + here = B3SOIDDnextInstance(here)) { if (here->B3SOIDDmode >= 0) { Gm = here->B3SOIDDgm; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddset.c b/src/spicelib/devices/bsim3soi_dd/b3soiddset.c index 069117c63..a9fc99367 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddset.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddset.c @@ -47,7 +47,7 @@ IFuid tmpName; /* loop through all the B3SOIDD device models */ - for( ; model != NULL; model = model->B3SOIDDnextModel ) + for( ; model != NULL; model = B3SOIDDnextModel(model)) { /* Default value Processing for B3SOIDD MOSFET Models */ @@ -874,8 +874,8 @@ IFuid tmpName; model->B3SOIDDnoif = 1.0; /* loop through all the instances of the model */ - for (here = model->B3SOIDDinstances; here != NULL ; - here=here->B3SOIDDnextInstance) + for (here = B3SOIDDinstances(model); here != NULL ; + here=B3SOIDDnextInstance(here)) { /* allocate a chunk of the state vector */ here->B3SOIDDstates = *states; @@ -1357,10 +1357,10 @@ B3SOIDDunsetup(GENmodel *inModel, CKTcircuit *ckt) B3SOIDDinstance *here; for (model = (B3SOIDDmodel *)inModel; model != NULL; - model = model->B3SOIDDnextModel) + model = B3SOIDDnextModel(model)) { - for (here = model->B3SOIDDinstances; here != NULL; - here=here->B3SOIDDnextInstance) + for (here = B3SOIDDinstances(model); here != NULL; + here=B3SOIDDnextInstance(here)) { /* here for debugging purpose only */ if (here->B3SOIDDdum5Node > 0) diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c b/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c index 148d3956b..2f49556ef 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c @@ -46,7 +46,7 @@ double SDphi, SDgamma; int Size_Not_Found; /* loop through all the B3SOIDD device models */ - for (; model != NULL; model = model->B3SOIDDnextModel) + for (; model != NULL; model = B3SOIDDnextModel(model)) { Temp = ckt->CKTtemp; if (model->B3SOIDDGatesidewallJctPotential < 0.1) model->B3SOIDDGatesidewallJctPotential = 0.1; @@ -72,8 +72,8 @@ int Size_Not_Found; /* loop through all the instances of the model */ /* MCJ: Length and Width not initialized */ - for (here = model->B3SOIDDinstances; here != NULL; - here = here->B3SOIDDnextInstance) + for (here = B3SOIDDinstances(model); here != NULL; + here = B3SOIDDnextInstance(here)) { here->B3SOIDDrbodyext = here->B3SOIDDbodySquares * model->B3SOIDDrbsh; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddtrunc.c b/src/spicelib/devices/bsim3soi_dd/b3soiddtrunc.c index a55c9923a..dd3750f73 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddtrunc.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddtrunc.c @@ -27,9 +27,9 @@ B3SOIDDinstance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->B3SOIDDnextModel) - { for (here = model->B3SOIDDinstances; here != NULL; - here = here->B3SOIDDnextInstance) + for (; model != NULL; model = B3SOIDDnextModel(model)) + { for (here = B3SOIDDinstances(model); here != NULL; + here = B3SOIDDnextInstance(here)) { #ifdef STEPDEBUG diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c b/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c index acb9bcc79..27d9aa87c 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c @@ -49,11 +49,11 @@ FILE *fpdebug = NULL; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->B3SOIFDnextModel) + for (; model != NULL; model = B3SOIFDnextModel(model)) { - for (here = model->B3SOIFDinstances; here!= NULL; - here = here->B3SOIFDnextInstance) + for (here = B3SOIFDinstances(model); here!= NULL; + here = B3SOIFDnextInstance(here)) { selfheat = (model->B3SOIFDshMod == 1) && (here->B3SOIFDrth0 != 0.0); if (here->B3SOIFDdebugMod > 2) diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdcvtest.c b/src/spicelib/devices/bsim3soi_fd/b3soifdcvtest.c index 00e95f3a7..6fa55b44f 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdcvtest.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdcvtest.c @@ -29,10 +29,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the B3SOIFD device models */ - for (; model != NULL; model = model->B3SOIFDnextModel) + for (; model != NULL; model = B3SOIFDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B3SOIFDinstances; here != NULL ; - here=here->B3SOIFDnextInstance) + for (here = B3SOIFDinstances(model); here != NULL ; + here=B3SOIFDnextInstance(here)) { vbs = model->B3SOIFDtype * (*(ckt->CKTrhsOld+here->B3SOIFDbNode) diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdgetic.c b/src/spicelib/devices/bsim3soi_fd/b3soifdgetic.c index 85e65b2e1..e9673aba7 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdgetic.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdgetic.c @@ -23,8 +23,8 @@ B3SOIFDgetic(GENmodel *inModel, CKTcircuit *ckt) B3SOIFDmodel *model = (B3SOIFDmodel*)inModel; B3SOIFDinstance *here; - for (; model ; model = model->B3SOIFDnextModel) - { for (here = model->B3SOIFDinstances; here; here = here->B3SOIFDnextInstance) + for (; model ; model = B3SOIFDnextModel(model)) + { for (here = B3SOIFDinstances(model); here; here = B3SOIFDnextInstance(here)) { if(!here->B3SOIFDicVBSGiven) { here->B3SOIFDicVBS = *(ckt->CKTrhs + here->B3SOIFDbNode) diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdld.c b/src/spicelib/devices/bsim3soi_fd/b3soifdld.c index cc1ca827f..8967217a5 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdld.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdld.c @@ -274,9 +274,9 @@ char nanmessage [12]; double m; -for (; model != NULL; model = model->B3SOIFDnextModel) -{ for (here = model->B3SOIFDinstances; here != NULL; - here = here->B3SOIFDnextInstance) +for (; model != NULL; model = B3SOIFDnextModel(model)) +{ for (here = B3SOIFDinstances(model); here != NULL; + here = B3SOIFDnextInstance(here)) { Check = 0; ByPass = 0; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c b/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c index 746f74f76..9af38e22f 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c @@ -127,9 +127,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->B3SOIFDnextModel) - { for (here = model->B3SOIFDinstances; here != NULL; - here = here->B3SOIFDnextInstance) + for (; model != NULL; model = B3SOIFDnextModel(model)) + { for (here = B3SOIFDinstances(model); here != NULL; + here = B3SOIFDnextInstance(here)) { pParam = here->pParam; switch (operation) diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c b/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c index 60b921680..152b2618d 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c @@ -33,9 +33,9 @@ double m; NG_IGNORE(ckt); - for (; model != NULL; model = model->B3SOIFDnextModel) - { for (here = model->B3SOIFDinstances; here!= NULL; - here = here->B3SOIFDnextInstance) + for (; model != NULL; model = B3SOIFDnextModel(model)) + { for (here = B3SOIFDinstances(model); here!= NULL; + here = B3SOIFDnextInstance(here)) { if (here->B3SOIFDmode >= 0) { Gm = here->B3SOIFDgm; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdset.c b/src/spicelib/devices/bsim3soi_fd/b3soifdset.c index feaa79db6..d6ee51654 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdset.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdset.c @@ -47,7 +47,7 @@ IFuid tmpName; /* loop through all the B3SOIFD device models */ - for( ; model != NULL; model = model->B3SOIFDnextModel ) + for( ; model != NULL; model = B3SOIFDnextModel(model)) { /* Default value Processing for B3SOIFD MOSFET Models */ @@ -875,8 +875,8 @@ IFuid tmpName; model->B3SOIFDnoif = 1.0; /* loop through all the instances of the model */ - for (here = model->B3SOIFDinstances; here != NULL ; - here=here->B3SOIFDnextInstance) + for (here = B3SOIFDinstances(model); here != NULL ; + here=B3SOIFDnextInstance(here)) { /* allocate a chunk of the state vector */ here->B3SOIFDstates = *states; @@ -1346,10 +1346,10 @@ B3SOIFDunsetup(GENmodel *inModel, CKTcircuit *ckt) B3SOIFDinstance *here; for (model = (B3SOIFDmodel *)inModel; model != NULL; - model = model->B3SOIFDnextModel) + model = B3SOIFDnextModel(model)) { - for (here = model->B3SOIFDinstances; here != NULL; - here=here->B3SOIFDnextInstance) + for (here = B3SOIFDinstances(model); here != NULL; + here=B3SOIFDnextInstance(here)) { /* here for debugging purpose only */ if (here->B3SOIFDdum5Node > 0) diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c b/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c index 09cd832c7..b1433d857 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c @@ -45,7 +45,7 @@ double SDphi, SDgamma; int Size_Not_Found; /* loop through all the B3SOIFD device models */ - for (; model != NULL; model = model->B3SOIFDnextModel) + for (; model != NULL; model = B3SOIFDnextModel(model)) { Temp = ckt->CKTtemp; if (model->B3SOIFDGatesidewallJctPotential < 0.1) model->B3SOIFDGatesidewallJctPotential = 0.1; @@ -71,8 +71,8 @@ int Size_Not_Found; /* loop through all the instances of the model */ /* MCJ: Length and Width not initialized */ - for (here = model->B3SOIFDinstances; here != NULL; - here = here->B3SOIFDnextInstance) + for (here = B3SOIFDinstances(model); here != NULL; + here = B3SOIFDnextInstance(here)) { here->B3SOIFDrbodyext = here->B3SOIFDbodySquares * model->B3SOIFDrbsh; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdtrunc.c b/src/spicelib/devices/bsim3soi_fd/b3soifdtrunc.c index cd7a7f0f5..46f575b4f 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdtrunc.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdtrunc.c @@ -27,9 +27,9 @@ B3SOIFDinstance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->B3SOIFDnextModel) - { for (here = model->B3SOIFDinstances; here != NULL; - here = here->B3SOIFDnextInstance) + for (; model != NULL; model = B3SOIFDnextModel(model)) + { for (here = B3SOIFDinstances(model); here != NULL; + here = B3SOIFDnextInstance(here)) { #ifdef STEPDEBUG diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c b/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c index b1f17d4ab..273db4294 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c @@ -49,11 +49,11 @@ double xcedb, xcesb; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->B3SOIPDnextModel) + for (; model != NULL; model = B3SOIPDnextModel(model)) { - for (here = model->B3SOIPDinstances; here!= NULL; - here = here->B3SOIPDnextInstance) + for (here = B3SOIPDinstances(model); here!= NULL; + here = B3SOIPDnextInstance(here)) { selfheat = (model->B3SOIPDshMod == 1) && (here->B3SOIPDrth0 != 0.0); if (here->B3SOIPDmode >= 0) diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdcvtest.c b/src/spicelib/devices/bsim3soi_pd/b3soipdcvtest.c index bb31f52fd..b12763c7a 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdcvtest.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdcvtest.c @@ -29,10 +29,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the B3SOIPD device models */ - for (; model != NULL; model = model->B3SOIPDnextModel) + for (; model != NULL; model = B3SOIPDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B3SOIPDinstances; here != NULL ; - here=here->B3SOIPDnextInstance) + for (here = B3SOIPDinstances(model); here != NULL ; + here=B3SOIPDnextInstance(here)) { vbs = model->B3SOIPDtype * (*(ckt->CKTrhsOld+here->B3SOIPDbNode) diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdgetic.c b/src/spicelib/devices/bsim3soi_pd/b3soipdgetic.c index 665c65ebb..b05507989 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdgetic.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdgetic.c @@ -23,8 +23,8 @@ B3SOIPDgetic(GENmodel *inModel, CKTcircuit *ckt) B3SOIPDmodel *model = (B3SOIPDmodel*)inModel; B3SOIPDinstance *here; - for (; model ; model = model->B3SOIPDnextModel) - { for (here = model->B3SOIPDinstances; here; here = here->B3SOIPDnextInstance) + for (; model ; model = B3SOIPDnextModel(model)) + { for (here = B3SOIPDinstances(model); here; here = B3SOIPDnextInstance(here)) { if(!here->B3SOIPDicVBSGiven) { here->B3SOIPDicVBS = *(ckt->CKTrhs + here->B3SOIPDbNode) diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdld.c b/src/spicelib/devices/bsim3soi_pd/b3soipdld.c index 996cfac93..65a6855cd 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdld.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdld.c @@ -291,9 +291,9 @@ double gigT; double m; -for (; model != NULL; model = model->B3SOIPDnextModel) -{ for (here = model->B3SOIPDinstances; here != NULL; - here = here->B3SOIPDnextInstance) +for (; model != NULL; model = B3SOIPDnextModel(model)) +{ for (here = B3SOIPDinstances(model); here != NULL; + here = B3SOIPDnextInstance(here)) { Check = 0; ByPass = 0; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c b/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c index 866b310a8..9aff8aeff 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c @@ -131,9 +131,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->B3SOIPDnextModel) - { for (here = model->B3SOIPDinstances; here != NULL; - here = here->B3SOIPDnextInstance) + for (; model != NULL; model = B3SOIPDnextModel(model)) + { for (here = B3SOIPDinstances(model); here != NULL; + here = B3SOIPDnextInstance(here)) { pParam = here->pParam; switch (operation) diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c b/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c index 99e2e4ea1..b2800435d 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c @@ -33,9 +33,9 @@ double m; NG_IGNORE(ckt); - for (; model != NULL; model = model->B3SOIPDnextModel) - { for (here = model->B3SOIPDinstances; here!= NULL; - here = here->B3SOIPDnextInstance) + for (; model != NULL; model = B3SOIPDnextModel(model)) + { for (here = B3SOIPDinstances(model); here!= NULL; + here = B3SOIPDnextInstance(here)) { if (here->B3SOIPDmode >= 0) { Gm = here->B3SOIPDgm; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdset.c b/src/spicelib/devices/bsim3soi_pd/b3soipdset.c index 674d2de97..9136e0289 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdset.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdset.c @@ -47,7 +47,7 @@ IFuid tmpName; /* loop through all the B3SOIPD device models */ - for( ; model != NULL; model = model->B3SOIPDnextModel ) + for( ; model != NULL; model = B3SOIPDnextModel(model)) { /* Default value Processing for B3SOIPD MOSFET Models */ @@ -1048,8 +1048,8 @@ IFuid tmpName; model->B3SOIPDnoif = 1.0; /* loop through all the instances of the model */ - for (here = model->B3SOIPDinstances; here != NULL ; - here=here->B3SOIPDnextInstance) + for (here = B3SOIPDinstances(model); here != NULL ; + here=B3SOIPDnextInstance(here)) { /* allocate a chunk of the state vector */ here->B3SOIPDstates = *states; @@ -1461,10 +1461,10 @@ B3SOIPDunsetup( B3SOIPDinstance *here; for (model = (B3SOIPDmodel *)inModel; model != NULL; - model = model->B3SOIPDnextModel) + model = B3SOIPDnextModel(model)) { - for (here = model->B3SOIPDinstances; here != NULL; - here=here->B3SOIPDnextInstance) + for (here = B3SOIPDinstances(model); here != NULL; + here=B3SOIPDnextInstance(here)) { /* here for debugging purpose only */ if (here->B3SOIPDqjdNode > 0) diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c b/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c index 305275603..0d4f15e16 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c @@ -64,7 +64,7 @@ double tmp3, T7; /* loop through all the B3SOIPD device models */ - for (; model != NULL; model = model->B3SOIPDnextModel) + for (; model != NULL; model = B3SOIPDnextModel(model)) { Temp = ckt->CKTtemp; if (model->B3SOIPDGatesidewallJctPotential < 0.1) model->B3SOIPDGatesidewallJctPotential = 0.1; @@ -90,8 +90,8 @@ double tmp3, T7; /* loop through all the instances of the model */ /* MCJ: Length and Width not initialized */ - for (here = model->B3SOIPDinstances; here != NULL; - here = here->B3SOIPDnextInstance) + for (here = B3SOIPDinstances(model); here != NULL; + here = B3SOIPDnextInstance(here)) { here->B3SOIPDrbodyext = here->B3SOIPDbodySquares * model->B3SOIPDrbsh; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdtrunc.c b/src/spicelib/devices/bsim3soi_pd/b3soipdtrunc.c index 84a3d46b9..2c90823da 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdtrunc.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdtrunc.c @@ -27,9 +27,9 @@ B3SOIPDinstance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->B3SOIPDnextModel) - { for (here = model->B3SOIPDinstances; here != NULL; - here = here->B3SOIPDnextInstance) + for (; model != NULL; model = B3SOIPDnextModel(model)) + { for (here = B3SOIPDinstances(model); here != NULL; + here = B3SOIPDnextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsim3v0/b3v0acld.c b/src/spicelib/devices/bsim3v0/b3v0acld.c index 2c55b5c17..3de6e2fd3 100644 --- a/src/spicelib/devices/bsim3v0/b3v0acld.c +++ b/src/spicelib/devices/bsim3v0/b3v0acld.c @@ -26,12 +26,12 @@ double dxpart, sxpart, cqgb, cqdb, cqsb, cqbb, xcqgb, xcqdb, xcqsb, xcqbb; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM3v0nextModel) + for (; model != NULL; model = BSIM3v0nextModel(model)) { - for (here = model->BSIM3v0instances; here!= NULL; - here = here->BSIM3v0nextInstance) + for (here = BSIM3v0instances(model); here!= NULL; + here = BSIM3v0nextInstance(here)) { if (here->BSIM3v0mode >= 0) { Gm = here->BSIM3v0gm; diff --git a/src/spicelib/devices/bsim3v0/b3v0cvtest.c b/src/spicelib/devices/bsim3v0/b3v0cvtest.c index fe5997f5e..5ba77179e 100644 --- a/src/spicelib/devices/bsim3v0/b3v0cvtest.c +++ b/src/spicelib/devices/bsim3v0/b3v0cvtest.c @@ -23,10 +23,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the BSIM3v0 device models */ - for (; model != NULL; model = model->BSIM3v0nextModel) + for (; model != NULL; model = BSIM3v0nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3v0instances; here != NULL ; - here=here->BSIM3v0nextInstance) + for (here = BSIM3v0instances(model); here != NULL ; + here=BSIM3v0nextInstance(here)) { vbs = model->BSIM3v0type * (*(ckt->CKTrhsOld+here->BSIM3v0bNode) diff --git a/src/spicelib/devices/bsim3v0/b3v0getic.c b/src/spicelib/devices/bsim3v0/b3v0getic.c index b4840a9f2..80bb26822 100644 --- a/src/spicelib/devices/bsim3v0/b3v0getic.c +++ b/src/spicelib/devices/bsim3v0/b3v0getic.c @@ -17,8 +17,8 @@ BSIM3v0getic(GENmodel *inModel, CKTcircuit *ckt) BSIM3v0model *model = (BSIM3v0model*)inModel; BSIM3v0instance *here; - for (; model ; model = model->BSIM3v0nextModel) - { for (here = model->BSIM3v0instances; here; here = here->BSIM3v0nextInstance) + for (; model ; model = BSIM3v0nextModel(model)) + { for (here = BSIM3v0instances(model); here; here = BSIM3v0nextInstance(here)) { if(!here->BSIM3v0icVBSGiven) { here->BSIM3v0icVBS = *(ckt->CKTrhs + here->BSIM3v0bNode) diff --git a/src/spicelib/devices/bsim3v0/b3v0ld.c b/src/spicelib/devices/bsim3v0/b3v0ld.c index be7cead62..668fd277c 100644 --- a/src/spicelib/devices/bsim3v0/b3v0ld.c +++ b/src/spicelib/devices/bsim3v0/b3v0ld.c @@ -119,9 +119,9 @@ struct bsim3v0SizeDependParam *pParam; int ByPass, Check, ChargeComputationNeeded = 0, error; double m = 1.0; -for (; model != NULL; model = model->BSIM3v0nextModel) -{ for (here = model->BSIM3v0instances; here != NULL; - here = here->BSIM3v0nextInstance) +for (; model != NULL; model = BSIM3v0nextModel(model)) +{ for (here = BSIM3v0instances(model); here != NULL; + here = BSIM3v0nextInstance(here)) { Check = 1; ByPass = 0; diff --git a/src/spicelib/devices/bsim3v0/b3v0noi.c b/src/spicelib/devices/bsim3v0/b3v0noi.c index d91bfe2d1..965ee6186 100644 --- a/src/spicelib/devices/bsim3v0/b3v0noi.c +++ b/src/spicelib/devices/bsim3v0/b3v0noi.c @@ -100,9 +100,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM3v0nextModel) - { for (here = model->BSIM3v0instances; here != NULL; - here = here->BSIM3v0nextInstance) + for (; model != NULL; model = BSIM3v0nextModel(model)) + { for (here = BSIM3v0instances(model); here != NULL; + here = BSIM3v0nextInstance(here)) { pParam = here->pParam; switch (operation) diff --git a/src/spicelib/devices/bsim3v0/b3v0pzld.c b/src/spicelib/devices/bsim3v0/b3v0pzld.c index db0b2e1f4..7a0e1e77c 100644 --- a/src/spicelib/devices/bsim3v0/b3v0pzld.c +++ b/src/spicelib/devices/bsim3v0/b3v0pzld.c @@ -26,9 +26,9 @@ double m; NG_IGNORE(ckt); - for (; model != NULL; model = model->BSIM3v0nextModel) - { for (here = model->BSIM3v0instances; here!= NULL; - here = here->BSIM3v0nextInstance) + for (; model != NULL; model = BSIM3v0nextModel(model)) + { for (here = BSIM3v0instances(model); here!= NULL; + here = BSIM3v0nextInstance(here)) { if (here->BSIM3v0mode >= 0) { Gm = here->BSIM3v0gm; diff --git a/src/spicelib/devices/bsim3v0/b3v0set.c b/src/spicelib/devices/bsim3v0/b3v0set.c index b0574396d..d518d0e24 100644 --- a/src/spicelib/devices/bsim3v0/b3v0set.c +++ b/src/spicelib/devices/bsim3v0/b3v0set.c @@ -35,7 +35,7 @@ CKTnode *tmpNode; IFuid tmpName; /* loop through all the BSIM3v0 device models */ - for( ; model != NULL; model = model->BSIM3v0nextModel ) + for( ; model != NULL; model = BSIM3v0nextModel(model)) { /* Default value Processing for BSIM3v0 MOSFET Models */ if (!model->BSIM3v0typeGiven) @@ -749,8 +749,8 @@ IFuid tmpName; if (!model->BSIM3v0kfGiven) model->BSIM3v0kf = 0.0; /* loop through all the instances of the model */ - for (here = model->BSIM3v0instances; here != NULL ; - here=here->BSIM3v0nextInstance) + for (here = BSIM3v0instances(model); here != NULL ; + here=BSIM3v0nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM3v0states = *states; @@ -899,10 +899,10 @@ BSIM3v0unsetup(GENmodel *inModel, CKTcircuit *ckt) BSIM3v0instance *here; for (model = (BSIM3v0model *)inModel; model != NULL; - model = model->BSIM3v0nextModel) + model = BSIM3v0nextModel(model)) { - for (here = model->BSIM3v0instances; here != NULL; - here=here->BSIM3v0nextInstance) + for (here = BSIM3v0instances(model); here != NULL; + here=BSIM3v0nextInstance(here)) { if (here->BSIM3v0qNode > 0) CKTdltNNum(ckt, here->BSIM3v0qNode); diff --git a/src/spicelib/devices/bsim3v0/b3v0temp.c b/src/spicelib/devices/bsim3v0/b3v0temp.c index 579289793..a5bab526d 100644 --- a/src/spicelib/devices/bsim3v0/b3v0temp.c +++ b/src/spicelib/devices/bsim3v0/b3v0temp.c @@ -36,7 +36,7 @@ double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; int Size_Not_Found; /* loop through all the BSIM3v0 device models */ - for (; model != NULL; model = model->BSIM3v0nextModel) + for (; model != NULL; model = BSIM3v0nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM3v0bulkJctPotential < 0.1) model->BSIM3v0bulkJctPotential = 0.1; @@ -49,8 +49,8 @@ int Size_Not_Found; TRatio = Temp / Tnom; /* loop through all the instances of the model */ - for (here = model->BSIM3v0instances; here != NULL; - here=here->BSIM3v0nextInstance) + for (here = BSIM3v0instances(model); here != NULL; + here=BSIM3v0nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim3v0/b3v0trunc.c b/src/spicelib/devices/bsim3v0/b3v0trunc.c index b06ae0ad0..0774f296f 100644 --- a/src/spicelib/devices/bsim3v0/b3v0trunc.c +++ b/src/spicelib/devices/bsim3v0/b3v0trunc.c @@ -21,9 +21,9 @@ BSIM3v0instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM3v0nextModel) - { for (here = model->BSIM3v0instances; here != NULL; - here = here->BSIM3v0nextInstance) + for (; model != NULL; model = BSIM3v0nextModel(model)) + { for (here = BSIM3v0instances(model); here != NULL; + here = BSIM3v0nextInstance(here)) { #ifdef STEPDEBUG diff --git a/src/spicelib/devices/bsim3v1/b3v1acld.c b/src/spicelib/devices/bsim3v1/b3v1acld.c index b60c780dd..3790d2453 100644 --- a/src/spicelib/devices/bsim3v1/b3v1acld.c +++ b/src/spicelib/devices/bsim3v1/b3v1acld.c @@ -32,12 +32,12 @@ BSIM3v1acLoad (GENmodel * inModel, CKTcircuit * ckt) double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM3v1nextModel) + for (; model != NULL; model = BSIM3v1nextModel(model)) { - for (here = model->BSIM3v1instances; here != NULL; - here = here->BSIM3v1nextInstance) + for (here = BSIM3v1instances(model); here != NULL; + here = BSIM3v1nextInstance(here)) { if (here->BSIM3v1mode >= 0) { diff --git a/src/spicelib/devices/bsim3v1/b3v1cvtest.c b/src/spicelib/devices/bsim3v1/b3v1cvtest.c index 201a7be39..9cbc13bfa 100644 --- a/src/spicelib/devices/bsim3v1/b3v1cvtest.c +++ b/src/spicelib/devices/bsim3v1/b3v1cvtest.c @@ -29,10 +29,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the BSIM3v1 device models */ - for (; model != NULL; model = model->BSIM3v1nextModel) + for (; model != NULL; model = BSIM3v1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3v1instances; here != NULL ; - here=here->BSIM3v1nextInstance) + for (here = BSIM3v1instances(model); here != NULL ; + here=BSIM3v1nextInstance(here)) { vbs = model->BSIM3v1type * (*(ckt->CKTrhsOld+here->BSIM3v1bNode) diff --git a/src/spicelib/devices/bsim3v1/b3v1getic.c b/src/spicelib/devices/bsim3v1/b3v1getic.c index 76a413607..e8d8a9ad9 100644 --- a/src/spicelib/devices/bsim3v1/b3v1getic.c +++ b/src/spicelib/devices/bsim3v1/b3v1getic.c @@ -23,8 +23,8 @@ BSIM3v1getic(GENmodel *inModel, CKTcircuit *ckt) BSIM3v1model *model = (BSIM3v1model*)inModel; BSIM3v1instance *here; - for (; model ; model = model->BSIM3v1nextModel) - { for (here = model->BSIM3v1instances; here; here = here->BSIM3v1nextInstance) + for (; model ; model = BSIM3v1nextModel(model)) + { for (here = BSIM3v1instances(model); here; here = BSIM3v1nextInstance(here)) { if(!here->BSIM3v1icVBSGiven) { here->BSIM3v1icVBS = *(ckt->CKTrhs + here->BSIM3v1bNode) diff --git a/src/spicelib/devices/bsim3v1/b3v1ld.c b/src/spicelib/devices/bsim3v1/b3v1ld.c index a83a784d0..4adc73e4a 100644 --- a/src/spicelib/devices/bsim3v1/b3v1ld.c +++ b/src/spicelib/devices/bsim3v1/b3v1ld.c @@ -125,9 +125,9 @@ double m = 1.0; struct bsim3v1SizeDependParam *pParam; int ByPass, Check, ChargeComputationNeeded = 0, error; -for (; model != NULL; model = model->BSIM3v1nextModel) -{ for (here = model->BSIM3v1instances; here != NULL; - here = here->BSIM3v1nextInstance) +for (; model != NULL; model = BSIM3v1nextModel(model)) +{ for (here = BSIM3v1instances(model); here != NULL; + here = BSIM3v1nextInstance(here)) { Check = 1; ByPass = 0; diff --git a/src/spicelib/devices/bsim3v1/b3v1noi.c b/src/spicelib/devices/bsim3v1/b3v1noi.c index 1ac3e8f5f..df950dd7a 100644 --- a/src/spicelib/devices/bsim3v1/b3v1noi.c +++ b/src/spicelib/devices/bsim3v1/b3v1noi.c @@ -123,9 +123,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM3v1nextModel) - { for (here = model->BSIM3v1instances; here != NULL; - here = here->BSIM3v1nextInstance) + for (; model != NULL; model = BSIM3v1nextModel(model)) + { for (here = BSIM3v1instances(model); here != NULL; + here = BSIM3v1nextInstance(here)) { pParam = here->pParam; switch (operation) diff --git a/src/spicelib/devices/bsim3v1/b3v1pzld.c b/src/spicelib/devices/bsim3v1/b3v1pzld.c index 19e41f8a1..d8989fbb0 100644 --- a/src/spicelib/devices/bsim3v1/b3v1pzld.c +++ b/src/spicelib/devices/bsim3v1/b3v1pzld.c @@ -32,9 +32,9 @@ double m; NG_IGNORE(ckt); - for (; model != NULL; model = model->BSIM3v1nextModel) - { for (here = model->BSIM3v1instances; here!= NULL; - here = here->BSIM3v1nextInstance) + for (; model != NULL; model = BSIM3v1nextModel(model)) + { for (here = BSIM3v1instances(model); here!= NULL; + here = BSIM3v1nextInstance(here)) { if (here->BSIM3v1mode >= 0) { Gm = here->BSIM3v1gm; diff --git a/src/spicelib/devices/bsim3v1/b3v1set.c b/src/spicelib/devices/bsim3v1/b3v1set.c index a1818084e..932a1ed47 100644 --- a/src/spicelib/devices/bsim3v1/b3v1set.c +++ b/src/spicelib/devices/bsim3v1/b3v1set.c @@ -41,7 +41,7 @@ CKTnode *tmpNode; IFuid tmpName; /* loop through all the BSIM3v1 device models */ - for( ; model != NULL; model = model->BSIM3v1nextModel ) + for( ; model != NULL; model = BSIM3v1nextModel(model)) { /* Default value Processing for BSIM3v1 MOSFET Models */ if (!model->BSIM3v1typeGiven) @@ -775,8 +775,8 @@ IFuid tmpName; if (!model->BSIM3v1kfGiven) model->BSIM3v1kf = 0.0; /* loop through all the instances of the model */ - for (here = model->BSIM3v1instances; here != NULL ; - here=here->BSIM3v1nextInstance) + for (here = BSIM3v1instances(model); here != NULL ; + here=BSIM3v1nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM3v1states = *states; @@ -959,10 +959,10 @@ BSIM3v1unsetup(GENmodel *inModel, CKTcircuit *ckt) BSIM3v1instance *here; for (model = (BSIM3v1model *)inModel; model != NULL; - model = model->BSIM3v1nextModel) + model = BSIM3v1nextModel(model)) { - for (here = model->BSIM3v1instances; here != NULL; - here=here->BSIM3v1nextInstance) + for (here = BSIM3v1instances(model); here != NULL; + here=BSIM3v1nextInstance(here)) { if (here->BSIM3v1qNode > 0) CKTdltNNum(ckt, here->BSIM3v1qNode); diff --git a/src/spicelib/devices/bsim3v1/b3v1temp.c b/src/spicelib/devices/bsim3v1/b3v1temp.c index 0a5e089d6..f8b0bc0d7 100644 --- a/src/spicelib/devices/bsim3v1/b3v1temp.c +++ b/src/spicelib/devices/bsim3v1/b3v1temp.c @@ -43,7 +43,7 @@ double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; int Size_Not_Found; /* loop through all the BSIM3v1 device models */ - for (; model != NULL; model = model->BSIM3v1nextModel) + for (; model != NULL; model = BSIM3v1nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM3v1bulkJctPotential < 0.1) model->BSIM3v1bulkJctPotential = 0.1; @@ -89,8 +89,8 @@ int Size_Not_Found; /* loop through all the instances of the model */ /* MCJ: Length and Width not initialized */ - for (here = model->BSIM3v1instances; here != NULL; - here = here->BSIM3v1nextInstance) + for (here = BSIM3v1instances(model); here != NULL; + here = BSIM3v1nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim3v1/b3v1trunc.c b/src/spicelib/devices/bsim3v1/b3v1trunc.c index e18e67111..80cae9be5 100644 --- a/src/spicelib/devices/bsim3v1/b3v1trunc.c +++ b/src/spicelib/devices/bsim3v1/b3v1trunc.c @@ -27,9 +27,9 @@ BSIM3v1instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM3v1nextModel) - { for (here = model->BSIM3v1instances; here != NULL; - here = here->BSIM3v1nextInstance) + for (; model != NULL; model = BSIM3v1nextModel(model)) + { for (here = BSIM3v1instances(model); here != NULL; + here = BSIM3v1nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsim3v32/b3v32acld.c b/src/spicelib/devices/bsim3v32/b3v32acld.c index e7870a4e5..ee9326940 100644 --- a/src/spicelib/devices/bsim3v32/b3v32acld.c +++ b/src/spicelib/devices/bsim3v32/b3v32acld.c @@ -36,9 +36,9 @@ double ScalingFactor = 1.0e-9; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM3v32nextModel) - { for (here = model->BSIM3v32instances; here!= NULL; - here = here->BSIM3v32nextInstance) + for (; model != NULL; model = BSIM3v32nextModel(model)) + { for (here = BSIM3v32instances(model); here!= NULL; + here = BSIM3v32nextInstance(here)) { if (here->BSIM3v32mode >= 0) { Gm = here->BSIM3v32gm; diff --git a/src/spicelib/devices/bsim3v32/b3v32ask.c b/src/spicelib/devices/bsim3v32/b3v32ask.c index aa85e5f11..2b057b77b 100644 --- a/src/spicelib/devices/bsim3v32/b3v32ask.c +++ b/src/spicelib/devices/bsim3v32/b3v32ask.c @@ -22,7 +22,7 @@ BSIM3v32ask (CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select) { BSIM3v32instance *here = (BSIM3v32instance*)inst; -BSIM3v32model *model = here->BSIM3v32modPtr; /* for lmlt */ +BSIM3v32model *model = BSIM3v32modPtr(here); /* for lmlt */ NG_IGNORE(select); diff --git a/src/spicelib/devices/bsim3v32/b3v32cvtest.c b/src/spicelib/devices/bsim3v32/b3v32cvtest.c index 8d0f717fe..0df873973 100644 --- a/src/spicelib/devices/bsim3v32/b3v32cvtest.c +++ b/src/spicelib/devices/bsim3v32/b3v32cvtest.c @@ -28,10 +28,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the BSIM3v32 device models */ - for (; model != NULL; model = model->BSIM3v32nextModel) + for (; model != NULL; model = BSIM3v32nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3v32instances; here != NULL ; - here=here->BSIM3v32nextInstance) + for (here = BSIM3v32instances(model); here != NULL ; + here=BSIM3v32nextInstance(here)) { vbs = model->BSIM3v32type * (*(ckt->CKTrhsOld+here->BSIM3v32bNode) diff --git a/src/spicelib/devices/bsim3v32/b3v32getic.c b/src/spicelib/devices/bsim3v32/b3v32getic.c index 5c7bab523..ccb47a93a 100644 --- a/src/spicelib/devices/bsim3v32/b3v32getic.c +++ b/src/spicelib/devices/bsim3v32/b3v32getic.c @@ -21,8 +21,8 @@ BSIM3v32getic (GENmodel *inModel, CKTcircuit *ckt) BSIM3v32model *model = (BSIM3v32model*)inModel; BSIM3v32instance *here; - for (; model ; model = model->BSIM3v32nextModel) - { for (here = model->BSIM3v32instances; here; here = here->BSIM3v32nextInstance) + for (; model ; model = BSIM3v32nextModel(model)) + { for (here = BSIM3v32instances(model); here; here = BSIM3v32nextInstance(here)) { if (!here->BSIM3v32icVBSGiven) { here->BSIM3v32icVBS = *(ckt->CKTrhs + here->BSIM3v32bNode) diff --git a/src/spicelib/devices/bsim3v32/b3v32ld.c b/src/spicelib/devices/bsim3v32/b3v32ld.c index 79e095b3a..19d8283b9 100644 --- a/src/spicelib/devices/bsim3v32/b3v32ld.c +++ b/src/spicelib/devices/bsim3v32/b3v32ld.c @@ -61,7 +61,7 @@ BSIM3v32load (GENmodel *inModel, CKTcircuit *ckt) int BSIM3v32LoadOMP(BSIM3v32instance *here, CKTcircuit *ckt) { - BSIM3v32model *model = here->BSIM3v32modPtr; + BSIM3v32model *model = BSIM3v32modPtr(here); #else BSIM3v32model *model = (BSIM3v32model*)inModel; BSIM3v32instance *here; @@ -171,9 +171,9 @@ ChargeComputationNeeded = ((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC))) ? 1 : 0; #ifndef USE_OMP -for (; model != NULL; model = model->BSIM3v32nextModel) -{ for (here = model->BSIM3v32instances; here != NULL; - here = here->BSIM3v32nextInstance) +for (; model != NULL; model = BSIM3v32nextModel(model)) +{ for (here = BSIM3v32instances(model); here != NULL; + here = BSIM3v32nextInstance(here)) { #endif Check = 1; @@ -3438,7 +3438,7 @@ void BSIM3v32LoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for (idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->BSIM3v32modPtr; + model = BSIM3v32modPtr(here); /* Update b for Ax = b */ (*(ckt->CKTrhs + here->BSIM3v32gNode) -= here->BSIM3v32rhsG); (*(ckt->CKTrhs + here->BSIM3v32bNode) -= here->BSIM3v32rhsB); diff --git a/src/spicelib/devices/bsim3v32/b3v32noi.c b/src/spicelib/devices/bsim3v32/b3v32noi.c index 07a8ca93f..dedcf957f 100644 --- a/src/spicelib/devices/bsim3v32/b3v32noi.c +++ b/src/spicelib/devices/bsim3v32/b3v32noi.c @@ -208,9 +208,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM3v32nextModel) - { for (here = model->BSIM3v32instances; here != NULL; - here = here->BSIM3v32nextInstance) + for (; model != NULL; model = BSIM3v32nextModel(model)) + { for (here = BSIM3v32instances(model); here != NULL; + here = BSIM3v32nextInstance(here)) { pParam = here->pParam; switch (operation) { case N_OPEN: diff --git a/src/spicelib/devices/bsim3v32/b3v32pzld.c b/src/spicelib/devices/bsim3v32/b3v32pzld.c index ddadb53af..dff705cc1 100644 --- a/src/spicelib/devices/bsim3v32/b3v32pzld.c +++ b/src/spicelib/devices/bsim3v32/b3v32pzld.c @@ -36,9 +36,9 @@ double T1, CoxWL, qcheq, Cdg, Cdd, Cds, Csg, Csd, Css; double ScalingFactor = 1.0e-9; double m; - for (; model != NULL; model = model->BSIM3v32nextModel) - { for (here = model->BSIM3v32instances; here!= NULL; - here = here->BSIM3v32nextInstance) + for (; model != NULL; model = BSIM3v32nextModel(model)) + { for (here = BSIM3v32instances(model); here!= NULL; + here = BSIM3v32nextInstance(here)) { if (here->BSIM3v32mode >= 0) { Gm = here->BSIM3v32gm; diff --git a/src/spicelib/devices/bsim3v32/b3v32set.c b/src/spicelib/devices/bsim3v32/b3v32set.c index 930add449..e0c0cd43a 100644 --- a/src/spicelib/devices/bsim3v32/b3v32set.c +++ b/src/spicelib/devices/bsim3v32/b3v32set.c @@ -45,7 +45,7 @@ BSIM3v32instance **InstArray; #endif /* loop through all the BSIM3v32 device models */ - for( ; model != NULL; model = model->BSIM3v32nextModel ) + for( ; model != NULL; model = BSIM3v32nextModel(model)) { /* Default value Processing for BSIM3v32 MOSFET Models */ if (!model->BSIM3v32typeGiven) @@ -936,8 +936,8 @@ BSIM3v32instance **InstArray; model->BSIM3v32vbdrMax = 1e99; /* loop through all the instances of the model */ - for (here = model->BSIM3v32instances; here != NULL ; - here=here->BSIM3v32nextInstance) + for (here = BSIM3v32instances(model); here != NULL ; + here=BSIM3v32nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM3v32states = *states; @@ -1141,11 +1141,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ /* loop through all the BSIM3 device models to count the number of instances */ - for (; model != NULL; model = model->BSIM3v32nextModel) + for (; model != NULL; model = BSIM3v32nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3v32instances; here != NULL; - here = here->BSIM3v32nextInstance) + for (here = BSIM3v32instances(model); here != NULL; + here = BSIM3v32nextInstance(here)) { InstCount++; } @@ -1158,11 +1158,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ model->BSIM3v32InstCount = InstCount; model->BSIM3v32InstanceArray = InstArray; idx = 0; - for (; model != NULL; model = model->BSIM3v32nextModel) + for (; model != NULL; model = BSIM3v32nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM3v32instances; here != NULL; - here = here->BSIM3v32nextInstance) + for (here = BSIM3v32instances(model); here != NULL; + here = BSIM3v32nextInstance(here)) { InstArray[idx] = here; idx++; @@ -1182,10 +1182,10 @@ BSIM3v32unsetup( BSIM3v32instance *here; for (model = (BSIM3v32model *)inModel; model != NULL; - model = model->BSIM3v32nextModel) + model = BSIM3v32nextModel(model)) { - for (here = model->BSIM3v32instances; here != NULL; - here=here->BSIM3v32nextInstance) + for (here = BSIM3v32instances(model); here != NULL; + here=BSIM3v32nextInstance(here)) { if (here->BSIM3v32qNode > 0) CKTdltNNum(ckt, here->BSIM3v32qNode); diff --git a/src/spicelib/devices/bsim3v32/b3v32soachk.c b/src/spicelib/devices/bsim3v32/b3v32soachk.c index a4bf39a8f..52ed26a74 100644 --- a/src/spicelib/devices/bsim3v32/b3v32soachk.c +++ b/src/spicelib/devices/bsim3v32/b3v32soachk.c @@ -33,9 +33,9 @@ BSIM3v32soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->BSIM3v32nextModel) { + for (; model; model = BSIM3v32nextModel(model)) { - for (here = model->BSIM3v32instances; here; here = here->BSIM3v32nextInstance) { + for (here = BSIM3v32instances(model); here; here = BSIM3v32nextInstance(here)) { vgs = ckt->CKTrhsOld [here->BSIM3v32gNode] - ckt->CKTrhsOld [here->BSIM3v32sNodePrime]; diff --git a/src/spicelib/devices/bsim3v32/b3v32temp.c b/src/spicelib/devices/bsim3v32/b3v32temp.c index 7725f69b3..e969c3087 100644 --- a/src/spicelib/devices/bsim3v32/b3v32temp.c +++ b/src/spicelib/devices/bsim3v32/b3v32temp.c @@ -41,7 +41,7 @@ double Nvtm, SourceSatCurrent, DrainSatCurrent; int Size_Not_Found, error; /* loop through all the BSIM3v32 device models */ - for (; model != NULL; model = model->BSIM3v32nextModel) + for (; model != NULL; model = BSIM3v32nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM3v32bulkJctPotential < 0.1) { model->BSIM3v32bulkJctPotential = 0.1; @@ -209,8 +209,8 @@ int Size_Not_Found, error; /* loop through all the instances of the model */ /* MCJ: Length and Width not initialized */ - for (here = model->BSIM3v32instances; here != NULL; - here = here->BSIM3v32nextInstance) + for (here = BSIM3v32instances(model); here != NULL; + here = BSIM3v32nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim3v32/b3v32trunc.c b/src/spicelib/devices/bsim3v32/b3v32trunc.c index 976377af6..af96b7969 100644 --- a/src/spicelib/devices/bsim3v32/b3v32trunc.c +++ b/src/spicelib/devices/bsim3v32/b3v32trunc.c @@ -26,9 +26,9 @@ BSIM3v32instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM3v32nextModel) - { for (here = model->BSIM3v32instances; here != NULL; - here = here->BSIM3v32nextInstance) + for (; model != NULL; model = BSIM3v32nextModel(model)) + { for (here = BSIM3v32instances(model); here != NULL; + here = BSIM3v32nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsim4/b4acld.c b/src/spicelib/devices/bsim4/b4acld.c index b7cd1eec9..40b59228d 100644 --- a/src/spicelib/devices/bsim4/b4acld.c +++ b/src/spicelib/devices/bsim4/b4acld.c @@ -104,9 +104,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM4nextModel) - { for (here = model->BSIM4instances; here!= NULL; - here = here->BSIM4nextInstance) + for (; model != NULL; model = BSIM4nextModel(model)) + { for (here = BSIM4instances(model); here!= NULL; + here = BSIM4nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4capbd; diff --git a/src/spicelib/devices/bsim4/b4cvtest.c b/src/spicelib/devices/bsim4/b4cvtest.c index 31d7f4d18..47551ed84 100644 --- a/src/spicelib/devices/bsim4/b4cvtest.c +++ b/src/spicelib/devices/bsim4/b4cvtest.c @@ -86,9 +86,9 @@ double Isestot, cseshat, Idedtot, cdedhat; double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; double tol0, tol1, tol2, tol3, tol4, tol5, tol6; - for (; model != NULL; model = model->BSIM4nextModel) - { for (here = model->BSIM4instances; here != NULL ; - here=here->BSIM4nextInstance) + for (; model != NULL; model = BSIM4nextModel(model)) + { for (here = BSIM4instances(model); here != NULL ; + here=BSIM4nextInstance(here)) { vds = model->BSIM4type * (*(ckt->CKTrhsOld + here->BSIM4dNodePrime) diff --git a/src/spicelib/devices/bsim4/b4getic.c b/src/spicelib/devices/bsim4/b4getic.c index 62b5b5529..2a42311fd 100644 --- a/src/spicelib/devices/bsim4/b4getic.c +++ b/src/spicelib/devices/bsim4/b4getic.c @@ -73,8 +73,8 @@ CKTcircuit *ckt) BSIM4model *model = (BSIM4model*)inModel; BSIM4instance *here; - for (; model ; model = model->BSIM4nextModel) - { for (here = model->BSIM4instances; here; here = here->BSIM4nextInstance) + for (; model ; model = BSIM4nextModel(model)) + { for (here = BSIM4instances(model); here; here = BSIM4nextInstance(here)) { if (!here->BSIM4icVDSGiven) { here->BSIM4icVDS = *(ckt->CKTrhs + here->BSIM4dNode) diff --git a/src/spicelib/devices/bsim4/b4ld.c b/src/spicelib/devices/bsim4/b4ld.c index 5c5651ced..ea1321033 100644 --- a/src/spicelib/devices/bsim4/b4ld.c +++ b/src/spicelib/devices/bsim4/b4ld.c @@ -131,7 +131,7 @@ CKTcircuit *ckt) int BSIM4LoadOMP(BSIM4instance *here, CKTcircuit *ckt) { -BSIM4model *model = here->BSIM4modPtr; +BSIM4model *model = BSIM4modPtr(here); #else BSIM4model *model = (BSIM4model*)inModel; BSIM4instance *here; @@ -286,9 +286,9 @@ ChargeComputationNeeded = ? 1 : 0; #ifndef USE_OMP -for (; model != NULL; model = model->BSIM4nextModel) -{ for (here = model->BSIM4instances; here != NULL; - here = here->BSIM4nextInstance) +for (; model != NULL; model = BSIM4nextModel(model)) +{ for (here = BSIM4instances(model); here != NULL; + here = BSIM4nextInstance(here)) { #endif @@ -5456,7 +5456,7 @@ void BSIM4LoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for(idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->BSIM4modPtr; + model = BSIM4modPtr(here); /* Update b for Ax = b */ (*(ckt->CKTrhs + here->BSIM4dNodePrime) += here->BSIM4rhsdPrime); (*(ckt->CKTrhs + here->BSIM4gNodePrime) -= here->BSIM4rhsgPrime); diff --git a/src/spicelib/devices/bsim4/b4noi.c b/src/spicelib/devices/bsim4/b4noi.c index 5ef294244..816d0288d 100644 --- a/src/spicelib/devices/bsim4/b4noi.c +++ b/src/spicelib/devices/bsim4/b4noi.c @@ -168,14 +168,14 @@ double m; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM4nextModel) + for (; model != NULL; model = BSIM4nextModel(model)) { if(model->BSIM4tnoiMod != 2) { noizDens[BSIM4CORLNOIZ] = 0.0; lnNdens[BSIM4CORLNOIZ] = N_MINLOG; } - for (here = model->BSIM4instances; here != NULL; - here = here->BSIM4nextInstance) + for (here = BSIM4instances(model); here != NULL; + here = BSIM4nextInstance(here)) { pParam = here->pParam; switch (operation) { case N_OPEN: diff --git a/src/spicelib/devices/bsim4/b4pzld.c b/src/spicelib/devices/bsim4/b4pzld.c index 744e3bcfe..379d7cd1e 100644 --- a/src/spicelib/devices/bsim4/b4pzld.c +++ b/src/spicelib/devices/bsim4/b4pzld.c @@ -99,9 +99,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; - for (; model != NULL; model = model->BSIM4nextModel) - { for (here = model->BSIM4instances; here!= NULL; - here = here->BSIM4nextInstance) + for (; model != NULL; model = BSIM4nextModel(model)) + { for (here = BSIM4instances(model); here!= NULL; + here = BSIM4nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4capbd; diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index 94c70f2a2..01d16d8a4 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -109,7 +109,7 @@ BSIM4instance **InstArray; } /* loop through all the BSIM4 device models */ - for( ; model != NULL; model = model->BSIM4nextModel ) + for( ; model != NULL; model = BSIM4nextModel(model)) { /* process defaults of model parameters */ if (!model->BSIM4typeGiven) model->BSIM4type = NMOS; @@ -2335,8 +2335,8 @@ BSIM4instance **InstArray; * through all the instances of the model */ - for (here = model->BSIM4instances; here != NULL ; - here=here->BSIM4nextInstance) + for (here = BSIM4instances(model); here != NULL ; + here=BSIM4nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM4states = *states; @@ -2720,11 +2720,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL /* loop through all the BSIM4 device models to count the number of instances */ - for( ; model != NULL; model = model->BSIM4nextModel ) + for( ; model != NULL; model = BSIM4nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4instances; here != NULL ; - here=here->BSIM4nextInstance) + for (here = BSIM4instances(model); here != NULL ; + here=BSIM4nextInstance(here)) { InstCount++; } @@ -2737,11 +2737,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL model->BSIM4InstCount = InstCount; model->BSIM4InstanceArray = InstArray; idx = 0; - for( ; model != NULL; model = model->BSIM4nextModel ) + for( ; model != NULL; model = BSIM4nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4instances; here != NULL ; - here=here->BSIM4nextInstance) + for (here = BSIM4instances(model); here != NULL ; + here=BSIM4nextInstance(here)) { InstArray[idx] = here; idx++; @@ -2762,10 +2762,10 @@ CKTcircuit *ckt) BSIM4instance *here; for (model = (BSIM4model *)inModel; model != NULL; - model = model->BSIM4nextModel) + model = BSIM4nextModel(model)) { - for (here = model->BSIM4instances; here != NULL; - here=here->BSIM4nextInstance) + for (here = BSIM4instances(model); here != NULL; + here=BSIM4nextInstance(here)) { if (here->BSIM4qNode > 0) CKTdltNNum(ckt, here->BSIM4qNode); diff --git a/src/spicelib/devices/bsim4/b4soachk.c b/src/spicelib/devices/bsim4/b4soachk.c index 6b7639878..8af08a64e 100644 --- a/src/spicelib/devices/bsim4/b4soachk.c +++ b/src/spicelib/devices/bsim4/b4soachk.c @@ -33,9 +33,9 @@ BSIM4soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->BSIM4nextModel) { + for (; model; model = BSIM4nextModel(model)) { - for (here = model->BSIM4instances; here; here = here->BSIM4nextInstance) { + for (here = BSIM4instances(model); here; here = BSIM4nextInstance(here)) { vgs = ckt->CKTrhsOld [here->BSIM4gNodePrime] - ckt->CKTrhsOld [here->BSIM4sNodePrime]; diff --git a/src/spicelib/devices/bsim4/b4temp.c b/src/spicelib/devices/bsim4/b4temp.c index 8d8ce3934..5c4cd12a1 100644 --- a/src/spicelib/devices/bsim4/b4temp.c +++ b/src/spicelib/devices/bsim4/b4temp.c @@ -128,7 +128,7 @@ double vtfbphi2eot, phieot, TempRatioeot, Vtm0eot, Vtmeot,vbieot; int Size_Not_Found, i; /* loop through all the BSIM4 device models */ - for (; model != NULL; model = model->BSIM4nextModel) + for (; model != NULL; model = BSIM4nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM4SbulkJctPotential < 0.1) { model->BSIM4SbulkJctPotential = 0.1; @@ -442,8 +442,8 @@ int Size_Not_Found, i; /* loop through all the instances of the model */ - for (here = model->BSIM4instances; here != NULL; - here = here->BSIM4nextInstance) + for (here = BSIM4instances(model); here != NULL; + here = BSIM4nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim4/b4trunc.c b/src/spicelib/devices/bsim4/b4trunc.c index 61d14a9e8..3d4ec53ba 100644 --- a/src/spicelib/devices/bsim4/b4trunc.c +++ b/src/spicelib/devices/bsim4/b4trunc.c @@ -78,9 +78,9 @@ BSIM4instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM4nextModel) - { for (here = model->BSIM4instances; here != NULL; - here = here->BSIM4nextInstance) + for (; model != NULL; model = BSIM4nextModel(model)) + { for (here = BSIM4instances(model); here != NULL; + here = BSIM4nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsim4v5/b4v5acld.c b/src/spicelib/devices/bsim4v5/b4v5acld.c index 76fa8e5b0..190e70b80 100644 --- a/src/spicelib/devices/bsim4v5/b4v5acld.c +++ b/src/spicelib/devices/bsim4v5/b4v5acld.c @@ -55,9 +55,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM4v5nextModel) - { for (here = model->BSIM4v5instances; here!= NULL; - here = here->BSIM4v5nextInstance) + for (; model != NULL; model = BSIM4v5nextModel(model)) + { for (here = BSIM4v5instances(model); here!= NULL; + here = BSIM4v5nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4v5capbd; diff --git a/src/spicelib/devices/bsim4v5/b4v5cvtest.c b/src/spicelib/devices/bsim4v5/b4v5cvtest.c index daebb4463..b807b57b6 100644 --- a/src/spicelib/devices/bsim4v5/b4v5cvtest.c +++ b/src/spicelib/devices/bsim4v5/b4v5cvtest.c @@ -39,9 +39,9 @@ double Isestot, cseshat, Idedtot, cdedhat; double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; double tol0, tol1, tol2, tol3, tol4, tol5, tol6; - for (; model != NULL; model = model->BSIM4v5nextModel) - { for (here = model->BSIM4v5instances; here != NULL ; - here=here->BSIM4v5nextInstance) + for (; model != NULL; model = BSIM4v5nextModel(model)) + { for (here = BSIM4v5instances(model); here != NULL ; + here=BSIM4v5nextInstance(here)) { vds = model->BSIM4v5type * (*(ckt->CKTrhsOld + here->BSIM4v5dNodePrime) diff --git a/src/spicelib/devices/bsim4v5/b4v5getic.c b/src/spicelib/devices/bsim4v5/b4v5getic.c index 62cfaaafc..d4a6a9702 100644 --- a/src/spicelib/devices/bsim4v5/b4v5getic.c +++ b/src/spicelib/devices/bsim4v5/b4v5getic.c @@ -23,8 +23,8 @@ CKTcircuit *ckt) BSIM4v5model *model = (BSIM4v5model*)inModel; BSIM4v5instance *here; - for (; model ; model = model->BSIM4v5nextModel) - { for (here = model->BSIM4v5instances; here; here = here->BSIM4v5nextInstance) + for (; model ; model = BSIM4v5nextModel(model)) + { for (here = BSIM4v5instances(model); here; here = BSIM4v5nextInstance(here)) { if (!here->BSIM4v5icVDSGiven) { here->BSIM4v5icVDS = *(ckt->CKTrhs + here->BSIM4v5dNode) diff --git a/src/spicelib/devices/bsim4v5/b4v5ld.c b/src/spicelib/devices/bsim4v5/b4v5ld.c index 040b10a09..dda45a395 100644 --- a/src/spicelib/devices/bsim4v5/b4v5ld.c +++ b/src/spicelib/devices/bsim4v5/b4v5ld.c @@ -84,7 +84,7 @@ CKTcircuit *ckt) int BSIM4v5LoadOMP(BSIM4v5instance *here, CKTcircuit *ckt) { -BSIM4v5model *model = here->BSIM4v5modPtr; +BSIM4v5model *model = BSIM4v5modPtr(here); #else BSIM4v5model *model = (BSIM4v5model*)inModel; BSIM4v5instance *here; @@ -237,9 +237,9 @@ ChargeComputationNeeded = ChargeComputationNeeded = 1; #ifndef USE_OMP -for (; model != NULL; model = model->BSIM4v5nextModel) -{ for (here = model->BSIM4v5instances; here != NULL; - here = here->BSIM4v5nextInstance) +for (; model != NULL; model = BSIM4v5nextModel(model)) +{ for (here = BSIM4v5instances(model); here != NULL; + here = BSIM4v5nextInstance(here)) { #endif @@ -4998,7 +4998,7 @@ void BSIM4v5LoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for(idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->BSIM4v5modPtr; + model = BSIM4v5modPtr(here); /* Update b for Ax = b */ (*(ckt->CKTrhs + here->BSIM4v5dNodePrime) += here->BSIM4v5rhsdPrime); (*(ckt->CKTrhs + here->BSIM4v5gNodePrime) -= here->BSIM4v5rhsgPrime); diff --git a/src/spicelib/devices/bsim4v5/b4v5noi.c b/src/spicelib/devices/bsim4v5/b4v5noi.c index 58b7278b1..c56e2d246 100644 --- a/src/spicelib/devices/bsim4v5/b4v5noi.c +++ b/src/spicelib/devices/bsim4v5/b4v5noi.c @@ -119,9 +119,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM4v5nextModel) - { for (here = model->BSIM4v5instances; here != NULL; - here = here->BSIM4v5nextInstance) + for (; model != NULL; model = BSIM4v5nextModel(model)) + { for (here = BSIM4v5instances(model); here != NULL; + here = BSIM4v5nextInstance(here)) { pParam = here->pParam; switch (operation) { case N_OPEN: diff --git a/src/spicelib/devices/bsim4v5/b4v5pzld.c b/src/spicelib/devices/bsim4v5/b4v5pzld.c index c75586bde..808349bbe 100644 --- a/src/spicelib/devices/bsim4v5/b4v5pzld.c +++ b/src/spicelib/devices/bsim4v5/b4v5pzld.c @@ -50,9 +50,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; - for (; model != NULL; model = model->BSIM4v5nextModel) - { for (here = model->BSIM4v5instances; here!= NULL; - here = here->BSIM4v5nextInstance) + for (; model != NULL; model = BSIM4v5nextModel(model)) + { for (here = BSIM4v5instances(model); here!= NULL; + here = BSIM4v5nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4v5capbd; diff --git a/src/spicelib/devices/bsim4v5/b4v5set.c b/src/spicelib/devices/bsim4v5/b4v5set.c index 92fafb38b..1f26487e2 100644 --- a/src/spicelib/devices/bsim4v5/b4v5set.c +++ b/src/spicelib/devices/bsim4v5/b4v5set.c @@ -66,7 +66,7 @@ BSIM4v5instance **InstArray; } /* loop through all the BSIM4v5 device models */ - for( ; model != NULL; model = model->BSIM4v5nextModel ) + for( ; model != NULL; model = BSIM4v5nextModel(model)) { /* process defaults of model parameters */ if (!model->BSIM4v5typeGiven) model->BSIM4v5type = NMOS; @@ -1690,8 +1690,8 @@ BSIM4v5instance **InstArray; * through all the instances of the model */ - for (here = model->BSIM4v5instances; here != NULL ; - here=here->BSIM4v5nextInstance) + for (here = BSIM4v5instances(model); here != NULL ; + here=BSIM4v5nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM4v5states = *states; @@ -2098,11 +2098,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ /* loop through all the BSIM4v6 device models to count the number of instances */ - for (; model != NULL; model = model->BSIM4v5nextModel) + for (; model != NULL; model = BSIM4v5nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4v5instances; here != NULL; - here = here->BSIM4v5nextInstance) + for (here = BSIM4v5instances(model); here != NULL; + here = BSIM4v5nextInstance(here)) { InstCount++; } @@ -2115,11 +2115,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ model->BSIM4v5InstCount = InstCount; model->BSIM4v5InstanceArray = InstArray; idx = 0; - for (; model != NULL; model = model->BSIM4v5nextModel) + for (; model != NULL; model = BSIM4v5nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4v5instances; here != NULL; - here = here->BSIM4v5nextInstance) + for (here = BSIM4v5instances(model); here != NULL; + here = BSIM4v5nextInstance(here)) { InstArray[idx] = here; idx++; @@ -2140,10 +2140,10 @@ BSIM4v5unsetup( BSIM4v5instance *here; for (model = (BSIM4v5model *)inModel; model != NULL; - model = model->BSIM4v5nextModel) + model = BSIM4v5nextModel(model)) { - for (here = model->BSIM4v5instances; here != NULL; - here=here->BSIM4v5nextInstance) + for (here = BSIM4v5instances(model); here != NULL; + here=BSIM4v5nextInstance(here)) { if (here->BSIM4v5qNode > 0) CKTdltNNum(ckt, here->BSIM4v5qNode); diff --git a/src/spicelib/devices/bsim4v5/b4v5soachk.c b/src/spicelib/devices/bsim4v5/b4v5soachk.c index a9cba44f7..43cfbdb88 100644 --- a/src/spicelib/devices/bsim4v5/b4v5soachk.c +++ b/src/spicelib/devices/bsim4v5/b4v5soachk.c @@ -33,9 +33,9 @@ BSIM4v5soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->BSIM4v5nextModel) { + for (; model; model = BSIM4v5nextModel(model)) { - for (here = model->BSIM4v5instances; here; here = here->BSIM4v5nextInstance) { + for (here = BSIM4v5instances(model); here; here = BSIM4v5nextInstance(here)) { vgs = ckt->CKTrhsOld [here->BSIM4v5gNodePrime] - ckt->CKTrhsOld [here->BSIM4v5sNodePrime]; diff --git a/src/spicelib/devices/bsim4v5/b4v5temp.c b/src/spicelib/devices/bsim4v5/b4v5temp.c index 87a4bfac4..aa2fdc3eb 100644 --- a/src/spicelib/devices/bsim4v5/b4v5temp.c +++ b/src/spicelib/devices/bsim4v5/b4v5temp.c @@ -83,7 +83,7 @@ double kvsat, wlod, sceff, Wdrn; int Size_Not_Found, i; /* loop through all the BSIM4v5 device models */ - for (; model != NULL; model = model->BSIM4v5nextModel) + for (; model != NULL; model = BSIM4v5nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM4v5SbulkJctPotential < 0.1) { model->BSIM4v5SbulkJctPotential = 0.1; @@ -337,8 +337,8 @@ int Size_Not_Found, i; /* loop through all the instances of the model */ - for (here = model->BSIM4v5instances; here != NULL; - here = here->BSIM4v5nextInstance) + for (here = BSIM4v5instances(model); here != NULL; + here = BSIM4v5nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim4v5/b4v5trunc.c b/src/spicelib/devices/bsim4v5/b4v5trunc.c index 63facdef3..38fd89423 100644 --- a/src/spicelib/devices/bsim4v5/b4v5trunc.c +++ b/src/spicelib/devices/bsim4v5/b4v5trunc.c @@ -28,9 +28,9 @@ BSIM4v5instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM4v5nextModel) - { for (here = model->BSIM4v5instances; here != NULL; - here = here->BSIM4v5nextInstance) + for (; model != NULL; model = BSIM4v5nextModel(model)) + { for (here = BSIM4v5instances(model); here != NULL; + here = BSIM4v5nextInstance(here)) { #ifdef STEPDEBUG diff --git a/src/spicelib/devices/bsim4v6/b4v6acld.c b/src/spicelib/devices/bsim4v6/b4v6acld.c index c23be59d9..25cf0b82c 100644 --- a/src/spicelib/devices/bsim4v6/b4v6acld.c +++ b/src/spicelib/devices/bsim4v6/b4v6acld.c @@ -57,9 +57,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM4v6nextModel) - { for (here = model->BSIM4v6instances; here!= NULL; - here = here->BSIM4v6nextInstance) + for (; model != NULL; model = BSIM4v6nextModel(model)) + { for (here = BSIM4v6instances(model); here!= NULL; + here = BSIM4v6nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4v6capbd; diff --git a/src/spicelib/devices/bsim4v6/b4v6cvtest.c b/src/spicelib/devices/bsim4v6/b4v6cvtest.c index 0dd071292..765ce4e2e 100644 --- a/src/spicelib/devices/bsim4v6/b4v6cvtest.c +++ b/src/spicelib/devices/bsim4v6/b4v6cvtest.c @@ -41,9 +41,9 @@ double Isestot, cseshat, Idedtot, cdedhat; double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; double tol0, tol1, tol2, tol3, tol4, tol5, tol6; - for (; model != NULL; model = model->BSIM4v6nextModel) - { for (here = model->BSIM4v6instances; here != NULL ; - here=here->BSIM4v6nextInstance) + for (; model != NULL; model = BSIM4v6nextModel(model)) + { for (here = BSIM4v6instances(model); here != NULL ; + here=BSIM4v6nextInstance(here)) { vds = model->BSIM4v6type * (*(ckt->CKTrhsOld + here->BSIM4v6dNodePrime) diff --git a/src/spicelib/devices/bsim4v6/b4v6getic.c b/src/spicelib/devices/bsim4v6/b4v6getic.c index c218763b4..f6dc246dd 100644 --- a/src/spicelib/devices/bsim4v6/b4v6getic.c +++ b/src/spicelib/devices/bsim4v6/b4v6getic.c @@ -25,8 +25,8 @@ CKTcircuit *ckt) BSIM4v6model *model = (BSIM4v6model*)inModel; BSIM4v6instance *here; - for (; model ; model = model->BSIM4v6nextModel) - { for (here = model->BSIM4v6instances; here; here = here->BSIM4v6nextInstance) + for (; model ; model = BSIM4v6nextModel(model)) + { for (here = BSIM4v6instances(model); here; here = BSIM4v6nextInstance(here)) { if (!here->BSIM4v6icVDSGiven) { here->BSIM4v6icVDS = *(ckt->CKTrhs + here->BSIM4v6dNode) diff --git a/src/spicelib/devices/bsim4v6/b4v6ld.c b/src/spicelib/devices/bsim4v6/b4v6ld.c index 21c2aff85..c5bb49f9d 100644 --- a/src/spicelib/devices/bsim4v6/b4v6ld.c +++ b/src/spicelib/devices/bsim4v6/b4v6ld.c @@ -95,7 +95,7 @@ CKTcircuit *ckt) int BSIM4v6LoadOMP(BSIM4v6instance *here, CKTcircuit *ckt) { -BSIM4v6model *model = here->BSIM4v6modPtr; +BSIM4v6model *model = BSIM4v6modPtr(here); #else BSIM4v6model *model = (BSIM4v6model*)inModel; BSIM4v6instance *here; @@ -248,9 +248,9 @@ ChargeComputationNeeded = ? 1 : 0; #ifndef USE_OMP -for (; model != NULL; model = model->BSIM4v6nextModel) -{ for (here = model->BSIM4v6instances; here != NULL; - here = here->BSIM4v6nextInstance) +for (; model != NULL; model = BSIM4v6nextModel(model)) +{ for (here = BSIM4v6instances(model); here != NULL; + here = BSIM4v6nextInstance(here)) { #endif @@ -5210,7 +5210,7 @@ void BSIM4v6LoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for(idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->BSIM4v6modPtr; + model = BSIM4v6modPtr(here); /* Update b for Ax = b */ (*(ckt->CKTrhs + here->BSIM4v6dNodePrime) += here->BSIM4v6rhsdPrime); (*(ckt->CKTrhs + here->BSIM4v6gNodePrime) -= here->BSIM4v6rhsgPrime); diff --git a/src/spicelib/devices/bsim4v6/b4v6noi.c b/src/spicelib/devices/bsim4v6/b4v6noi.c index bb0fc455f..0cba94207 100644 --- a/src/spicelib/devices/bsim4v6/b4v6noi.c +++ b/src/spicelib/devices/bsim4v6/b4v6noi.c @@ -120,9 +120,9 @@ int i; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM4v6nextModel) - { for (here = model->BSIM4v6instances; here != NULL; - here = here->BSIM4v6nextInstance) + for (; model != NULL; model = BSIM4v6nextModel(model)) + { for (here = BSIM4v6instances(model); here != NULL; + here = BSIM4v6nextInstance(here)) { pParam = here->pParam; switch (operation) { case N_OPEN: diff --git a/src/spicelib/devices/bsim4v6/b4v6pzld.c b/src/spicelib/devices/bsim4v6/b4v6pzld.c index bdf9d5769..6e8d83a26 100644 --- a/src/spicelib/devices/bsim4v6/b4v6pzld.c +++ b/src/spicelib/devices/bsim4v6/b4v6pzld.c @@ -52,9 +52,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; - for (; model != NULL; model = model->BSIM4v6nextModel) - { for (here = model->BSIM4v6instances; here!= NULL; - here = here->BSIM4v6nextInstance) + for (; model != NULL; model = BSIM4v6nextModel(model)) + { for (here = BSIM4v6instances(model); here!= NULL; + here = BSIM4v6nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4v6capbd; diff --git a/src/spicelib/devices/bsim4v6/b4v6set.c b/src/spicelib/devices/bsim4v6/b4v6set.c index 6971745e4..1fa4deee0 100644 --- a/src/spicelib/devices/bsim4v6/b4v6set.c +++ b/src/spicelib/devices/bsim4v6/b4v6set.c @@ -73,7 +73,7 @@ BSIM4v6instance **InstArray; } /* loop through all the BSIM4v6 device models */ - for( ; model != NULL; model = model->BSIM4v6nextModel ) + for( ; model != NULL; model = BSIM4v6nextModel(model)) { /* process defaults of model parameters */ if (!model->BSIM4v6typeGiven) model->BSIM4v6type = NMOS; @@ -2051,8 +2051,8 @@ BSIM4v6instance **InstArray; * through all the instances of the model */ - for (here = model->BSIM4v6instances; here != NULL ; - here=here->BSIM4v6nextInstance) + for (here = BSIM4v6instances(model); here != NULL ; + here=BSIM4v6nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM4v6states = *states; @@ -2433,11 +2433,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ /* loop through all the BSIM4v6 device models to count the number of instances */ - for( ; model != NULL; model = model->BSIM4v6nextModel ) + for( ; model != NULL; model = BSIM4v6nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4v6instances; here != NULL ; - here=here->BSIM4v6nextInstance) + for (here = BSIM4v6instances(model); here != NULL ; + here=BSIM4v6nextInstance(here)) { InstCount++; } @@ -2450,11 +2450,11 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ model->BSIM4v6InstCount = InstCount; model->BSIM4v6InstanceArray = InstArray; idx = 0; - for( ; model != NULL; model = model->BSIM4v6nextModel ) + for( ; model != NULL; model = BSIM4v6nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4v6instances; here != NULL ; - here=here->BSIM4v6nextInstance) + for (here = BSIM4v6instances(model); here != NULL ; + here=BSIM4v6nextInstance(here)) { InstArray[idx] = here; idx++; @@ -2473,10 +2473,10 @@ BSIM4v6unsetup(GENmodel *inModel, CKTcircuit *ckt) BSIM4v6instance *here; for (model = (BSIM4v6model *)inModel; model != NULL; - model = model->BSIM4v6nextModel) + model = BSIM4v6nextModel(model)) { - for (here = model->BSIM4v6instances; here != NULL; - here=here->BSIM4v6nextInstance) + for (here = BSIM4v6instances(model); here != NULL; + here=BSIM4v6nextInstance(here)) { if (here->BSIM4v6qNode > 0) CKTdltNNum(ckt, here->BSIM4v6qNode); diff --git a/src/spicelib/devices/bsim4v6/b4v6soachk.c b/src/spicelib/devices/bsim4v6/b4v6soachk.c index 9b71b2705..b508cc43a 100644 --- a/src/spicelib/devices/bsim4v6/b4v6soachk.c +++ b/src/spicelib/devices/bsim4v6/b4v6soachk.c @@ -33,9 +33,9 @@ BSIM4v6soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->BSIM4v6nextModel) { + for (; model; model = BSIM4v6nextModel(model)) { - for (here = model->BSIM4v6instances; here; here = here->BSIM4v6nextInstance) { + for (here = BSIM4v6instances(model); here; here = BSIM4v6nextInstance(here)) { vgs = ckt->CKTrhsOld [here->BSIM4v6gNodePrime] - ckt->CKTrhsOld [here->BSIM4v6sNodePrime]; diff --git a/src/spicelib/devices/bsim4v6/b4v6temp.c b/src/spicelib/devices/bsim4v6/b4v6temp.c index db06df735..804ae78f4 100644 --- a/src/spicelib/devices/bsim4v6/b4v6temp.c +++ b/src/spicelib/devices/bsim4v6/b4v6temp.c @@ -90,7 +90,7 @@ double vtfbphi2eot, phieot, TempRatioeot, Vtm0eot, Vtmeot,vbieot; int Size_Not_Found, i; /* loop through all the BSIM4v6 device models */ - for (; model != NULL; model = model->BSIM4v6nextModel) + for (; model != NULL; model = BSIM4v6nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM4v6SbulkJctPotential < 0.1) { model->BSIM4v6SbulkJctPotential = 0.1; @@ -385,8 +385,8 @@ int Size_Not_Found, i; /* loop through all the instances of the model */ - for (here = model->BSIM4v6instances; here != NULL; - here = here->BSIM4v6nextInstance) + for (here = BSIM4v6instances(model); here != NULL; + here = BSIM4v6nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim4v6/b4v6trunc.c b/src/spicelib/devices/bsim4v6/b4v6trunc.c index 4f9f935cf..8951c198a 100644 --- a/src/spicelib/devices/bsim4v6/b4v6trunc.c +++ b/src/spicelib/devices/bsim4v6/b4v6trunc.c @@ -30,9 +30,9 @@ BSIM4v6instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM4v6nextModel) - { for (here = model->BSIM4v6instances; here != NULL; - here = here->BSIM4v6nextInstance) + for (; model != NULL; model = BSIM4v6nextModel(model)) + { for (here = BSIM4v6instances(model); here != NULL; + here = BSIM4v6nextInstance(here)) { #ifdef STEPDEBUG diff --git a/src/spicelib/devices/bsim4v7/b4v7acld.c b/src/spicelib/devices/bsim4v7/b4v7acld.c index 00a16c107..e3ced126f 100644 --- a/src/spicelib/devices/bsim4v7/b4v7acld.c +++ b/src/spicelib/devices/bsim4v7/b4v7acld.c @@ -57,9 +57,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM4v7nextModel) - { for (here = model->BSIM4v7instances; here!= NULL; - here = here->BSIM4v7nextInstance) + for (; model != NULL; model = BSIM4v7nextModel(model)) + { for (here = BSIM4v7instances(model); here!= NULL; + here = BSIM4v7nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4v7capbd; diff --git a/src/spicelib/devices/bsim4v7/b4v7cvtest.c b/src/spicelib/devices/bsim4v7/b4v7cvtest.c index da2fceb7f..8e20f716f 100644 --- a/src/spicelib/devices/bsim4v7/b4v7cvtest.c +++ b/src/spicelib/devices/bsim4v7/b4v7cvtest.c @@ -41,9 +41,9 @@ double Isestot, cseshat, Idedtot, cdedhat; double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; double tol0, tol1, tol2, tol3, tol4, tol5, tol6; - for (; model != NULL; model = model->BSIM4v7nextModel) - { for (here = model->BSIM4v7instances; here != NULL ; - here=here->BSIM4v7nextInstance) + for (; model != NULL; model = BSIM4v7nextModel(model)) + { for (here = BSIM4v7instances(model); here != NULL ; + here=BSIM4v7nextInstance(here)) { vds = model->BSIM4v7type * (*(ckt->CKTrhsOld + here->BSIM4v7dNodePrime) diff --git a/src/spicelib/devices/bsim4v7/b4v7getic.c b/src/spicelib/devices/bsim4v7/b4v7getic.c index 8d6e33c9c..553a41366 100644 --- a/src/spicelib/devices/bsim4v7/b4v7getic.c +++ b/src/spicelib/devices/bsim4v7/b4v7getic.c @@ -25,8 +25,8 @@ CKTcircuit *ckt) BSIM4v7model *model = (BSIM4v7model*)inModel; BSIM4v7instance *here; - for (; model ; model = model->BSIM4v7nextModel) - { for (here = model->BSIM4v7instances; here; here = here->BSIM4v7nextInstance) + for (; model ; model = BSIM4v7nextModel(model)) + { for (here = BSIM4v7instances(model); here; here = BSIM4v7nextInstance(here)) { if (!here->BSIM4v7icVDSGiven) { here->BSIM4v7icVDS = *(ckt->CKTrhs + here->BSIM4v7dNode) diff --git a/src/spicelib/devices/bsim4v7/b4v7ld.c b/src/spicelib/devices/bsim4v7/b4v7ld.c index 73108ee78..d984a14d8 100644 --- a/src/spicelib/devices/bsim4v7/b4v7ld.c +++ b/src/spicelib/devices/bsim4v7/b4v7ld.c @@ -93,7 +93,7 @@ CKTcircuit *ckt) int BSIM4v7LoadOMP(BSIM4v7instance *here, CKTcircuit *ckt) { -BSIM4v7model *model = here->BSIM4v7modPtr; +BSIM4v7model *model = BSIM4v7modPtr(here); #else BSIM4v7model *model = (BSIM4v7model*)inModel; BSIM4v7instance *here; @@ -248,9 +248,9 @@ ChargeComputationNeeded = ? 1 : 0; #ifndef USE_OMP -for (; model != NULL; model = model->BSIM4v7nextModel) -{ for (here = model->BSIM4v7instances; here != NULL; - here = here->BSIM4v7nextInstance) +for (; model != NULL; model = BSIM4v7nextModel(model)) +{ for (here = BSIM4v7instances(model); here != NULL; + here = BSIM4v7nextInstance(here)) { #endif @@ -5365,7 +5365,7 @@ void BSIM4v7LoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for(idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->BSIM4v7modPtr; + model = BSIM4v7modPtr(here); /* Update b for Ax = b */ (*(ckt->CKTrhs + here->BSIM4v7dNodePrime) += here->BSIM4v7rhsdPrime); (*(ckt->CKTrhs + here->BSIM4v7gNodePrime) -= here->BSIM4v7rhsgPrime); diff --git a/src/spicelib/devices/bsim4v7/b4v7noi.c b/src/spicelib/devices/bsim4v7/b4v7noi.c index 4ef0a2241..c9626255e 100644 --- a/src/spicelib/devices/bsim4v7/b4v7noi.c +++ b/src/spicelib/devices/bsim4v7/b4v7noi.c @@ -129,14 +129,14 @@ double m; "" /* total transistor noise */ }; - for (; model != NULL; model = model->BSIM4v7nextModel) + for (; model != NULL; model = BSIM4v7nextModel(model)) { if(model->BSIM4v7tnoiMod != 2) { noizDens[BSIM4v7CORLNOIZ] = 0.0; lnNdens[BSIM4v7CORLNOIZ] = N_MINLOG; } - for (here = model->BSIM4v7instances; here != NULL; - here = here->BSIM4v7nextInstance) + for (here = BSIM4v7instances(model); here != NULL; + here = BSIM4v7nextInstance(here)) { pParam = here->pParam; switch (operation) { case N_OPEN: diff --git a/src/spicelib/devices/bsim4v7/b4v7pzld.c b/src/spicelib/devices/bsim4v7/b4v7pzld.c index 0d93ee1a4..641eb7067 100644 --- a/src/spicelib/devices/bsim4v7/b4v7pzld.c +++ b/src/spicelib/devices/bsim4v7/b4v7pzld.c @@ -52,9 +52,9 @@ double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; double m; - for (; model != NULL; model = model->BSIM4v7nextModel) - { for (here = model->BSIM4v7instances; here!= NULL; - here = here->BSIM4v7nextInstance) + for (; model != NULL; model = BSIM4v7nextModel(model)) + { for (here = BSIM4v7instances(model); here!= NULL; + here = BSIM4v7nextInstance(here)) { pParam = here->pParam; capbd = here->BSIM4v7capbd; diff --git a/src/spicelib/devices/bsim4v7/b4v7set.c b/src/spicelib/devices/bsim4v7/b4v7set.c index ade75ad86..f768d7fb3 100644 --- a/src/spicelib/devices/bsim4v7/b4v7set.c +++ b/src/spicelib/devices/bsim4v7/b4v7set.c @@ -72,7 +72,7 @@ BSIM4v7instance **InstArray; } /* loop through all the BSIM4v7 device models */ - for( ; model != NULL; model = model->BSIM4v7nextModel ) + for( ; model != NULL; model = BSIM4v7nextModel(model)) { /* process defaults of model parameters */ if (!model->BSIM4v7typeGiven) model->BSIM4v7type = NMOS; @@ -2202,8 +2202,8 @@ BSIM4v7instance **InstArray; * through all the instances of the model */ - for (here = model->BSIM4v7instances; here != NULL ; - here=here->BSIM4v7nextInstance) + for (here = BSIM4v7instances(model); here != NULL ; + here=BSIM4v7nextInstance(here)) { /* allocate a chunk of the state vector */ here->BSIM4v7states = *states; @@ -2588,11 +2588,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL /* loop through all the BSIM4v7 device models to count the number of instances */ - for( ; model != NULL; model = model->BSIM4v7nextModel ) + for( ; model != NULL; model = BSIM4v7nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4v7instances; here != NULL ; - here=here->BSIM4v7nextInstance) + for (here = BSIM4v7instances(model); here != NULL ; + here=BSIM4v7nextInstance(here)) { InstCount++; } @@ -2605,11 +2605,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL model->BSIM4v7InstCount = InstCount; model->BSIM4v7InstanceArray = InstArray; idx = 0; - for( ; model != NULL; model = model->BSIM4v7nextModel ) + for( ; model != NULL; model = BSIM4v7nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->BSIM4v7instances; here != NULL ; - here=here->BSIM4v7nextInstance) + for (here = BSIM4v7instances(model); here != NULL ; + here=BSIM4v7nextInstance(here)) { InstArray[idx] = here; idx++; @@ -2630,10 +2630,10 @@ CKTcircuit *ckt) BSIM4v7instance *here; for (model = (BSIM4v7model *)inModel; model != NULL; - model = model->BSIM4v7nextModel) + model = BSIM4v7nextModel(model)) { - for (here = model->BSIM4v7instances; here != NULL; - here=here->BSIM4v7nextInstance) + for (here = BSIM4v7instances(model); here != NULL; + here=BSIM4v7nextInstance(here)) { if (here->BSIM4v7qNode > 0) CKTdltNNum(ckt, here->BSIM4v7qNode); diff --git a/src/spicelib/devices/bsim4v7/b4v7soachk.c b/src/spicelib/devices/bsim4v7/b4v7soachk.c index 0c327e295..a1e7777dc 100644 --- a/src/spicelib/devices/bsim4v7/b4v7soachk.c +++ b/src/spicelib/devices/bsim4v7/b4v7soachk.c @@ -33,9 +33,9 @@ BSIM4v7soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->BSIM4v7nextModel) { + for (; model; model = BSIM4v7nextModel(model)) { - for (here = model->BSIM4v7instances; here; here = here->BSIM4v7nextInstance) { + for (here = BSIM4v7instances(model); here; here = BSIM4v7nextInstance(here)) { vgs = ckt->CKTrhsOld [here->BSIM4v7gNodePrime] - ckt->CKTrhsOld [here->BSIM4v7sNodePrime]; diff --git a/src/spicelib/devices/bsim4v7/b4v7temp.c b/src/spicelib/devices/bsim4v7/b4v7temp.c index 089de1aeb..2cbc3f477 100644 --- a/src/spicelib/devices/bsim4v7/b4v7temp.c +++ b/src/spicelib/devices/bsim4v7/b4v7temp.c @@ -92,7 +92,7 @@ double vtfbphi2eot, phieot, TempRatioeot, Vtm0eot, Vtmeot,vbieot; int Size_Not_Found, i; /* loop through all the BSIM4v7 device models */ - for (; model != NULL; model = model->BSIM4v7nextModel) + for (; model != NULL; model = BSIM4v7nextModel(model)) { Temp = ckt->CKTtemp; if (model->BSIM4v7SbulkJctPotential < 0.1) { model->BSIM4v7SbulkJctPotential = 0.1; @@ -406,8 +406,8 @@ int Size_Not_Found, i; /* loop through all the instances of the model */ - for (here = model->BSIM4v7instances; here != NULL; - here = here->BSIM4v7nextInstance) + for (here = BSIM4v7instances(model); here != NULL; + here = BSIM4v7nextInstance(here)) { pSizeDependParamKnot = model->pSizeDependParamKnot; Size_Not_Found = 1; diff --git a/src/spicelib/devices/bsim4v7/b4v7trunc.c b/src/spicelib/devices/bsim4v7/b4v7trunc.c index a851aaaf8..9aea00696 100644 --- a/src/spicelib/devices/bsim4v7/b4v7trunc.c +++ b/src/spicelib/devices/bsim4v7/b4v7trunc.c @@ -30,9 +30,9 @@ BSIM4v7instance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->BSIM4v7nextModel) - { for (here = model->BSIM4v7instances; here != NULL; - here = here->BSIM4v7nextInstance) + for (; model != NULL; model = BSIM4v7nextModel(model)) + { for (here = BSIM4v7instances(model); here != NULL; + here = BSIM4v7nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; diff --git a/src/spicelib/devices/bsimsoi/b4soiacld.c b/src/spicelib/devices/bsimsoi/b4soiacld.c index aeb90c570..d629e5bbb 100644 --- a/src/spicelib/devices/bsimsoi/b4soiacld.c +++ b/src/spicelib/devices/bsimsoi/b4soiacld.c @@ -75,11 +75,11 @@ double gdtot, gdtotd, gdtotg, gdtots, gdtotb; double m; omega = ckt->CKTomega; - for (; model != NULL; model = model->B4SOInextModel) + for (; model != NULL; model = B4SOInextModel(model)) { - for (here = model->B4SOIinstances; here!= NULL; - here = here->B4SOInextInstance) + for (here = B4SOIinstances(model); here!= NULL; + here = B4SOInextInstance(here)) { selfheat = (model->B4SOIshMod == 1) && (here->B4SOIrth0 != 0.0); if (here->B4SOImode >= 0) diff --git a/src/spicelib/devices/bsimsoi/b4soicvtest.c b/src/spicelib/devices/bsimsoi/b4soicvtest.c index 3b12bd9b1..0abfc9405 100644 --- a/src/spicelib/devices/bsimsoi/b4soicvtest.c +++ b/src/spicelib/devices/bsimsoi/b4soicvtest.c @@ -36,10 +36,10 @@ double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds; double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs; /* loop through all the B4SOI device models */ - for (; model != NULL; model = model->B4SOInextModel) + for (; model != NULL; model = B4SOInextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B4SOIinstances; here != NULL ; - here=here->B4SOInextInstance) + for (here = B4SOIinstances(model); here != NULL ; + here=B4SOInextInstance(here)) { vbs = model->B4SOItype * (*(ckt->CKTrhsOld+here->B4SOIbNode) diff --git a/src/spicelib/devices/bsimsoi/b4soigetic.c b/src/spicelib/devices/bsimsoi/b4soigetic.c index 2de1f3163..73478bad2 100644 --- a/src/spicelib/devices/bsimsoi/b4soigetic.c +++ b/src/spicelib/devices/bsimsoi/b4soigetic.c @@ -30,8 +30,8 @@ CKTcircuit *ckt) B4SOImodel *model = (B4SOImodel*)inModel; B4SOIinstance *here; - for (; model ; model = model->B4SOInextModel) - { for (here = model->B4SOIinstances; here; here = here->B4SOInextInstance) + for (; model ; model = B4SOInextModel(model)) + { for (here = B4SOIinstances(model); here; here = B4SOInextInstance(here)) { if(!here->B4SOIicVBSGiven) { here->B4SOIicVBS = *(ckt->CKTrhs + here->B4SOIbNode) diff --git a/src/spicelib/devices/bsimsoi/b4soild.c b/src/spicelib/devices/bsimsoi/b4soild.c index 4ccf7c9e5..bb1b4519d 100644 --- a/src/spicelib/devices/bsimsoi/b4soild.c +++ b/src/spicelib/devices/bsimsoi/b4soild.c @@ -127,7 +127,7 @@ B4SOIload( } int B4SOILoadOMP(B4SOIinstance *here, CKTcircuit *ckt) { - B4SOImodel *model = here->B4SOImodPtr; + B4SOImodel *model = B4SOImodPtr(here); #else register B4SOImodel *model = (B4SOImodel*)inModel; register B4SOIinstance *here; @@ -489,9 +489,9 @@ int B4SOILoadOMP(B4SOIinstance *here, CKTcircuit *ckt) { double m; #ifndef USE_OMP - for (; model != NULL; model = model->B4SOInextModel) - { for (here = model->B4SOIinstances; here != NULL; - here = here->B4SOInextInstance) + for (; model != NULL; model = B4SOInextModel(model)) + { for (here = B4SOIinstances(model); here != NULL; + here = B4SOInextInstance(here)) { #endif @@ -10969,7 +10969,7 @@ void B4SOILoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for(idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->B4SOImodPtr; + model = B4SOImodPtr(here); /* Update b for Ax = b */ /* v3.1 */ diff --git a/src/spicelib/devices/bsimsoi/b4soinoi.c b/src/spicelib/devices/bsimsoi/b4soinoi.c index bd8964311..b61f9b8d0 100644 --- a/src/spicelib/devices/bsimsoi/b4soinoi.c +++ b/src/spicelib/devices/bsimsoi/b4soinoi.c @@ -147,9 +147,9 @@ double m; "" /* total transistor noise */ }; - for (; model != NULL; model = model->B4SOInextModel) - { for (here = model->B4SOIinstances; here != NULL; - here = here->B4SOInextInstance) + for (; model != NULL; model = B4SOInextModel(model)) + { for (here = B4SOIinstances(model); here != NULL; + here = B4SOInextInstance(here)) { m = here->B4SOIm; diff --git a/src/spicelib/devices/bsimsoi/b4soipzld.c b/src/spicelib/devices/bsimsoi/b4soipzld.c index d584f75f6..51362257a 100644 --- a/src/spicelib/devices/bsimsoi/b4soipzld.c +++ b/src/spicelib/devices/bsimsoi/b4soipzld.c @@ -40,9 +40,9 @@ double m; NG_IGNORE(ckt); - for (; model != NULL; model = model->B4SOInextModel) - { for (here = model->B4SOIinstances; here!= NULL; - here = here->B4SOInextInstance) + for (; model != NULL; model = B4SOInextModel(model)) + { for (here = B4SOIinstances(model); here!= NULL; + here = B4SOInextInstance(here)) { if (here->B4SOImode >= 0) { Gm = here->B4SOIgm; diff --git a/src/spicelib/devices/bsimsoi/b4soiset.c b/src/spicelib/devices/bsimsoi/b4soiset.c index daf6ad576..70965f5f2 100644 --- a/src/spicelib/devices/bsimsoi/b4soiset.c +++ b/src/spicelib/devices/bsimsoi/b4soiset.c @@ -59,7 +59,7 @@ B4SOIinstance **InstArray; #endif /* loop through all the B4SOI device models */ - for( ; model != NULL; model = model->B4SOInextModel ) + for( ; model != NULL; model = B4SOInextModel(model)) { /* Default value Processing for B4SOI MOSFET Models */ @@ -2101,8 +2101,8 @@ B4SOIinstance **InstArray; if (!model->B4SOIpvoffcvGiven) model->B4SOIpvoffcv = 0.0; /* loop through all the instances of the model */ - for (here = model->B4SOIinstances; here != NULL ; - here=here->B4SOInextInstance) + for (here = B4SOIinstances(model); here != NULL ; + here=B4SOInextInstance(here)) { /* allocate a chunk of the state vector */ here->B4SOIstates = *states; *states += B4SOInumStates; @@ -2725,11 +2725,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL /* loop through all the B4SOI device models to count the number of instances */ - for( ; model != NULL; model = model->B4SOInextModel ) + for( ; model != NULL; model = B4SOInextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B4SOIinstances; here != NULL ; - here=here->B4SOInextInstance) + for (here = B4SOIinstances(model); here != NULL ; + here=B4SOInextInstance(here)) { InstCount++; } @@ -2742,11 +2742,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL model->B4SOIInstCount = InstCount; model->B4SOIInstanceArray = InstArray; idx = 0; - for( ; model != NULL; model = model->B4SOInextModel ) + for( ; model != NULL; model = B4SOInextModel(model)) { /* loop through all the instances of the model */ - for (here = model->B4SOIinstances; here != NULL ; - here=here->B4SOInextInstance) + for (here = B4SOIinstances(model); here != NULL ; + here=B4SOInextInstance(here)) { InstArray[idx] = here; idx++; @@ -2767,10 +2767,10 @@ B4SOIunsetup( B4SOIinstance *here; for (model = (B4SOImodel *)inModel; model != NULL; - model = model->B4SOInextModel) + model = B4SOInextModel(model)) { - for (here = model->B4SOIinstances; here != NULL; - here=here->B4SOInextInstance) + for (here = B4SOIinstances(model); here != NULL; + here=B4SOInextInstance(here)) { /* here for debugging purpose only */ if (here->B4SOIqjdNode > 0) diff --git a/src/spicelib/devices/bsimsoi/b4soisoachk.c b/src/spicelib/devices/bsimsoi/b4soisoachk.c index 998afbed0..44a77f40e 100644 --- a/src/spicelib/devices/bsimsoi/b4soisoachk.c +++ b/src/spicelib/devices/bsimsoi/b4soisoachk.c @@ -33,9 +33,9 @@ B4SOIsoaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->B4SOInextModel) { + for (; model; model = B4SOInextModel(model)) { - for (here = model->B4SOIinstances; here; here = here->B4SOInextInstance) { + for (here = B4SOIinstances(model); here; here = B4SOInextInstance(here)) { vgs = ckt->CKTrhsOld [here->B4SOIgNode] - ckt->CKTrhsOld [here->B4SOIsNodePrime]; diff --git a/src/spicelib/devices/bsimsoi/b4soitemp.c b/src/spicelib/devices/bsimsoi/b4soitemp.c index 052748ba0..c6a1496db 100644 --- a/src/spicelib/devices/bsimsoi/b4soitemp.c +++ b/src/spicelib/devices/bsimsoi/b4soitemp.c @@ -83,7 +83,7 @@ B4SOItemp( /* loop through all the B4SOI device models */ - for (; model != NULL; model = model->B4SOInextModel) + for (; model != NULL; model = B4SOInextModel(model)) { Temp = ckt->CKTtemp; if (model->B4SOIGatesidewallJctSPotential < 0.1) /* v4.0 */ model->B4SOIGatesidewallJctSPotential = 0.1; @@ -160,8 +160,8 @@ B4SOItemp( /* loop through all the instances of the model */ /* MCJ: Length and Width not initialized */ - for (here = model->B4SOIinstances; here != NULL; - here = here->B4SOInextInstance) + for (here = B4SOIinstances(model); here != NULL; + here = B4SOInextInstance(here)) { here->B4SOIrbodyext = here->B4SOIbodySquares * model->B4SOIrbsh; diff --git a/src/spicelib/devices/bsimsoi/b4soitrunc.c b/src/spicelib/devices/bsimsoi/b4soitrunc.c index 57068002f..1dd9cd64b 100644 --- a/src/spicelib/devices/bsimsoi/b4soitrunc.c +++ b/src/spicelib/devices/bsimsoi/b4soitrunc.c @@ -34,9 +34,9 @@ register B4SOIinstance *here; double debugtemp; #endif /* STEPDEBUG */ - for (; model != NULL; model = model->B4SOInextModel) - { for (here = model->B4SOIinstances; here != NULL; - here = here->B4SOInextInstance) + for (; model != NULL; model = B4SOInextModel(model)) + { for (here = B4SOIinstances(model); here != NULL; + here = B4SOInextInstance(here)) { #ifdef STEPDEBUG diff --git a/src/spicelib/devices/cap/capacld.c b/src/spicelib/devices/cap/capacld.c index 006eb694a..95b1d43ee 100644 --- a/src/spicelib/devices/cap/capacld.c +++ b/src/spicelib/devices/cap/capacld.c @@ -21,9 +21,9 @@ CAPacLoad(GENmodel *inModel, CKTcircuit *ckt) double m; CAPinstance *here; - for( ; model != NULL; model = model->CAPnextModel) { - for( here = model->CAPinstances; here != NULL; - here = here->CAPnextInstance) { + for( ; model != NULL; model = CAPnextModel(model)) { + for( here = CAPinstances(model); here != NULL; + here = CAPnextInstance(here)) { m = here->CAPm; diff --git a/src/spicelib/devices/cap/capgetic.c b/src/spicelib/devices/cap/capgetic.c index 66099d7c2..4e2020a8f 100644 --- a/src/spicelib/devices/cap/capgetic.c +++ b/src/spicelib/devices/cap/capgetic.c @@ -22,8 +22,8 @@ CAPgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->CAPnextModel) { - for(here = model->CAPinstances; here ; here = here->CAPnextInstance) { + for( ; model ; model = CAPnextModel(model)) { + for(here = CAPinstances(model); here ; here = CAPnextInstance(here)) { if(!here->CAPicGiven) { here->CAPinitCond = diff --git a/src/spicelib/devices/cap/capload.c b/src/spicelib/devices/cap/capload.c index dc26bb537..d7ed3224d 100644 --- a/src/spicelib/devices/cap/capload.c +++ b/src/spicelib/devices/cap/capload.c @@ -35,11 +35,11 @@ CAPload(GENmodel *inModel, CKTcircuit *ckt) || ( ( ckt->CKTmode & MODEUIC) && ( ckt->CKTmode & MODEINITTRAN) ) ) ; /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { m = here->CAPm; diff --git a/src/spicelib/devices/cap/cappzld.c b/src/spicelib/devices/cap/cappzld.c index bb46ac60a..2153bbd6c 100644 --- a/src/spicelib/devices/cap/cappzld.c +++ b/src/spicelib/devices/cap/cappzld.c @@ -26,9 +26,9 @@ CAPpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); - for( ; model != NULL; model = model->CAPnextModel) { - for( here = model->CAPinstances;here != NULL; - here = here->CAPnextInstance) { + for( ; model != NULL; model = CAPnextModel(model)) { + for( here = CAPinstances(model);here != NULL; + here = CAPnextInstance(here)) { val = here->CAPcapac; m = here->CAPm; diff --git a/src/spicelib/devices/cap/capsacl.c b/src/spicelib/devices/cap/capsacl.c index 159b8b247..ef4e163b1 100644 --- a/src/spicelib/devices/cap/capsacl.c +++ b/src/spicelib/devices/cap/capsacl.c @@ -31,11 +31,11 @@ CAPsAcLoad(GENmodel *inModel, CKTcircuit *ckt) double ival; /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { if(here->CAPsenParmNo){ vcap = *(ckt->CKTrhsOld+here->CAPposNode) - diff --git a/src/spicelib/devices/cap/capsetup.c b/src/spicelib/devices/cap/capsetup.c index f5f0e758b..c003bd57a 100644 --- a/src/spicelib/devices/cap/capsetup.c +++ b/src/spicelib/devices/cap/capsetup.c @@ -25,7 +25,7 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CAPinstance *here; /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { /*Default Value Processing for Model Parameters */ if (!model->CAPmCapGiven) { @@ -88,8 +88,8 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { /* Default Value Processing for Capacitor Instance */ if (!here->CAPlengthGiven) { diff --git a/src/spicelib/devices/cap/capsload.c b/src/spicelib/devices/cap/capsload.c index ca536c484..0e51f3203 100644 --- a/src/spicelib/devices/cap/capsload.c +++ b/src/spicelib/devices/cap/capsload.c @@ -52,11 +52,11 @@ CAPsLoad(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { #ifdef SENSDEBUG printf("senload instance name %s\n",here->CAPname); diff --git a/src/spicelib/devices/cap/capsoachk.c b/src/spicelib/devices/cap/capsoachk.c index 17172a832..38615b4a4 100644 --- a/src/spicelib/devices/cap/capsoachk.c +++ b/src/spicelib/devices/cap/capsoachk.c @@ -28,9 +28,9 @@ CAPsoaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->CAPnextModel) { + for (; model; model = CAPnextModel(model)) { - for (here = model->CAPinstances; here; here = here->CAPnextInstance) { + for (here = CAPinstances(model); here; here = CAPnextInstance(here)) { vc = fabs(ckt->CKTrhsOld [here->CAPposNode] - ckt->CKTrhsOld [here->CAPnegNode]); diff --git a/src/spicelib/devices/cap/capsprt.c b/src/spicelib/devices/cap/capsprt.c index f22d3e428..e8fc835b4 100644 --- a/src/spicelib/devices/cap/capsprt.c +++ b/src/spicelib/devices/cap/capsprt.c @@ -28,13 +28,13 @@ CAPsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("CAPACITORS-----------------\n"); /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { printf("Model name:%s\n",model->CAPmodName); /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { printf(" Instance name:%s\n",here->CAPname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/cap/capsset.c b/src/spicelib/devices/cap/capsset.c index 347dbe9ba..bb8b87739 100644 --- a/src/spicelib/devices/cap/capsset.c +++ b/src/spicelib/devices/cap/capsset.c @@ -28,11 +28,11 @@ CAPsSetup(SENstruct *info, GENmodel *inModel) CAPinstance *here; /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { if(here->CAPsenParmNo){ here->CAPsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/cap/capsupd.c b/src/spicelib/devices/cap/capsupd.c index 64085d655..98e6095e5 100644 --- a/src/spicelib/devices/cap/capsupd.c +++ b/src/spicelib/devices/cap/capsupd.c @@ -40,11 +40,11 @@ CAPsUpdate(GENmodel *inModel, CKTcircuit *ckt) #endif /* SENSDEBUG */ /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { vcap = *(ckt->CKTrhsOld+here->CAPposNode) - *(ckt->CKTrhsOld+here->CAPnegNode) ; diff --git a/src/spicelib/devices/cap/captemp.c b/src/spicelib/devices/cap/captemp.c index f6dcc371d..926a3c666 100644 --- a/src/spicelib/devices/cap/captemp.c +++ b/src/spicelib/devices/cap/captemp.c @@ -29,11 +29,11 @@ CAPtemp(GENmodel *inModel, CKTcircuit *ckt) double tc1, tc2; /* loop through all the capacitor models */ - for( ; model != NULL; model = model->CAPnextModel ) { + for( ; model != NULL; model = CAPnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CAPinstances; here != NULL ; - here=here->CAPnextInstance) { + for (here = CAPinstances(model); here != NULL ; + here=CAPnextInstance(here)) { /* Default Value Processing for Capacitor Instance */ if(!here->CAPtempGiven) { diff --git a/src/spicelib/devices/cap/captrunc.c b/src/spicelib/devices/cap/captrunc.c index add70b94a..b6903591a 100644 --- a/src/spicelib/devices/cap/captrunc.c +++ b/src/spicelib/devices/cap/captrunc.c @@ -19,9 +19,9 @@ CAPtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) CAPmodel *model = (CAPmodel*)inModel; CAPinstance *here; - for( ; model!= NULL; model = model->CAPnextModel) { - for(here = model->CAPinstances ; here != NULL ; - here = here->CAPnextInstance) { + for( ; model!= NULL; model = CAPnextModel(model)) { + for(here = CAPinstances(model); here != NULL ; + here = CAPnextInstance(here)) { CKTterr(here->CAPqcap,ckt,timeStep); } diff --git a/src/spicelib/devices/cccs/cccsload.c b/src/spicelib/devices/cccs/cccsload.c index 878494e6a..8e29cd866 100644 --- a/src/spicelib/devices/cccs/cccsload.c +++ b/src/spicelib/devices/cccs/cccsload.c @@ -26,11 +26,11 @@ CCCSload(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCCSnextModel ) { + for( ; model != NULL; model = CCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCCSinstances; here != NULL ; - here=here->CCCSnextInstance) { + for (here = CCCSinstances(model); here != NULL ; + here=CCCSnextInstance(here)) { *(here->CCCSposContBrPtr) += here->CCCScoeff ; *(here->CCCSnegContBrPtr) -= here->CCCScoeff ; diff --git a/src/spicelib/devices/cccs/cccspzld.c b/src/spicelib/devices/cccs/cccspzld.c index 7499d929d..42a5977d7 100644 --- a/src/spicelib/devices/cccs/cccspzld.c +++ b/src/spicelib/devices/cccs/cccspzld.c @@ -28,11 +28,11 @@ CCCSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(s); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCCSnextModel ) { + for( ; model != NULL; model = CCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCCSinstances; here != NULL ; - here=here->CCCSnextInstance) { + for (here = CCCSinstances(model); here != NULL ; + here=CCCSnextInstance(here)) { *(here->CCCSposContBrPtr) += here->CCCScoeff ; *(here->CCCSnegContBrPtr) -= here->CCCScoeff ; diff --git a/src/spicelib/devices/cccs/cccssacl.c b/src/spicelib/devices/cccs/cccssacl.c index 89078110f..1b6d7c4bf 100644 --- a/src/spicelib/devices/cccs/cccssacl.c +++ b/src/spicelib/devices/cccs/cccssacl.c @@ -26,11 +26,11 @@ CCCSsAcLoad(GENmodel *inModel, CKTcircuit *ckt) double i_ic; /* loop through all the CCCS models */ - for( ; model != NULL; model = model->CCCSnextModel ) { + for( ; model != NULL; model = CCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCCSinstances; here != NULL ; - here=here->CCCSnextInstance) { + for (here = CCCSinstances(model); here != NULL ; + here=CCCSnextInstance(here)) { if(here->CCCSsenParmNo){ diff --git a/src/spicelib/devices/cccs/cccsset.c b/src/spicelib/devices/cccs/cccsset.c index be3dab93f..0c1e7fa92 100644 --- a/src/spicelib/devices/cccs/cccsset.c +++ b/src/spicelib/devices/cccs/cccsset.c @@ -27,11 +27,11 @@ CCCSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) NG_IGNORE(states); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCCSnextModel ) { + for( ; model != NULL; model = CCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCCSinstances; here != NULL ; - here=here->CCCSnextInstance) { + for (here = CCCSinstances(model); here != NULL ; + here=CCCSnextInstance(here)) { here->CCCScontBranch = CKTfndBranch(ckt,here->CCCScontName); if(here->CCCScontBranch == 0) { diff --git a/src/spicelib/devices/cccs/cccssld.c b/src/spicelib/devices/cccs/cccssld.c index 933c03c83..e0268db64 100644 --- a/src/spicelib/devices/cccs/cccssld.c +++ b/src/spicelib/devices/cccs/cccssld.c @@ -25,11 +25,11 @@ CCCSsLoad(GENmodel *inModel, CKTcircuit *ckt) double ic ; /* loop through all the CCCS models */ - for( ; model != NULL; model = model->CCCSnextModel ) { + for( ; model != NULL; model = CCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCCSinstances; here != NULL ; - here=here->CCCSnextInstance) { + for (here = CCCSinstances(model); here != NULL ; + here=CCCSnextInstance(here)) { if(here->CCCSsenParmNo){ ic = *(ckt->CKTrhsOld + here->CCCScontBranch); diff --git a/src/spicelib/devices/cccs/cccssprt.c b/src/spicelib/devices/cccs/cccssprt.c index 2fc0f5e1f..7f194bd71 100644 --- a/src/spicelib/devices/cccs/cccssprt.c +++ b/src/spicelib/devices/cccs/cccssprt.c @@ -25,13 +25,13 @@ CCCSsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("CURRENT CONTROLLED CURRENT SOURCES-----------------\n"); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCCSnextModel ) { + for( ; model != NULL; model = CCCSnextModel(model)) { printf("Model name:%s\n",model->CCCSmodName); /* loop through all the instances of the model */ - for (here = model->CCCSinstances; here != NULL ; - here=here->CCCSnextInstance) { + for (here = CCCSinstances(model); here != NULL ; + here=CCCSnextInstance(here)) { printf(" Instance name:%s\n",here->CCCSname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/cccs/cccssset.c b/src/spicelib/devices/cccs/cccssset.c index 8ad2bf362..e031c4d1b 100644 --- a/src/spicelib/devices/cccs/cccssset.c +++ b/src/spicelib/devices/cccs/cccssset.c @@ -24,11 +24,11 @@ CCCSsSetup(SENstruct *info, GENmodel *inModel) CCCSinstance *here; /* loop through all the CCCS models */ - for( ; model != NULL; model = model->CCCSnextModel ) { + for( ; model != NULL; model = CCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCCSinstances; here != NULL ; - here=here->CCCSnextInstance) { + for (here = CCCSinstances(model); here != NULL ; + here=CCCSnextInstance(here)) { if(here->CCCSsenParmNo){ here->CCCSsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/ccvs/ccvsfbr.c b/src/spicelib/devices/ccvs/ccvsfbr.c index 5f7c0ee57..e7d211a35 100644 --- a/src/spicelib/devices/ccvs/ccvsfbr.c +++ b/src/spicelib/devices/ccvs/ccvsfbr.c @@ -20,9 +20,9 @@ CCVSfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name) int error; CKTnode *tmp; - for( ; model != NULL; model = model->CCVSnextModel) { - for (here = model->CCVSinstances; here != NULL; - here = here->CCVSnextInstance) { + for( ; model != NULL; model = CCVSnextModel(model)) { + for (here = CCVSinstances(model); here != NULL; + here = CCVSnextInstance(here)) { if(here->CCVSname == name) { if(here->CCVSbranch == 0) { error = CKTmkCur(ckt,&tmp, here->CCVSname,"branch"); diff --git a/src/spicelib/devices/ccvs/ccvsload.c b/src/spicelib/devices/ccvs/ccvsload.c index 88f3f8c34..22fa4665e 100644 --- a/src/spicelib/devices/ccvs/ccvsload.c +++ b/src/spicelib/devices/ccvs/ccvsload.c @@ -26,11 +26,11 @@ CCVSload(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCVSnextModel ) { + for( ; model != NULL; model = CCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCVSinstances; here != NULL ; - here=here->CCVSnextInstance) { + for (here = CCVSinstances(model); here != NULL ; + here=CCVSnextInstance(here)) { *(here->CCVSposIbrPtr) += 1.0 ; *(here->CCVSnegIbrPtr) -= 1.0 ; diff --git a/src/spicelib/devices/ccvs/ccvspzld.c b/src/spicelib/devices/ccvs/ccvspzld.c index 9e3053077..6d50df09f 100644 --- a/src/spicelib/devices/ccvs/ccvspzld.c +++ b/src/spicelib/devices/ccvs/ccvspzld.c @@ -28,11 +28,11 @@ CCVSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(s); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCVSnextModel ) { + for( ; model != NULL; model = CCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCVSinstances; here != NULL ; - here=here->CCVSnextInstance) { + for (here = CCVSinstances(model); here != NULL ; + here=CCVSnextInstance(here)) { *(here->CCVSposIbrPtr) += 1.0 ; *(here->CCVSnegIbrPtr) -= 1.0 ; diff --git a/src/spicelib/devices/ccvs/ccvssacl.c b/src/spicelib/devices/ccvs/ccvssacl.c index bebbef73a..3f444b513 100644 --- a/src/spicelib/devices/ccvs/ccvssacl.c +++ b/src/spicelib/devices/ccvs/ccvssacl.c @@ -24,11 +24,11 @@ CCVSsAcLoad(GENmodel *inModel, CKTcircuit *ckt) double ic,i_ic; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCVSnextModel ) { + for( ; model != NULL; model = CCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCVSinstances; here != NULL ; - here=here->CCVSnextInstance) { + for (here = CCVSinstances(model); here != NULL ; + here=CCVSnextInstance(here)) { if(here->CCVSsenParmNo){ ic = *(ckt->CKTrhsOld + here->CCVScontBranch); diff --git a/src/spicelib/devices/ccvs/ccvsset.c b/src/spicelib/devices/ccvs/ccvsset.c index 5521312b3..d3b68dc29 100644 --- a/src/spicelib/devices/ccvs/ccvsset.c +++ b/src/spicelib/devices/ccvs/ccvsset.c @@ -25,11 +25,11 @@ CCVSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) NG_IGNORE(states); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCVSnextModel ) { + for( ; model != NULL; model = CCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCVSinstances; here != NULL ; - here=here->CCVSnextInstance) { + for (here = CCVSinstances(model); here != NULL ; + here=CCVSnextInstance(here)) { if(here->CCVSposNode == here->CCVSnegNode) { SPfrontEnd->IFerrorf (ERR_FATAL, @@ -72,10 +72,10 @@ CCVSunsetup(GENmodel *inModel, CKTcircuit *ckt) CCVSinstance *here; for (model = (CCVSmodel *)inModel; model != NULL; - model = model->CCVSnextModel) + model = CCVSnextModel(model)) { - for (here = model->CCVSinstances; here != NULL; - here=here->CCVSnextInstance) + for (here = CCVSinstances(model); here != NULL; + here=CCVSnextInstance(here)) { if (here->CCVSbranch) { CKTdltNNum(ckt, here->CCVSbranch); diff --git a/src/spicelib/devices/ccvs/ccvssld.c b/src/spicelib/devices/ccvs/ccvssld.c index fd1b210cb..5cc086cb7 100644 --- a/src/spicelib/devices/ccvs/ccvssld.c +++ b/src/spicelib/devices/ccvs/ccvssld.c @@ -24,11 +24,11 @@ CCVSsLoad(GENmodel *inModel, CKTcircuit *ckt) double ic; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCVSnextModel ) { + for( ; model != NULL; model = CCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCVSinstances; here != NULL ; - here=here->CCVSnextInstance) { + for (here = CCVSinstances(model); here != NULL ; + here=CCVSnextInstance(here)) { if(here->CCVSsenParmNo){ ic = *(ckt->CKTrhsOld + here->CCVScontBranch); diff --git a/src/spicelib/devices/ccvs/ccvssprt.c b/src/spicelib/devices/ccvs/ccvssprt.c index 1115c0226..c9d915e37 100644 --- a/src/spicelib/devices/ccvs/ccvssprt.c +++ b/src/spicelib/devices/ccvs/ccvssprt.c @@ -24,13 +24,13 @@ CCVSsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("CURRENT CONTROLLED VOLTAGE SOURCES-----------------\n"); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCVSnextModel ) { + for( ; model != NULL; model = CCVSnextModel(model)) { printf("Model name:%s\n",model->CCVSmodName); /* loop through all the instances of the model */ - for (here = model->CCVSinstances; here != NULL ; - here=here->CCVSnextInstance) { + for (here = CCVSinstances(model); here != NULL ; + here=CCVSnextInstance(here)) { printf(" Instance name:%s\n",here->CCVSname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/ccvs/ccvssset.c b/src/spicelib/devices/ccvs/ccvssset.c index ad1c3bb08..62c33bce0 100644 --- a/src/spicelib/devices/ccvs/ccvssset.c +++ b/src/spicelib/devices/ccvs/ccvssset.c @@ -23,11 +23,11 @@ CCVSsSetup(SENstruct *info, GENmodel *inModel) CCVSinstance *here; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->CCVSnextModel ) { + for( ; model != NULL; model = CCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CCVSinstances; here != NULL ; - here=here->CCVSnextInstance) { + for (here = CCVSinstances(model); here != NULL ; + here=CCVSnextInstance(here)) { if(here->CCVSsenParmNo){ here->CCVSsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/cpl/cplload.c b/src/spicelib/devices/cpl/cplload.c index b24de76cb..9a8e06ba9 100644 --- a/src/spicelib/devices/cpl/cplload.c +++ b/src/spicelib/devices/cpl/cplload.c @@ -70,9 +70,9 @@ CPLload(GENmodel *inModel, CKTcircuit *ckt) gmin = 0.1 * ckt->CKTgmin; /* dc solution */ - for( ; model != NULL; model = model->CPLnextModel ) { - for (here = model->CPLinstances; here != NULL ; - here=here->CPLnextInstance) { + for( ; model != NULL; model = CPLnextModel(model)) { + for (here = CPLinstances(model); here != NULL ; + here=CPLnextInstance(here)) { cp = here->cplines; @@ -123,11 +123,11 @@ CPLload(GENmodel *inModel, CKTcircuit *ckt) model = (CPLmodel *)inModel; /* loop through all the models */ - for( ; model != NULL; model = model->CPLnextModel ) { + for( ; model != NULL; model = CPLnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CPLinstances; here != NULL ; - here=here->CPLnextInstance) { + for (here = CPLinstances(model); here != NULL ; + here=CPLnextInstance(here)) { double mintaul = 123456789.0; @@ -157,7 +157,7 @@ CPLload(GENmodel *inModel, CKTcircuit *ckt) for (m = 0; m < noL; m++) { if (here->CPLlengthGiven) g = model->Rm[resindex] * here->CPLlength; - else g = model->Rm[resindex] * here->CPLmodPtr->length; + else g = model->Rm[resindex] * CPLmodPtr(here)->length; *(here->CPLposIbr1Ptr[m]) += 1.0; *(here->CPLnegIbr2Ptr[m]) += 1.0; *(here->CPLibr1Ibr1Ptr[m]) += 1.0; diff --git a/src/spicelib/devices/cpl/cplsetup.c b/src/spicelib/devices/cpl/cplsetup.c index ac5026aa4..1989ecec9 100644 --- a/src/spicelib/devices/cpl/cplsetup.c +++ b/src/spicelib/devices/cpl/cplsetup.c @@ -147,7 +147,7 @@ CPLsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) NG_IGNORE(state); /* loop through all the models */ - for( ; model != NULL; model = model->CPLnextModel ) { + for( ; model != NULL; model = CPLnextModel(model)) { if (!model->Rmgiven) { SPfrontEnd->IFerrorf (ERR_FATAL, @@ -176,8 +176,8 @@ CPLsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) } /* loop through all the instances of the model */ - for (here = model->CPLinstances; here != NULL ; - here=here->CPLnextInstance) { + for (here = CPLinstances(model); here != NULL ; + here=CPLnextInstance(here)) { if (!here->CPLlengthGiven) here->CPLlength=0.0; @@ -299,9 +299,9 @@ CPLunsetup(GENmodel *inModel, CKTcircuit *ckt) int noL; for (model = (CPLmodel *) inModel; model != NULL; - model = model->CPLnextModel) { - for (here = model->CPLinstances; here != NULL; - here = here->CPLnextInstance) { + model = CPLnextModel(model)) { + for (here = CPLinstances(model); here != NULL; + here = CPLnextInstance(here)) { noL = here->dimension; @@ -418,18 +418,18 @@ ReadCpL(CPLinstance *here, CKTcircuit *ckt) C_m[i][j] = C_m[j][i]; L_m[i][j] = L_m[j][i]; } else { - f = here->CPLmodPtr->Rm[counter]; - R_m[i][j] = here->CPLmodPtr->Rm[counter] = MAX(f, 1.0e-4); - G_m[i][j] = here->CPLmodPtr->Gm[counter]; - L_m[i][j] = here->CPLmodPtr->Lm[counter]; - C_m[i][j] = here->CPLmodPtr->Cm[counter]; + f = CPLmodPtr(here)->Rm[counter]; + R_m[i][j] = CPLmodPtr(here)->Rm[counter] = MAX(f, 1.0e-4); + G_m[i][j] = CPLmodPtr(here)->Gm[counter]; + L_m[i][j] = CPLmodPtr(here)->Lm[counter]; + C_m[i][j] = CPLmodPtr(here)->Cm[counter]; counter++; } } } if (here->CPLlengthGiven) length = here->CPLlength; - else length = here->CPLmodPtr->length; + else length = CPLmodPtr(here)->length; for (i = 0; i < noL; i++) lines[i]->g = 1.0 / (R_m[i][i] * length); diff --git a/src/spicelib/devices/csw/cswacld.c b/src/spicelib/devices/csw/cswacld.c index d7b7daa40..844021ea9 100644 --- a/src/spicelib/devices/csw/cswacld.c +++ b/src/spicelib/devices/csw/cswacld.c @@ -26,11 +26,11 @@ CSWacLoad(GENmodel *inModel, CKTcircuit *ckt) int current_state; /* loop through all the switch models */ - for( ; model != NULL; model = model->CSWnextModel ) { + for( ; model != NULL; model = CSWnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CSWinstances; here != NULL ; - here=here->CSWnextInstance) { + for (here = CSWinstances(model); here != NULL ; + here=CSWnextInstance(here)) { current_state = (int)*(ckt->CKTstate0 + here->CSWstate); diff --git a/src/spicelib/devices/csw/cswload.c b/src/spicelib/devices/csw/cswload.c index dedd8f2f4..473bee330 100644 --- a/src/spicelib/devices/csw/cswload.c +++ b/src/spicelib/devices/csw/cswload.c @@ -31,11 +31,11 @@ CSWload(GENmodel *inModel, CKTcircuit *ckt) /* switch is on or off while control value is in hysteresis region. */ /* loop through all the switch models */ - for( ; model != NULL; model = model->CSWnextModel ) { + for( ; model != NULL; model = CSWnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CSWinstances; here != NULL ; - here=here->CSWnextInstance) { + for (here = CSWinstances(model); here != NULL ; + here=CSWnextInstance(here)) { old_current_state = *(ckt->CKTstates[0] + here->CSWstate); previous_state = *(ckt->CKTstates[1] + here->CSWstate); diff --git a/src/spicelib/devices/csw/cswnoise.c b/src/spicelib/devices/csw/cswnoise.c index a6969c499..81c4700e7 100644 --- a/src/spicelib/devices/csw/cswnoise.c +++ b/src/spicelib/devices/csw/cswnoise.c @@ -36,8 +36,8 @@ CSWnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *d int current_state; - for (model=firstModel; model != NULL; model=model->CSWnextModel) { - for (inst=model->CSWinstances; inst != NULL; inst=inst->CSWnextInstance) { + for (model=firstModel; model != NULL; model=CSWnextModel(model)) { + for (inst=CSWinstances(model); inst != NULL; inst=CSWnextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/csw/cswpzld.c b/src/spicelib/devices/csw/cswpzld.c index 74641c641..766d8a69f 100644 --- a/src/spicelib/devices/csw/cswpzld.c +++ b/src/spicelib/devices/csw/cswpzld.c @@ -30,11 +30,11 @@ CSWpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(s); /* loop through all the switch models */ - for( ; model != NULL; model = model->CSWnextModel ) { + for( ; model != NULL; model = CSWnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->CSWinstances; here != NULL ; - here=here->CSWnextInstance) { + for (here = CSWinstances(model); here != NULL ; + here=CSWnextInstance(here)) { current_state = (int)*(ckt->CKTstate0 + here->CSWstate); diff --git a/src/spicelib/devices/csw/cswsetup.c b/src/spicelib/devices/csw/cswsetup.c index d334276c1..edb09ff8c 100644 --- a/src/spicelib/devices/csw/cswsetup.c +++ b/src/spicelib/devices/csw/cswsetup.c @@ -23,7 +23,7 @@ CSWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CSWinstance *here; /* loop through all the current source models */ - for( ; model != NULL; model = model->CSWnextModel ) { + for( ; model != NULL; model = CSWnextModel(model)) { /* Default Value Processing for Switch Model */ if (!model->CSWthreshGiven) { model->CSWiThreshold = 0; @@ -41,8 +41,8 @@ CSWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->CSWinstances; here != NULL ; - here=here->CSWnextInstance) { + for (here = CSWinstances(model); here != NULL ; + here=CSWnextInstance(here)) { /* Default Value Processing for Switch Instance */ here->CSWstate = *states; diff --git a/src/spicelib/devices/csw/cswtrunc.c b/src/spicelib/devices/csw/cswtrunc.c index 415f57c16..150a0dec2 100644 --- a/src/spicelib/devices/csw/cswtrunc.c +++ b/src/spicelib/devices/csw/cswtrunc.c @@ -21,9 +21,9 @@ CSWtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) double lastChange, maxChange, maxStep, ref; - for( ; model!= NULL; model = model->CSWnextModel) { - for(here = model->CSWinstances ; here != NULL ; - here = here->CSWnextInstance) { + for( ; model!= NULL; model = CSWnextModel(model)) { + for(here = CSWinstances(model); here != NULL ; + here = CSWnextInstance(here)) { lastChange = *(ckt->CKTstate0+(here->CSWstate+1)) - *(ckt->CKTstate1+(here->CSWstate+1)); if (*(ckt->CKTstate0+(here->CSWstate))==0) { diff --git a/src/spicelib/devices/dio/dioacld.c b/src/spicelib/devices/dio/dioacld.c index 9adfa80b7..03f541392 100644 --- a/src/spicelib/devices/dio/dioacld.c +++ b/src/spicelib/devices/dio/dioacld.c @@ -23,11 +23,11 @@ DIOacLoad(GENmodel *inModel, CKTcircuit *ckt) DIOinstance *here; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { gspr=here->DIOtConductance*here->DIOarea; geq= *(ckt->CKTstate0 + here->DIOconduct); xceq= *(ckt->CKTstate0 + here->DIOcapCurrent) * ckt->CKTomega; diff --git a/src/spicelib/devices/dio/dioconv.c b/src/spicelib/devices/dio/dioconv.c index faf84aae5..949f412dd 100644 --- a/src/spicelib/devices/dio/dioconv.c +++ b/src/spicelib/devices/dio/dioconv.c @@ -22,11 +22,11 @@ DIOconvTest(GENmodel *inModel, CKTcircuit *ckt) double delvd,vd,cdhat,cd; double tol; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { /* * initialization diff --git a/src/spicelib/devices/dio/diodisto.c b/src/spicelib/devices/dio/diodisto.c index a0eed3f05..659bf39ce 100644 --- a/src/spicelib/devices/dio/diodisto.c +++ b/src/spicelib/devices/dio/diodisto.c @@ -37,11 +37,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the DIO models */ -for( ; model != NULL; model = model->DIOnextModel ) { +for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/dio/diodset.c b/src/spicelib/devices/dio/diodset.c index ccf288d16..eff1f298b 100644 --- a/src/spicelib/devices/dio/diodset.c +++ b/src/spicelib/devices/dio/diodset.c @@ -45,11 +45,11 @@ DIOdSetup(DIOmodel *model, CKTcircuit *ckt) double cjunc1SW,cjunc2SW,cjunc3SW; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { /* * this routine loads diodes for dc and transient analyses. diff --git a/src/spicelib/devices/dio/diogetic.c b/src/spicelib/devices/dio/diogetic.c index f2c4ef0dc..4a1335cdd 100644 --- a/src/spicelib/devices/dio/diogetic.c +++ b/src/spicelib/devices/dio/diogetic.c @@ -22,8 +22,8 @@ DIOgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->DIOnextModel) { - for(here = model->DIOinstances; here ; here = here->DIOnextInstance) { + for( ; model ; model = DIOnextModel(model)) { + for(here = DIOinstances(model); here ; here = DIOnextInstance(here)) { if(!here->DIOinitCondGiven) { here->DIOinitCond = diff --git a/src/spicelib/devices/dio/dioload.c b/src/spicelib/devices/dio/dioload.c index b39a1b0e6..bc2bb94c9 100644 --- a/src/spicelib/devices/dio/dioload.c +++ b/src/spicelib/devices/dio/dioload.c @@ -63,11 +63,11 @@ DIOload(GENmodel *inModel, CKTcircuit *ckt) double diffcharge, diffchargeSW, deplcharge, deplchargeSW, diffcap, diffcapSW, deplcap, deplcapSW; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { /* * this routine loads diodes for dc and transient analyses. diff --git a/src/spicelib/devices/dio/dionoise.c b/src/spicelib/devices/dio/dionoise.c index 3655266ca..dcdadc4e3 100644 --- a/src/spicelib/devices/dio/dionoise.c +++ b/src/spicelib/devices/dio/dionoise.c @@ -46,8 +46,8 @@ DIOnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total diode noise */ }; - for (model=firstModel; model != NULL; model=model->DIOnextModel) { - for (inst=model->DIOinstances; inst != NULL; inst=inst->DIOnextInstance) { + for (model=firstModel; model != NULL; model=DIOnextModel(model)) { + for (inst=DIOinstances(model); inst != NULL; inst=DIOnextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/dio/diopzld.c b/src/spicelib/devices/dio/diopzld.c index 317009fa8..dcc98e35e 100644 --- a/src/spicelib/devices/dio/diopzld.c +++ b/src/spicelib/devices/dio/diopzld.c @@ -24,11 +24,11 @@ DIOpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) DIOinstance *here; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { gspr=here->DIOtConductance*here->DIOarea; geq= *(ckt->CKTstate0 + here->DIOconduct); xceq= *(ckt->CKTstate0 + here->DIOcapCurrent); diff --git a/src/spicelib/devices/dio/diosacl.c b/src/spicelib/devices/dio/diosacl.c index 9ad2c6778..1232ac527 100644 --- a/src/spicelib/devices/dio/diosacl.c +++ b/src/spicelib/devices/dio/diosacl.c @@ -72,11 +72,11 @@ DIOsAcLoad(GENmodel *inModel, CKTcircuit *ckt) info = ckt->CKTsenInfo; info->SENstatus = PERTURBATION; /* loop through all the models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { /* save the unperturbed values in the state vector */ for(i=0; i <= 4; i++) { diff --git a/src/spicelib/devices/dio/diosetup.c b/src/spicelib/devices/dio/diosetup.c index 3ef214e74..e06b13ba1 100644 --- a/src/spicelib/devices/dio/diosetup.c +++ b/src/spicelib/devices/dio/diosetup.c @@ -25,7 +25,7 @@ DIOsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { if(!model->DIOlevelGiven) { model->DIOlevel = 1; @@ -161,8 +161,8 @@ DIOsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { if(!here->DIOareaGiven) { if((!here->DIOwGiven) && (!here->DIOlGiven)) { @@ -250,10 +250,10 @@ DIOunsetup( DIOinstance *here; for (model = (DIOmodel *)inModel; model != NULL; - model = model->DIOnextModel) + model = DIOnextModel(model)) { - for (here = model->DIOinstances; here != NULL; - here=here->DIOnextInstance) + for (here = DIOinstances(model); here != NULL; + here=DIOnextInstance(here)) { if (here->DIOposPrimeNode > 0 diff --git a/src/spicelib/devices/dio/diosload.c b/src/spicelib/devices/dio/diosload.c index 2a173501e..bd9e1d0ce 100644 --- a/src/spicelib/devices/dio/diosload.c +++ b/src/spicelib/devices/dio/diosload.c @@ -63,11 +63,11 @@ DIOsLoad(GENmodel *inModel, CKTcircuit *ckt) #endif /* SENSDEBUG */ /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { #ifdef SENSDEBUG fprintf(stdout,"pos = %d , posprm = %d ,neg = %d, senparmno = %d\n", diff --git a/src/spicelib/devices/dio/diosoachk.c b/src/spicelib/devices/dio/diosoachk.c index f1ed25980..410c00996 100644 --- a/src/spicelib/devices/dio/diosoachk.c +++ b/src/spicelib/devices/dio/diosoachk.c @@ -29,9 +29,9 @@ DIOsoaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->DIOnextModel) { + for (; model; model = DIOnextModel(model)) { - for (here = model->DIOinstances; here; here = here->DIOnextInstance) { + for (here = DIOinstances(model); here; here = DIOnextInstance(here)) { vd = ckt->CKTrhsOld [here->DIOposPrimeNode] - ckt->CKTrhsOld [here->DIOnegNode]; diff --git a/src/spicelib/devices/dio/diosprt.c b/src/spicelib/devices/dio/diosprt.c index 00bac9aa4..6d94972fa 100644 --- a/src/spicelib/devices/dio/diosprt.c +++ b/src/spicelib/devices/dio/diosprt.c @@ -27,13 +27,13 @@ DIOsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("DIOS-----------------\n"); /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { printf("Model name:%s\n",model->DIOmodName); /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { printf(" Instance name:%s\n",here->DIOname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/dio/diosset.c b/src/spicelib/devices/dio/diosset.c index 90b0b5e89..7ef98e836 100644 --- a/src/spicelib/devices/dio/diosset.c +++ b/src/spicelib/devices/dio/diosset.c @@ -26,11 +26,11 @@ DIOsSetup(SENstruct *info, GENmodel *inModel) DIOinstance *here; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { if(here->DIOsenParmNo){ here->DIOsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/dio/diosupd.c b/src/spicelib/devices/dio/diosupd.c index a251196c9..cbba251bd 100644 --- a/src/spicelib/devices/dio/diosupd.c +++ b/src/spicelib/devices/dio/diosupd.c @@ -42,11 +42,11 @@ DIOsUpdate(GENmodel *inModel, CKTcircuit *ckt) #endif /* SENSDEBUG */ /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->DIOinstances; here != NULL ; - here=here->DIOnextInstance) { + for (here = DIOinstances(model); here != NULL ; + here=DIOnextInstance(here)) { #ifdef SENSDEBUG printf("capd = %.7e \n",here->DIOcap); diff --git a/src/spicelib/devices/dio/diotemp.c b/src/spicelib/devices/dio/diotemp.c index f29581189..ef588e25d 100644 --- a/src/spicelib/devices/dio/diotemp.c +++ b/src/spicelib/devices/dio/diotemp.c @@ -33,7 +33,7 @@ DIOtemp(GENmodel *inModel, CKTcircuit *ckt) double tBreakdownVoltage; /* loop through all the diode models */ - for( ; model != NULL; model = model->DIOnextModel ) { + for( ; model != NULL; model = DIOnextModel(model)) { if(!model->DIOnomTempGiven) { model->DIOnomTemp = ckt->CKTnomTemp; } @@ -70,7 +70,7 @@ DIOtemp(GENmodel *inModel, CKTcircuit *ckt) xfc=log(1-model->DIOdepletionCapCoeff); xfcs=log(1-model->DIOdepletionSWcapCoeff); - for(here=model->DIOinstances;here;here=here->DIOnextInstance) { + for(here=DIOinstances(model);here;here=DIOnextInstance(here)) { double egfet1,arg1,fact1,pbfact1,pbo,gmaold,pboSW,gmaSWold; double fact2,pbfact,arg,egfet,gmanew,gmaSWnew; /* loop through all the instances */ diff --git a/src/spicelib/devices/dio/diotrunc.c b/src/spicelib/devices/dio/diotrunc.c index c61954e36..5c64086f9 100644 --- a/src/spicelib/devices/dio/diotrunc.c +++ b/src/spicelib/devices/dio/diotrunc.c @@ -18,8 +18,8 @@ DIOtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) DIOmodel *model = (DIOmodel*)inModel; DIOinstance *here; - for( ; model != NULL; model = model->DIOnextModel) { - for(here=model->DIOinstances;here!=NULL;here = here->DIOnextInstance){ + for( ; model != NULL; model = DIOnextModel(model)) { + for(here=DIOinstances(model);here!=NULL;here = DIOnextInstance(here)){ CKTterr(here->DIOcapCharge,ckt,timeStep); } } diff --git a/src/spicelib/devices/hfet1/hfetacl.c b/src/spicelib/devices/hfet1/hfetacl.c index 781f4822a..727a3eed2 100644 --- a/src/spicelib/devices/hfet1/hfetacl.c +++ b/src/spicelib/devices/hfet1/hfetacl.c @@ -28,10 +28,10 @@ HFETAacLoad(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->HFETAnextModel ) + for( ; model != NULL; model = HFETAnextModel(model)) { - for( here = model->HFETAinstances; here != NULL; - here = here->HFETAnextInstance) { + for( here = HFETAinstances(model); here != NULL; + here = HFETAnextInstance(here)) { gm = *(ckt->CKTstate0 + here->HFETAgm); gds = *(ckt->CKTstate0 + here->HFETAgds); diff --git a/src/spicelib/devices/hfet1/hfetgetic.c b/src/spicelib/devices/hfet1/hfetgetic.c index 2397cea03..26ef89b72 100644 --- a/src/spicelib/devices/hfet1/hfetgetic.c +++ b/src/spicelib/devices/hfet1/hfetgetic.c @@ -20,8 +20,8 @@ HFETAgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->HFETAnextModel) { - for(here = model->HFETAinstances; here ; here = here->HFETAnextInstance) { + for( ; model ; model = HFETAnextModel(model)) { + for(here = HFETAinstances(model); here ; here = HFETAnextInstance(here)) { if(!here->HFETAicVDSGiven) { here->HFETAicVDS = diff --git a/src/spicelib/devices/hfet1/hfetload.c b/src/spicelib/devices/hfet1/hfetload.c index 4e93bb3ad..c3c9c0530 100644 --- a/src/spicelib/devices/hfet1/hfetload.c +++ b/src/spicelib/devices/hfet1/hfetload.c @@ -86,9 +86,9 @@ int HFETAload(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->HFETAnextModel ) { - for (here = model->HFETAinstances; here != NULL ; - here=here->HFETAnextInstance) { + for( ; model != NULL; model = HFETAnextModel(model)) { + for (here = HFETAinstances(model); here != NULL ; + here=HFETAnextInstance(here)) { vcrit = here->HFETAvcrit; vt = CONSTKoverQ * here->HFETAtemp; diff --git a/src/spicelib/devices/hfet1/hfetpzl.c b/src/spicelib/devices/hfet1/hfetpzl.c index 2bbae145d..444f7484c 100644 --- a/src/spicelib/devices/hfet1/hfetpzl.c +++ b/src/spicelib/devices/hfet1/hfetpzl.c @@ -31,10 +31,10 @@ HFETApzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double m; - for( ; model != NULL; model = model->HFETAnextModel ) + for( ; model != NULL; model = HFETAnextModel(model)) { - for( here = model->HFETAinstances; here != NULL; - here = here->HFETAnextInstance) { + for( here = HFETAinstances(model); here != NULL; + here = HFETAnextInstance(here)) { gm = *(ckt->CKTstate0 + here->HFETAgm); gds = *(ckt->CKTstate0 + here->HFETAgds); diff --git a/src/spicelib/devices/hfet1/hfetsetup.c b/src/spicelib/devices/hfet1/hfetsetup.c index 845f67296..fa29ef325 100644 --- a/src/spicelib/devices/hfet1/hfetsetup.c +++ b/src/spicelib/devices/hfet1/hfetsetup.c @@ -29,7 +29,7 @@ HFETAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the diode models */ - for( ; model != NULL; model = model->HFETAnextModel ) { + for( ; model != NULL; model = HFETAnextModel(model)) { if( (model->HFETAtype != NHFET) && (model->HFETAtype != PHFET) ) { model->HFETAtype = NHFET; } @@ -229,8 +229,8 @@ HFETAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) KVTO = 0; /* loop through all the instances of the model */ - for (here = model->HFETAinstances; here != NULL ; - here=here->HFETAnextInstance) { + for (here = HFETAinstances(model); here != NULL ; + here=HFETAnextInstance(here)) { if(!here->HFETAlengthGiven) { here->HFETAlength = 1e-6; @@ -407,10 +407,10 @@ HFETAunsetup(GENmodel *inModel, CKTcircuit *ckt) HFETAinstance *here; for (model = (HFETAmodel *)inModel; model != NULL; - model = model->HFETAnextModel) + model = HFETAnextModel(model)) { - for (here = model->HFETAinstances; here != NULL; - here=here->HFETAnextInstance) + for (here = HFETAinstances(model); here != NULL; + here=HFETAnextInstance(here)) { if (here->HFETAsourcePrmPrmNode > 0 && here->HFETAsourcePrmPrmNode != here->HFETAsourcePrimeNode) diff --git a/src/spicelib/devices/hfet1/hfettemp.c b/src/spicelib/devices/hfet1/hfettemp.c index 613d440cc..6970f8539 100644 --- a/src/spicelib/devices/hfet1/hfettemp.c +++ b/src/spicelib/devices/hfet1/hfettemp.c @@ -22,7 +22,7 @@ HFETAtemp(GENmodel *inModel, CKTcircuit *ckt) double temp; /* loop through all the diode models */ - for( ; model != NULL; model = model->HFETAnextModel ) { + for( ; model != NULL; model = HFETAnextModel(model)) { if(model->HFETArd != 0) { model->HFETAdrainConduct = 1/model->HFETArd; } else { @@ -56,8 +56,8 @@ HFETAtemp(GENmodel *inModel, CKTcircuit *ckt) if(!model->HFETAvt1Given) IN_VT1 = VTO+CHARGE*NMAX*DI/EPSI; - for (here = model->HFETAinstances; here != NULL ; - here=here->HFETAnextInstance) { + for (here = HFETAinstances(model); here != NULL ; + here=HFETAnextInstance(here)) { if(!here->HFETAdtempGiven) { here->HFETAdtemp = 0.0; diff --git a/src/spicelib/devices/hfet1/hfettrunc.c b/src/spicelib/devices/hfet1/hfettrunc.c index afa39dc5f..7670ddd42 100644 --- a/src/spicelib/devices/hfet1/hfettrunc.c +++ b/src/spicelib/devices/hfet1/hfettrunc.c @@ -16,8 +16,8 @@ HFETAtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) HFETAmodel *model = (HFETAmodel*)inModel; HFETAinstance *here; - for( ; model != NULL; model = model->HFETAnextModel) { - for(here=model->HFETAinstances;here!=NULL;here = here->HFETAnextInstance){ + for( ; model != NULL; model = HFETAnextModel(model)) { + for(here=HFETAinstances(model);here!=NULL;here = HFETAnextInstance(here)){ CKTterr(here->HFETAqgs,ckt,timeStep); CKTterr(here->HFETAqgd,ckt,timeStep); diff --git a/src/spicelib/devices/hfet2/hfet2acl.c b/src/spicelib/devices/hfet2/hfet2acl.c index ec4151b8e..073f35353 100644 --- a/src/spicelib/devices/hfet2/hfet2acl.c +++ b/src/spicelib/devices/hfet2/hfet2acl.c @@ -26,10 +26,10 @@ int HFET2acLoad(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->HFET2nextModel ) + for( ; model != NULL; model = HFET2nextModel(model)) { - for( here = model->HFET2instances; here != NULL; - here = here->HFET2nextInstance) { + for( here = HFET2instances(model); here != NULL; + here = HFET2nextInstance(here)) { m = here->HFET2m; diff --git a/src/spicelib/devices/hfet2/hfet2getic.c b/src/spicelib/devices/hfet2/hfet2getic.c index 6622953c1..d605d9053 100644 --- a/src/spicelib/devices/hfet2/hfet2getic.c +++ b/src/spicelib/devices/hfet2/hfet2getic.c @@ -16,8 +16,8 @@ int HFET2getic(GENmodel *inModel, CKTcircuit *ckt) HFET2model *model = (HFET2model*)inModel; HFET2instance *here; - for( ; model ; model = model->HFET2nextModel) { - for(here = model->HFET2instances; here ; here = here->HFET2nextInstance) { + for( ; model ; model = HFET2nextModel(model)) { + for(here = HFET2instances(model); here ; here = HFET2nextInstance(here)) { if(!here->HFET2icVDSGiven) { here->HFET2icVDS = *(ckt->CKTrhs + here->HFET2drainNode) - diff --git a/src/spicelib/devices/hfet2/hfet2load.c b/src/spicelib/devices/hfet2/hfet2load.c index b6b9a7eca..ad891e435 100644 --- a/src/spicelib/devices/hfet2/hfet2load.c +++ b/src/spicelib/devices/hfet2/hfet2load.c @@ -64,9 +64,9 @@ int HFET2load(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->HFET2nextModel ) { - for(here = model->HFET2instances; here != NULL; - here=here->HFET2nextInstance) { + for( ; model != NULL; model = HFET2nextModel(model)) { + for(here = HFET2instances(model); here != NULL; + here=HFET2nextInstance(here)) { gdpr = model->HFET2drainConduct; gspr = model->HFET2sourceConduct; diff --git a/src/spicelib/devices/hfet2/hfet2pzl.c b/src/spicelib/devices/hfet2/hfet2pzl.c index 10e5c6dc9..4c56d3d62 100644 --- a/src/spicelib/devices/hfet2/hfet2pzl.c +++ b/src/spicelib/devices/hfet2/hfet2pzl.c @@ -28,10 +28,10 @@ int HFET2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double m; - for( ; model != NULL; model = model->HFET2nextModel ) + for( ; model != NULL; model = HFET2nextModel(model)) { - for( here = model->HFET2instances; here != NULL; - here = here->HFET2nextInstance) { + for( here = HFET2instances(model); here != NULL; + here = HFET2nextInstance(here)) { m = here->HFET2m; diff --git a/src/spicelib/devices/hfet2/hfet2setup.c b/src/spicelib/devices/hfet2/hfet2setup.c index dc267a3f1..cb51d3a7c 100644 --- a/src/spicelib/devices/hfet2/hfet2setup.c +++ b/src/spicelib/devices/hfet2/hfet2setup.c @@ -20,7 +20,7 @@ int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state int error; CKTnode *tmp; - for( ; model != NULL; model = model->HFET2nextModel ) { + for( ; model != NULL; model = HFET2nextModel(model)) { if((TYPE != NHFET) && (TYPE != PHFET) ) TYPE = NHFET; if(!model->HFET2cfGiven) @@ -120,8 +120,8 @@ int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state /* loop through all the instances of the model */ - for (here = model->HFET2instances; here != NULL; - here=here->HFET2nextInstance) { + for (here = HFET2instances(model); here != NULL; + here=HFET2nextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -211,10 +211,10 @@ HFET2unsetup(GENmodel *inModel, CKTcircuit *ckt) HFET2instance *here; for (model = (HFET2model *)inModel; model != NULL; - model = model->HFET2nextModel) + model = HFET2nextModel(model)) { - for (here = model->HFET2instances; here != NULL; - here=here->HFET2nextInstance) + for (here = HFET2instances(model); here != NULL; + here=HFET2nextInstance(here)) { if (here->HFET2drainPrimeNode > 0 && here->HFET2drainPrimeNode != here->HFET2drainNode) diff --git a/src/spicelib/devices/hfet2/hfet2temp.c b/src/spicelib/devices/hfet2/hfet2temp.c index 0e9d8b2a0..40492fd70 100644 --- a/src/spicelib/devices/hfet2/hfet2temp.c +++ b/src/spicelib/devices/hfet2/hfet2temp.c @@ -22,7 +22,7 @@ CKTcircuit *ckt) double vt; double tdiff; - for( ; model != NULL; model = model->HFET2nextModel ) { + for( ; model != NULL; model = HFET2nextModel(model)) { if(model->HFET2rd != 0) model->HFET2drainConduct = 1/model->HFET2rd; else @@ -36,8 +36,8 @@ CKTcircuit *ckt) if(!model->HFET2vt2Given) VT2 = VTO; DELTA2 = DELTA*DELTA; - for (here = model->HFET2instances; here != NULL; - here=here->HFET2nextInstance) { + for (here = HFET2instances(model); here != NULL; + here=HFET2nextInstance(here)) { if(!here->HFET2dtempGiven) here->HFET2dtemp = 0.0; diff --git a/src/spicelib/devices/hfet2/hfet2trunc.c b/src/spicelib/devices/hfet2/hfet2trunc.c index aa7d0bfd6..abe00f969 100644 --- a/src/spicelib/devices/hfet2/hfet2trunc.c +++ b/src/spicelib/devices/hfet2/hfet2trunc.c @@ -15,9 +15,9 @@ double *tiHFET2tep) HFET2model *model = (HFET2model*)inModel; HFET2instance *here; - for( ; model != NULL; model = model->HFET2nextModel) { - for(here=model->HFET2instances;here!=NULL; - here = here->HFET2nextInstance){ + for( ; model != NULL; model = HFET2nextModel(model)) { + for(here=HFET2instances(model);here!=NULL; + here = HFET2nextInstance(here)){ CKTterr(here->HFET2qgs,ckt,tiHFET2tep); CKTterr(here->HFET2qgd,ckt,tiHFET2tep); diff --git a/src/spicelib/devices/hisim2/hsm2acld.c b/src/spicelib/devices/hisim2/hsm2acld.c index 1a8eda54b..4193597db 100644 --- a/src/spicelib/devices/hisim2/hsm2acld.c +++ b/src/spicelib/devices/hisim2/hsm2acld.c @@ -110,8 +110,8 @@ int HSM2acLoad( double cdbs_imag, cgbs_imag, csbs_imag, cbbs_imag; omega = ckt->CKTomega; - for ( ; model != NULL; model = model->HSM2nextModel ) { - for ( here = model->HSM2instances; here!= NULL; here = here->HSM2nextInstance ) { + for ( ; model != NULL; model = HSM2nextModel(model)) { + for ( here = HSM2instances(model); here!= NULL; here = HSM2nextInstance(here)) { gdpr = here->HSM2drainConductance; gspr = here->HSM2sourceConductance; diff --git a/src/spicelib/devices/hisim2/hsm2cvtest.c b/src/spicelib/devices/hisim2/hsm2cvtest.c index a847922fe..af3257ad8 100644 --- a/src/spicelib/devices/hisim2/hsm2cvtest.c +++ b/src/spicelib/devices/hisim2/hsm2cvtest.c @@ -74,10 +74,10 @@ int HSM2convTest( double Ibtot, cbhat, Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; /* loop through all the HSM2 device models */ - for ( ; model != NULL; model = model->HSM2nextModel ) { + for ( ; model != NULL; model = HSM2nextModel(model)) { /* loop through all the instances of the model */ - for ( here = model->HSM2instances; here != NULL ; - here = here->HSM2nextInstance ) { + for ( here = HSM2instances(model); here != NULL ; + here = HSM2nextInstance(here)) { vbs = model->HSM2_type * (*(ckt->CKTrhsOld+here->HSM2bNode) - *(ckt->CKTrhsOld+here->HSM2sNodePrime)); diff --git a/src/spicelib/devices/hisim2/hsm2getic.c b/src/spicelib/devices/hisim2/hsm2getic.c index 22a06a7ed..1db04b2ee 100644 --- a/src/spicelib/devices/hisim2/hsm2getic.c +++ b/src/spicelib/devices/hisim2/hsm2getic.c @@ -71,8 +71,8 @@ int HSM2getic( * external nodes to get values */ - for ( ;model ;model = model->HSM2nextModel ) { - for ( here = model->HSM2instances; here ;here = here->HSM2nextInstance ) { + for ( ;model ;model = HSM2nextModel(model)) { + for ( here = HSM2instances(model); here ;here = HSM2nextInstance(here)) { if (!here->HSM2_icVBS_Given) { here->HSM2_icVBS = *(ckt->CKTrhs + here->HSM2bNode) - diff --git a/src/spicelib/devices/hisim2/hsm2ld.c b/src/spicelib/devices/hisim2/hsm2ld.c index 3cc6f32c5..e7869f02e 100644 --- a/src/spicelib/devices/hisim2/hsm2ld.c +++ b/src/spicelib/devices/hisim2/hsm2ld.c @@ -247,7 +247,7 @@ int HSM2load( int HSM2LoadOMP(HSM2instance *here, CKTcircuit *ckt) { - HSM2model *model = here->HSM2modPtr; + HSM2model *model = HSM2modPtr(here); #else HSM2model *model = (HSM2model*)inModel; HSM2instance *here; @@ -307,7 +307,7 @@ tm0 = gtodsecld() ; model->HSM2_bypass_enable = BYPASS_enable ; #else /* loop through all the HSM2 device models */ - for ( ; model != NULL; model = model->HSM2nextModel ) { + for ( ; model != NULL; model = HSM2nextModel(model)) { /* loop through all the instances of the model */ reltol = ckt->CKTreltol * BYP_TOL_FACTOR ; @@ -316,8 +316,8 @@ tm0 = gtodsecld() ; BYPASS_enable = (BYP_TOL_FACTOR > 0.0 && ckt->CKTbypass) ; model->HSM2_bypass_enable = BYPASS_enable ; - for (here = model->HSM2instances; here != NULL ; - here = here->HSM2nextInstance) { + for (here = HSM2instances(model); here != NULL ; + here = HSM2nextInstance(here)) { #endif /* pParam = &here->pParam ;*/ showPhysVal = 0; @@ -1502,7 +1502,7 @@ void HSM2LoadRhsMat(GENmodel *inModel, CKTcircuit *ckt) for (idx = 0; idx < InstCount; idx++) { here = InstArray[idx]; - model = here->HSM2modPtr; + model = HSM2modPtr(here); /* Update b for Ax = b */ *(ckt->CKTrhs + here->HSM2dNodePrime) += here->HSM2rhsdPrime; *(ckt->CKTrhs + here->HSM2gNodePrime) -= here->HSM2rhsgPrime; diff --git a/src/spicelib/devices/hisim2/hsm2noi.c b/src/spicelib/devices/hisim2/hsm2noi.c index 3746450b6..dff810e4b 100644 --- a/src/spicelib/devices/hisim2/hsm2noi.c +++ b/src/spicelib/devices/hisim2/hsm2noi.c @@ -109,9 +109,9 @@ int HSM2noise ( "" /* total transistor noise */ }; - for ( ;model != NULL; model = model->HSM2nextModel ) { - for ( here = model->HSM2instances; here != NULL; - here = here->HSM2nextInstance ) { + for ( ;model != NULL; model = HSM2nextModel(model)) { + for ( here = HSM2instances(model); here != NULL; + here = HSM2nextInstance(here)) { switch (operation) { case N_OPEN: /* see if we have to to produce a summary report */ diff --git a/src/spicelib/devices/hisim2/hsm2pzld.c b/src/spicelib/devices/hisim2/hsm2pzld.c index b40e9a3ec..2ae6886f7 100644 --- a/src/spicelib/devices/hisim2/hsm2pzld.c +++ b/src/spicelib/devices/hisim2/hsm2pzld.c @@ -44,9 +44,9 @@ int HSM2pzLoad( NG_IGNORE(ckt); - for ( ;model != NULL ;model = model->HSM2nextModel ) { - for ( here = model->HSM2instances ;here!= NULL ; - here = here->HSM2nextInstance ) { + for ( ;model != NULL ;model = HSM2nextModel(model)) { + for ( here = HSM2instances(model);here!= NULL ; + here = HSM2nextInstance(here)) { if ( here->HSM2_mode >= 0 ) { gm = here->HSM2_gm; gmbs = here->HSM2_gmbs; diff --git a/src/spicelib/devices/hisim2/hsm2set.c b/src/spicelib/devices/hisim2/hsm2set.c index 7b031aba7..c66a7ec71 100644 --- a/src/spicelib/devices/hisim2/hsm2set.c +++ b/src/spicelib/devices/hisim2/hsm2set.c @@ -120,7 +120,7 @@ int HSM2setup( #endif /* loop through all the HSM2 device models */ - for ( ;model != NULL ;model = model->HSM2nextModel ) { + for ( ;model != NULL ;model = HSM2nextModel(model)) { /* Default value Processing for HSM2 MOSFET Models */ if ( !model->HSM2_type_Given ) model->HSM2_type = NMOS ; @@ -811,8 +811,8 @@ int HSM2setup( modelMKS = &model->modelMKS ; /* loop through all the instances of the model */ - for ( here = model->HSM2instances ;here != NULL ; - here = here->HSM2nextInstance ) { + for ( here = HSM2instances(model);here != NULL ; + here = HSM2nextInstance(here)) { /* allocate a chunk of the state vector */ here->HSM2states = *states; if (model->HSM2_conqs) @@ -1267,11 +1267,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL /* loop through all the HSM2 device models to count the number of instances */ - for ( ; model != NULL; model = model->HSM2nextModel ) + for ( ; model != NULL; model = HSM2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->HSM2instances; here != NULL ; - here = here->HSM2nextInstance) + for (here = HSM2instances(model); here != NULL ; + here = HSM2nextInstance(here)) { InstCount++; } @@ -1284,11 +1284,11 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL model->HSM2InstCount = InstCount; model->HSM2InstanceArray = InstArray; idx = 0; - for ( ; model != NULL; model = model->HSM2nextModel ) + for ( ; model != NULL; model = HSM2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->HSM2instances; here != NULL ; - here = here->HSM2nextInstance) + for (here = HSM2instances(model); here != NULL ; + here = HSM2nextInstance(here)) { InstArray[idx] = here; idx++; @@ -1309,10 +1309,10 @@ HSM2unsetup( HSM2instance *here; for (model = (HSM2model *)inModel; model != NULL; - model = model->HSM2nextModel) + model = HSM2nextModel(model)) { - for (here = model->HSM2instances; here != NULL; - here=here->HSM2nextInstance) + for (here = HSM2instances(model); here != NULL; + here=HSM2nextInstance(here)) { if (here->HSM2sbNode > 0 && here->HSM2sbNode != here->HSM2bNode) diff --git a/src/spicelib/devices/hisim2/hsm2soachk.c b/src/spicelib/devices/hisim2/hsm2soachk.c index a7652d810..ae12d0f48 100644 --- a/src/spicelib/devices/hisim2/hsm2soachk.c +++ b/src/spicelib/devices/hisim2/hsm2soachk.c @@ -33,9 +33,9 @@ HSM2soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->HSM2nextModel) { + for (; model; model = HSM2nextModel(model)) { - for (here = model->HSM2instances; here; here = here->HSM2nextInstance) { + for (here = HSM2instances(model); here; here = HSM2nextInstance(here)) { vgs = ckt->CKTrhsOld [here->HSM2gNode] - ckt->CKTrhsOld [here->HSM2sNodePrime]; diff --git a/src/spicelib/devices/hisim2/hsm2temp.c b/src/spicelib/devices/hisim2/hsm2temp.c index 3728ffda9..2aa645a42 100644 --- a/src/spicelib/devices/hisim2/hsm2temp.c +++ b/src/spicelib/devices/hisim2/hsm2temp.c @@ -141,11 +141,11 @@ int HSM2temp( double T9, T9_dVb, Vgp, Vgs_min, Vfb, Vthp, Vth0; - for ( ;model ;model = model->HSM2nextModel ) { + for ( ;model ;model = HSM2nextModel(model)) { modelMKS = &model->modelMKS ; - for ( here = model->HSM2instances; here; here = here->HSM2nextInstance ) { + for ( here = HSM2instances(model); here; here = HSM2nextInstance(here)) { pParam = &here->pParam ; hereMKS = &here->hereMKS ; diff --git a/src/spicelib/devices/hisim2/hsm2trunc.c b/src/spicelib/devices/hisim2/hsm2trunc.c index ea27086ac..e18e605e5 100644 --- a/src/spicelib/devices/hisim2/hsm2trunc.c +++ b/src/spicelib/devices/hisim2/hsm2trunc.c @@ -71,9 +71,9 @@ int HSM2trunc( double debugtemp; #endif /* STEPDEBUG */ - for ( ;model != NULL ;model = model->HSM2nextModel ) { - for ( here=model->HSM2instances ;here!=NULL ; - here = here->HSM2nextInstance ) { + for ( ;model != NULL ;model = HSM2nextModel(model)) { + for ( here=HSM2instances(model);here!=NULL ; + here = HSM2nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; #endif /* STEPDEBUG */ diff --git a/src/spicelib/devices/hisimhv1/hsmhvacld.c b/src/spicelib/devices/hisimhv1/hsmhvacld.c index 9f2fcd180..45e6f828c 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvacld.c +++ b/src/spicelib/devices/hisimhv1/hsmhvacld.c @@ -49,8 +49,8 @@ int HSMHVacLoad( omega = ckt->CKTomega; - for ( ; model != NULL; model = model->HSMHVnextModel ) { - for ( here = model->HSMHVinstances; here!= NULL; here = here->HSMHVnextInstance ) { + for ( ; model != NULL; model = HSMHVnextModel(model)) { + for ( here = HSMHVinstances(model); here!= NULL; here = HSMHVnextInstance(here)) { flg_nqs = model->HSMHV_conqs ; flg_subNode = here->HSMHVsubNode ; /* if flg_subNode > 0, external(/internal) substrate node exists */ diff --git a/src/spicelib/devices/hisimhv1/hsmhvcvtest.c b/src/spicelib/devices/hisimhv1/hsmhvcvtest.c index 430d53b5b..86539194c 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvcvtest.c +++ b/src/spicelib/devices/hisimhv1/hsmhvcvtest.c @@ -48,10 +48,10 @@ int HSMHVconvTest( /* loop through all the HSMHV device models */ - for ( ; model != NULL; model = model->HSMHVnextModel ) { + for ( ; model != NULL; model = HSMHVnextModel(model)) { /* loop through all the instances of the model */ - for ( here = model->HSMHVinstances; here != NULL ; - here = here->HSMHVnextInstance ) { + for ( here = HSMHVinstances(model); here != NULL ; + here = HSMHVnextInstance(here)) { vds = model->HSMHV_type * (*(ckt->CKTrhsOld+here->HSMHVdNodePrime) - diff --git a/src/spicelib/devices/hisimhv1/hsmhvgetic.c b/src/spicelib/devices/hisimhv1/hsmhvgetic.c index 68b751e46..9023f66ae 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvgetic.c +++ b/src/spicelib/devices/hisimhv1/hsmhvgetic.c @@ -32,8 +32,8 @@ int HSMHVgetic( * external nodes to get values */ - for ( ;model ;model = model->HSMHVnextModel ) { - for ( here = model->HSMHVinstances; here ;here = here->HSMHVnextInstance ) { + for ( ;model ;model = HSMHVnextModel(model)) { + for ( here = HSMHVinstances(model); here ;here = HSMHVnextInstance(here)) { if (!here->HSMHV_icVBS_Given) { here->HSMHV_icVBS = *(ckt->CKTrhs + here->HSMHVbNode) - diff --git a/src/spicelib/devices/hisimhv1/hsmhvld.c b/src/spicelib/devices/hisimhv1/hsmhvld.c index 5aff325ef..517c4f0b7 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvld.c +++ b/src/spicelib/devices/hisimhv1/hsmhvld.c @@ -360,13 +360,13 @@ int HSMHVload( } /* loop through all the HSMHV device models */ - for ( ; model != NULL; model = model->HSMHVnextModel ) { + for ( ; model != NULL; model = HSMHVnextModel(model)) { /* loop through all the instances of the model */ /* modelMKS = &model->modelMKS ;*/ - for (here = model->HSMHVinstances; here != NULL ; - here = here->HSMHVnextInstance) { + for (here = HSMHVinstances(model); here != NULL ; + here = HSMHVnextInstance(here)) { /* hereMKS = &here->hereMKS ;*/ pParam = &here->pParam ; diff --git a/src/spicelib/devices/hisimhv1/hsmhvnoi.c b/src/spicelib/devices/hisimhv1/hsmhvnoi.c index 2c8e9f576..06833f22a 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvnoi.c +++ b/src/spicelib/devices/hisimhv1/hsmhvnoi.c @@ -64,9 +64,9 @@ int HSMHVnoise ( "" /* total transistor noise */ }; - for ( ;model != NULL; model = model->HSMHVnextModel ) { - for ( here = model->HSMHVinstances; here != NULL; - here = here->HSMHVnextInstance ) { + for ( ;model != NULL; model = HSMHVnextModel(model)) { + for ( here = HSMHVinstances(model); here != NULL; + here = HSMHVnextInstance(here)) { switch (operation) { case N_OPEN: /* see if we have to to produce a summary report */ diff --git a/src/spicelib/devices/hisimhv1/hsmhvpzld.c b/src/spicelib/devices/hisimhv1/hsmhvpzld.c index b657da4df..b2ab58412 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvpzld.c +++ b/src/spicelib/devices/hisimhv1/hsmhvpzld.c @@ -48,9 +48,9 @@ int HSMHVpzLoad( #define qbNode 12 - for ( ;model != NULL ;model = model->HSMHVnextModel ) { - for ( here = model->HSMHVinstances ;here!= NULL ; - here = here->HSMHVnextInstance ) { + for ( ;model != NULL ;model = HSMHVnextModel(model)) { + for ( here = HSMHVinstances(model);here!= NULL ; + here = HSMHVnextInstance(here)) { flg_nqs = model->HSMHV_conqs ; diff --git a/src/spicelib/devices/hisimhv1/hsmhvset.c b/src/spicelib/devices/hisimhv1/hsmhvset.c index 0dc67ae9b..08ba1d1ac 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvset.c +++ b/src/spicelib/devices/hisimhv1/hsmhvset.c @@ -64,7 +64,7 @@ int HSMHVsetup( double Lbin=0.0, Wbin=0.0, LWbin =0.0; /* binning */ /* loop through all the HSMHV device models */ - for ( ;model != NULL ;model = model->HSMHVnextModel ) { + for ( ;model != NULL ;model = HSMHVnextModel(model)) { /* Default value Processing for HVMOS Models */ if ( !model->HSMHV_type_Given ) model->HSMHV_type = NMOS ; @@ -779,8 +779,8 @@ int HSMHVsetup( modelMKS = &model->modelMKS ; /* loop through all the instances of the model */ - for ( here = model->HSMHVinstances ;here != NULL ; - here = here->HSMHVnextInstance ) { + for ( here = HSMHVinstances(model);here != NULL ; + here = HSMHVnextInstance(here)) { /* allocate a chunk of the state vector */ here->HSMHVstates = *states; if (model->HSMHV_conqs) @@ -1470,10 +1470,10 @@ HSMHVunsetup( HSMHVinstance *here; for (model = (HSMHVmodel *)inModel; model != NULL; - model = model->HSMHVnextModel) + model = HSMHVnextModel(model)) { - for (here = model->HSMHVinstances; here != NULL; - here=here->HSMHVnextInstance) + for (here = HSMHVinstances(model); here != NULL; + here=HSMHVnextInstance(here)) { if (here->HSMHVqbNode > 0) CKTdltNNum(ckt, here->HSMHVqbNode); diff --git a/src/spicelib/devices/hisimhv1/hsmhvsoachk.c b/src/spicelib/devices/hisimhv1/hsmhvsoachk.c index 5509d3aa8..bda45be86 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvsoachk.c +++ b/src/spicelib/devices/hisimhv1/hsmhvsoachk.c @@ -33,9 +33,9 @@ HSMHVsoaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->HSMHVnextModel) { + for (; model; model = HSMHVnextModel(model)) { - for (here = model->HSMHVinstances; here; here = here->HSMHVnextInstance) { + for (here = HSMHVinstances(model); here; here = HSMHVnextInstance(here)) { vgs = ckt->CKTrhsOld [here->HSMHVgNode] - ckt->CKTrhsOld [here->HSMHVsNodePrime]; diff --git a/src/spicelib/devices/hisimhv1/hsmhvtemp.c b/src/spicelib/devices/hisimhv1/hsmhvtemp.c index 894e40863..f247afbe1 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvtemp.c +++ b/src/spicelib/devices/hisimhv1/hsmhvtemp.c @@ -81,7 +81,7 @@ int HSMHVtemp( const double dlt_rd23 = 1.0e-6 / C_m2cm ; const double large_arg = 80 ; - for ( ;model ;model = model->HSMHVnextModel ) { + for ( ;model ;model = HSMHVnextModel(model)) { modelMKS = &model->modelMKS ; @@ -95,7 +95,7 @@ int HSMHVtemp( model->HSMHV_qme12 = model->HSMHV_qme1 / ( model->HSMHV_qme2 * model->HSMHV_qme2 ) ; } - for ( here = model->HSMHVinstances; here; here = here->HSMHVnextInstance ) { + for ( here = HSMHVinstances(model); here; here = HSMHVnextInstance(here)) { pParam = &here->pParam ; diff --git a/src/spicelib/devices/hisimhv1/hsmhvtrunc.c b/src/spicelib/devices/hisimhv1/hsmhvtrunc.c index cadfc00d3..776cd4646 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvtrunc.c +++ b/src/spicelib/devices/hisimhv1/hsmhvtrunc.c @@ -33,9 +33,9 @@ int HSMHVtrunc( double debugtemp=0.0 ; #endif /* STEPDEBUG */ - for ( ;model != NULL ;model = model->HSMHVnextModel ) { - for ( here=model->HSMHVinstances ;here!=NULL ; - here = here->HSMHVnextInstance ) { + for ( ;model != NULL ;model = HSMHVnextModel(model)) { + for ( here=HSMHVinstances(model);here!=NULL ; + here = HSMHVnextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; #endif /* STEPDEBUG */ diff --git a/src/spicelib/devices/hisimhv2/hsmhv2acld.c b/src/spicelib/devices/hisimhv2/hsmhv2acld.c index 06ff835aa..7467d43f0 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2acld.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2acld.c @@ -91,8 +91,8 @@ int HSMHV2acLoad( omega = ckt->CKTomega; - for ( ; model != NULL; model = model->HSMHV2nextModel ) { - for ( here = model->HSMHV2instances; here!= NULL; here = here->HSMHV2nextInstance ) { + for ( ; model != NULL; model = HSMHV2nextModel(model)) { + for ( here = HSMHV2instances(model); here!= NULL; here = HSMHV2nextInstance(here)) { flg_nqs = model->HSMHV2_conqs ; flg_subNode = here->HSMHV2subNode ; /* if flg_subNode > 0, external(/internal) substrate node exists */ diff --git a/src/spicelib/devices/hisimhv2/hsmhv2cvtest.c b/src/spicelib/devices/hisimhv2/hsmhv2cvtest.c index 4832de7a8..2d2b689a5 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2cvtest.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2cvtest.c @@ -90,10 +90,10 @@ int HSMHV2convTest( /* loop through all the HSMHV2 device models */ - for ( ; model != NULL; model = model->HSMHV2nextModel ) { + for ( ; model != NULL; model = HSMHV2nextModel(model)) { /* loop through all the instances of the model */ - for ( here = model->HSMHV2instances; here != NULL ; - here = here->HSMHV2nextInstance ) { + for ( here = HSMHV2instances(model); here != NULL ; + here = HSMHV2nextInstance(here)) { vds = model->HSMHV2_type * (*(ckt->CKTrhsOld+here->HSMHV2dNodePrime) - diff --git a/src/spicelib/devices/hisimhv2/hsmhv2getic.c b/src/spicelib/devices/hisimhv2/hsmhv2getic.c index 7c6adca28..b55455f09 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2getic.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2getic.c @@ -74,8 +74,8 @@ int HSMHV2getic( * external nodes to get values */ - for ( ;model ;model = model->HSMHV2nextModel ) { - for ( here = model->HSMHV2instances; here ;here = here->HSMHV2nextInstance ) { + for ( ;model ;model = HSMHV2nextModel(model)) { + for ( here = HSMHV2instances(model); here ;here = HSMHV2nextInstance(here)) { if (!here->HSMHV2_icVBS_Given) { here->HSMHV2_icVBS = *(ckt->CKTrhs + here->HSMHV2bNode) - diff --git a/src/spicelib/devices/hisimhv2/hsmhv2ld.c b/src/spicelib/devices/hisimhv2/hsmhv2ld.c index 13de99cbe..df1944c82 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2ld.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2ld.c @@ -407,13 +407,13 @@ int HSMHV2load( } /* loop through all the HSMHV2 device models */ - for ( ; model != NULL; model = model->HSMHV2nextModel ) { + for ( ; model != NULL; model = HSMHV2nextModel(model)) { /* loop through all the instances of the model */ modelMKS = &model->modelMKS ; - for (here = model->HSMHV2instances; here != NULL ; - here = here->HSMHV2nextInstance) { + for (here = HSMHV2instances(model); here != NULL ; + here = HSMHV2nextInstance(here)) { hereMKS = &here->hereMKS ; pParam = &here->pParam ; diff --git a/src/spicelib/devices/hisimhv2/hsmhv2noi.c b/src/spicelib/devices/hisimhv2/hsmhv2noi.c index 1c1736da4..66bd7bb25 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2noi.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2noi.c @@ -106,9 +106,9 @@ int HSMHV2noise ( "" /* total transistor noise */ }; - for ( ;model != NULL; model = model->HSMHV2nextModel ) { - for ( here = model->HSMHV2instances; here != NULL; - here = here->HSMHV2nextInstance ) { + for ( ;model != NULL; model = HSMHV2nextModel(model)) { + for ( here = HSMHV2instances(model); here != NULL; + here = HSMHV2nextInstance(here)) { switch (operation) { case N_OPEN: /* see if we have to to produce a summary report */ diff --git a/src/spicelib/devices/hisimhv2/hsmhv2pzld.c b/src/spicelib/devices/hisimhv2/hsmhv2pzld.c index 8c8562fa4..fffa038cd 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2pzld.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2pzld.c @@ -90,9 +90,9 @@ int HSMHV2pzLoad( #define qbNode 12 - for ( ;model != NULL ;model = model->HSMHV2nextModel ) { - for ( here = model->HSMHV2instances ;here!= NULL ; - here = here->HSMHV2nextInstance ) { + for ( ;model != NULL ;model = HSMHV2nextModel(model)) { + for ( here = HSMHV2instances(model);here!= NULL ; + here = HSMHV2nextInstance(here)) { flg_nqs = model->HSMHV2_conqs ; diff --git a/src/spicelib/devices/hisimhv2/hsmhv2set.c b/src/spicelib/devices/hisimhv2/hsmhv2set.c index a434f0b5e..19d7d6f93 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2set.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2set.c @@ -124,7 +124,7 @@ int HSMHV2setup( /* loop through all the HSMHV2 device models */ - for ( ;model != NULL ;model = model->HSMHV2nextModel ) { + for ( ;model != NULL ;model = HSMHV2nextModel(model)) { /* Default value Processing for HVMOS Models */ if ( !model->HSMHV2_type_Given ) model->HSMHV2_type = NMOS ; @@ -999,8 +999,8 @@ int HSMHV2setup( modelMKS = &model->modelMKS ; /* loop through all the instances of the model */ - for ( here = model->HSMHV2instances ;here != NULL ; - here = here->HSMHV2nextInstance ) { + for ( here = HSMHV2instances(model);here != NULL ; + here = HSMHV2nextInstance(here)) { /* allocate a chunk of the state vector */ here->HSMHV2states = *states; if (model->HSMHV2_conqs) @@ -1739,10 +1739,10 @@ HSMHV2unsetup( HSMHV2instance *here; for (model = (HSMHV2model *)inModel; model != NULL; - model = model->HSMHV2nextModel) + model = HSMHV2nextModel(model)) { - for (here = model->HSMHV2instances; here != NULL; - here=here->HSMHV2nextInstance) + for (here = HSMHV2instances(model); here != NULL; + here=HSMHV2nextInstance(here)) { if (here->HSMHV2tempNode > 0 && here->HSMHV2tempNode != here->HSMHV2tempNodeExt && diff --git a/src/spicelib/devices/hisimhv2/hsmhv2soachk.c b/src/spicelib/devices/hisimhv2/hsmhv2soachk.c index de7f5d5d9..29d70b8fe 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2soachk.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2soachk.c @@ -33,9 +33,9 @@ HSMHV2soaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->HSMHV2nextModel) { + for (; model; model = HSMHV2nextModel(model)) { - for (here = model->HSMHV2instances; here; here = here->HSMHV2nextInstance) { + for (here = HSMHV2instances(model); here; here = HSMHV2nextInstance(here)) { vgs = ckt->CKTrhsOld [here->HSMHV2gNode] - ckt->CKTrhsOld [here->HSMHV2sNodePrime]; diff --git a/src/spicelib/devices/hisimhv2/hsmhv2temp.c b/src/spicelib/devices/hisimhv2/hsmhv2temp.c index accd3d69c..97b81b9af 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2temp.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2temp.c @@ -120,7 +120,7 @@ int HSMHV2temp( const double dlt_rd23 = 1.0e-6 / C_m2cm ; const double large_arg = 80 ; - for ( ;model ;model = model->HSMHV2nextModel ) { + for ( ;model ;model = HSMHV2nextModel(model)) { modelMKS = &model->modelMKS ; @@ -134,7 +134,7 @@ int HSMHV2temp( model->HSMHV2_qme12 = model->HSMHV2_qme1 / ( model->HSMHV2_qme2 * model->HSMHV2_qme2 ) ; } - for ( here = model->HSMHV2instances; here; here = here->HSMHV2nextInstance ) { + for ( here = HSMHV2instances(model); here; here = HSMHV2nextInstance(here)) { pParam = &here->pParam ; diff --git a/src/spicelib/devices/hisimhv2/hsmhv2trunc.c b/src/spicelib/devices/hisimhv2/hsmhv2trunc.c index 55ebf8e0f..2b68b87fb 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2trunc.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2trunc.c @@ -74,9 +74,9 @@ int HSMHV2trunc( double debugtemp=0.0 ; #endif /* STEPDEBUG */ - for ( ;model != NULL ;model = model->HSMHV2nextModel ) { - for ( here=model->HSMHV2instances ;here!=NULL ; - here = here->HSMHV2nextInstance ) { + for ( ;model != NULL ;model = HSMHV2nextModel(model)) { + for ( here=HSMHV2instances(model);here!=NULL ; + here = HSMHV2nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep; #endif /* STEPDEBUG */ diff --git a/src/spicelib/devices/ind/indacld.c b/src/spicelib/devices/ind/indacld.c index 7103dc9cd..812ed7d50 100644 --- a/src/spicelib/devices/ind/indacld.c +++ b/src/spicelib/devices/ind/indacld.c @@ -20,9 +20,9 @@ INDacLoad(GENmodel *inModel, CKTcircuit *ckt) double m; INDinstance *here; - for( ; model != NULL; model = model->INDnextModel) { - for( here = model->INDinstances;here != NULL; - here = here->INDnextInstance) { + for( ; model != NULL; model = INDnextModel(model)) { + for( here = INDinstances(model);here != NULL; + here = INDnextInstance(here)) { m = (here->INDm); diff --git a/src/spicelib/devices/ind/indload.c b/src/spicelib/devices/ind/indload.c index 63a47fa20..ad3929492 100644 --- a/src/spicelib/devices/ind/indload.c +++ b/src/spicelib/devices/ind/indload.c @@ -32,11 +32,11 @@ INDload(GENmodel *inModel, CKTcircuit *ckt) #endif /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { m = (here->INDm); @@ -55,11 +55,11 @@ INDload(GENmodel *inModel, CKTcircuit *ckt) ktype = CKTtypelook("mutual"); mutmodel = (MUTmodel *)(ckt->CKThead[ktype]); /* loop through all the mutual inductor models */ - for( ; mutmodel != NULL; mutmodel = mutmodel->MUTnextModel ) { + for( ; mutmodel != NULL; mutmodel = MUTnextModel(mutmodel)) { /* loop through all the instances of the model */ - for (muthere = mutmodel->MUTinstances; muthere != NULL ; - muthere=muthere->MUTnextInstance) { + for (muthere = MUTinstances(mutmodel); muthere != NULL ; + muthere=MUTnextInstance(muthere)) { if(!(ckt->CKTmode& (MODEDC|MODEINITPRED))) { *(ckt->CKTstate0 + muthere->MUTind1->INDflux) += @@ -78,11 +78,11 @@ INDload(GENmodel *inModel, CKTcircuit *ckt) itype = CKTtypelook("Inductor"); model = (INDmodel *)(ckt->CKThead[itype]); /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { #endif /*MUTUAL*/ if(ckt->CKTmode & MODEDC) { diff --git a/src/spicelib/devices/ind/indpzld.c b/src/spicelib/devices/ind/indpzld.c index fe5fd9418..335694bc1 100644 --- a/src/spicelib/devices/ind/indpzld.c +++ b/src/spicelib/devices/ind/indpzld.c @@ -23,9 +23,9 @@ INDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); - for( ; model != NULL; model = model->INDnextModel) { - for( here = model->INDinstances;here != NULL; - here = here->INDnextInstance) { + for( ; model != NULL; model = INDnextModel(model)) { + for( here = INDinstances(model);here != NULL; + here = INDnextInstance(here)) { val = here->INDinduct / here->INDm; diff --git a/src/spicelib/devices/ind/indsacl.c b/src/spicelib/devices/ind/indsacl.c index 78fc36cc5..01549c07f 100644 --- a/src/spicelib/devices/ind/indsacl.c +++ b/src/spicelib/devices/ind/indsacl.c @@ -53,11 +53,11 @@ INDsAcLoad(GENmodel *inModel, CKTcircuit *ckt) info = ckt->CKTsenInfo; /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { #ifdef MUTUAL } @@ -65,11 +65,11 @@ INDsAcLoad(GENmodel *inModel, CKTcircuit *ckt) ktype = CKTtypelook("mutual"); mutmodel = (MUTmodel *)(ckt->CKThead[ktype]); /* loop through all the mutual inductor models */ - for( ; mutmodel != NULL; mutmodel = mutmodel->MUTnextModel ) { + for( ; mutmodel != NULL; mutmodel = MUTnextModel(mutmodel)) { /* loop through all the instances of the model */ - for (muthere = mutmodel->MUTinstances; muthere != NULL ; - muthere=muthere->MUTnextInstance) { + for (muthere = MUTinstances(mutmodel); muthere != NULL ; + muthere=MUTnextInstance(muthere)) { if(muthere->MUTsenParmNo || muthere->MUTind1->INDsenParmNo || @@ -137,11 +137,11 @@ INDsAcLoad(GENmodel *inModel, CKTcircuit *ckt) itype = CKTtypelook("Inductor"); model = (INDmodel *)(ckt->CKThead[itype]); /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { #endif /* MUTUAL */ if(here->INDsenParmNo){ cind = *(ckt->CKTrhsOld + here->INDbrEq); diff --git a/src/spicelib/devices/ind/indsetup.c b/src/spicelib/devices/ind/indsetup.c index 362064a96..51bd0d924 100644 --- a/src/spicelib/devices/ind/indsetup.c +++ b/src/spicelib/devices/ind/indsetup.c @@ -22,7 +22,7 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* Default Value Processing for Model Parameters */ if (!model->INDmIndGiven) { @@ -72,8 +72,8 @@ INDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { here->INDflux = *states; *states += 2 ; @@ -113,10 +113,10 @@ INDunsetup(GENmodel *inModel, CKTcircuit *ckt) INDinstance *here; for (model = (INDmodel *)inModel; model != NULL; - model = model->INDnextModel) + model = INDnextModel(model)) { - for (here = model->INDinstances; here != NULL; - here=here->INDnextInstance) + for (here = INDinstances(model); here != NULL; + here=INDnextInstance(here)) { if (here->INDbrEq > 0) CKTdltNNum(ckt, here->INDbrEq); diff --git a/src/spicelib/devices/ind/indsload.c b/src/spicelib/devices/ind/indsload.c index 74f9f99cd..89d3b5eb1 100644 --- a/src/spicelib/devices/ind/indsload.c +++ b/src/spicelib/devices/ind/indsload.c @@ -59,11 +59,11 @@ INDsLoad(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { #ifdef MUTUAL } @@ -71,11 +71,11 @@ INDsLoad(GENmodel *inModel, CKTcircuit *ckt) ktype = CKTtypelook("mutual"); mutmodel = (MUTmodel *)(ckt->CKThead[ktype]); /* loop through all the mutual inductor models */ - for( ; mutmodel != NULL; mutmodel = mutmodel->MUTnextModel ) { + for( ; mutmodel != NULL; mutmodel = MUTnextModel(mutmodel)) { /* loop through all the instances of the model */ - for (muthere = mutmodel->MUTinstances; muthere != NULL ; - muthere=muthere->MUTnextInstance) { + for (muthere = MUTinstances(mutmodel); muthere != NULL ; + muthere=MUTnextInstance(muthere)) { if(muthere->MUTsenParmNo || muthere->MUTind1->INDsenParmNo || @@ -117,10 +117,10 @@ INDsLoad(GENmodel *inModel, CKTcircuit *ckt) itype = CKTtypelook("Inductor"); model = (INDmodel *)(ckt->CKThead[itype]); /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { #endif /* MUTUAL */ cind = *(ckt->CKTrhsOld + here->INDbrEq); diff --git a/src/spicelib/devices/ind/indsprt.c b/src/spicelib/devices/ind/indsprt.c index 1d4fe5a84..32574514e 100644 --- a/src/spicelib/devices/ind/indsprt.c +++ b/src/spicelib/devices/ind/indsprt.c @@ -24,13 +24,13 @@ INDsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("INDUCTORS----------\n"); /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { printf("Model name:%s\n",model->INDmodName); /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { printf(" Instance name:%s\n",here->INDname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/ind/indsset.c b/src/spicelib/devices/ind/indsset.c index 7b2856da8..844342070 100644 --- a/src/spicelib/devices/ind/indsset.c +++ b/src/spicelib/devices/ind/indsset.c @@ -23,11 +23,11 @@ INDsSetup(SENstruct *info, GENmodel *inModel) INDinstance *here; /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { if(here->INDsenParmNo){ here->INDsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/ind/indsupd.c b/src/spicelib/devices/ind/indsupd.c index 8ebddb552..86816b5a6 100644 --- a/src/spicelib/devices/ind/indsupd.c +++ b/src/spicelib/devices/ind/indsupd.c @@ -43,11 +43,11 @@ INDsUpdate(GENmodel *inModel, CKTcircuit *ckt) if(ckt->CKTmode & MODEINITTRAN) return(OK); /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { for(iparmno = 1;iparmno<=info->SENparms;iparmno++){ @@ -73,11 +73,11 @@ INDsUpdate(GENmodel *inModel, CKTcircuit *ckt) ktype = CKTtypelook("mutual"); mutmodel = (MUTmodel *)(ckt->CKThead[ktype]); /* loop through all the mutual inductor models */ - for( ; mutmodel != NULL; mutmodel = mutmodel->MUTnextModel ) { + for( ; mutmodel != NULL; mutmodel = MUTnextModel(mutmodel)) { /* loop through all the instances of the model */ - for (muthere = mutmodel->MUTinstances; muthere != NULL ; - muthere=muthere->MUTnextInstance) { + for (muthere = MUTinstances(mutmodel); muthere != NULL ; + muthere=MUTnextInstance(muthere)) { cind1 = *(ckt->CKTrhsOld + muthere->MUTind1->INDbrEq); @@ -123,11 +123,11 @@ INDsUpdate(GENmodel *inModel, CKTcircuit *ckt) itype = CKTtypelook("Inductor"); model = (INDmodel *)(ckt->CKThead[itype]); /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { #endif /* MUTUAL */ for(iparmno = 1;iparmno<=info->SENparms;iparmno++){ diff --git a/src/spicelib/devices/ind/indtemp.c b/src/spicelib/devices/ind/indtemp.c index f08e8930b..c355e03d8 100644 --- a/src/spicelib/devices/ind/indtemp.c +++ b/src/spicelib/devices/ind/indtemp.c @@ -24,11 +24,11 @@ INDtemp(GENmodel *inModel, CKTcircuit *ckt) double tc1, tc2; /* loop through all the inductor models */ - for( ; model != NULL; model = model->INDnextModel ) { + for( ; model != NULL; model = INDnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->INDinstances; here != NULL ; - here=here->INDnextInstance) { + for (here = INDinstances(model); here != NULL ; + here=INDnextInstance(here)) { /* Default Value Processing for Inductor Instance */ diff --git a/src/spicelib/devices/ind/indtrunc.c b/src/spicelib/devices/ind/indtrunc.c index 7d42cd895..3d57c1f56 100644 --- a/src/spicelib/devices/ind/indtrunc.c +++ b/src/spicelib/devices/ind/indtrunc.c @@ -17,9 +17,9 @@ INDtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) { INDmodel *model = (INDmodel*)inModel; INDinstance *here; - for( ; model!= NULL; model = model->INDnextModel) { - for(here = model->INDinstances ; here != NULL ; - here = here->INDnextInstance) { + for( ; model!= NULL; model = INDnextModel(model)) { + for(here = INDinstances(model); here != NULL ; + here = INDnextInstance(here)) { CKTterr(here->INDflux,ckt,timeStep); } diff --git a/src/spicelib/devices/ind/mutacld.c b/src/spicelib/devices/ind/mutacld.c index f5df904a2..6d817fb5b 100644 --- a/src/spicelib/devices/ind/mutacld.c +++ b/src/spicelib/devices/ind/mutacld.c @@ -20,9 +20,9 @@ MUTacLoad(GENmodel *inModel, CKTcircuit *ckt) double val; MUTinstance *here; - for( ; model != NULL; model = model->MUTnextModel) { - for( here = model->MUTinstances;here != NULL; - here = here->MUTnextInstance) { + for( ; model != NULL; model = MUTnextModel(model)) { + for( here = MUTinstances(model);here != NULL; + here = MUTnextInstance(here)) { val = ckt->CKTomega * here->MUTfactor; *(here->MUTbr1br2Ptr +1) -= val; diff --git a/src/spicelib/devices/ind/mutpzld.c b/src/spicelib/devices/ind/mutpzld.c index 142f02415..89029de14 100644 --- a/src/spicelib/devices/ind/mutpzld.c +++ b/src/spicelib/devices/ind/mutpzld.c @@ -24,9 +24,9 @@ MUTpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); - for( ; model != NULL; model = model->MUTnextModel) { - for( here = model->MUTinstances;here != NULL; - here = here->MUTnextInstance) { + for( ; model != NULL; model = MUTnextModel(model)) { + for( here = MUTinstances(model);here != NULL; + here = MUTnextInstance(here)) { val = here->MUTfactor; *(here->MUTbr1br2Ptr ) -= val * s->real; diff --git a/src/spicelib/devices/ind/mutsetup.c b/src/spicelib/devices/ind/mutsetup.c index 083ff5a8f..23ea9ebb7 100644 --- a/src/spicelib/devices/ind/mutsetup.c +++ b/src/spicelib/devices/ind/mutsetup.c @@ -34,8 +34,8 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) NG_IGNORE(states); - for (; model; model = model->MUTnextModel) - for (here = model->MUTinstances; here; here = here->MUTnextInstance) { + for (; model; model = MUTnextModel(model)) + for (here = MUTinstances(model); here; here = MUTnextInstance(here)) { int ktype = CKTtypelook("Inductor"); diff --git a/src/spicelib/devices/ind/mutsprt.c b/src/spicelib/devices/ind/mutsprt.c index 629f91db7..2005120de 100644 --- a/src/spicelib/devices/ind/mutsprt.c +++ b/src/spicelib/devices/ind/mutsprt.c @@ -29,13 +29,13 @@ MUTsPrint(GENmodel *inModel, CKTcircuit* ckt) printf("MUTUAL INDUCTORS-----------------\n"); /* loop through all the inductor models */ - for( ; model != NULL; model = model->MUTnextModel ) { + for( ; model != NULL; model = MUTnextModel(model)) { printf("Model name:%s\n",model->MUTmodName); /* loop through all the instances of the model */ - for (here = model->MUTinstances; here != NULL ; - here=here->MUTnextInstance) { + for (here = MUTinstances(model); here != NULL ; + here=MUTnextInstance(here)) { printf(" Instance name:%s\n",here->MUTname); printf(" Mutual Inductance: %g ",here->MUTcoupling); diff --git a/src/spicelib/devices/ind/mutsset.c b/src/spicelib/devices/ind/mutsset.c index d65cfaa2d..2158ff3f6 100644 --- a/src/spicelib/devices/ind/mutsset.c +++ b/src/spicelib/devices/ind/mutsset.c @@ -26,11 +26,11 @@ MUTsSetup(SENstruct *info, GENmodel *inModel) MUTinstance *here; /* loop through all the inductor models */ - for( ; model != NULL; model = model->MUTnextModel ) { + for( ; model != NULL; model = MUTnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MUTinstances; here != NULL ; - here=here->MUTnextInstance) { + for (here = MUTinstances(model); here != NULL ; + here=MUTnextInstance(here)) { if(here->MUTsenParmNo){ here->MUTsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/ind/muttemp.c b/src/spicelib/devices/ind/muttemp.c index 2dc41d2c7..30c589adc 100644 --- a/src/spicelib/devices/ind/muttemp.c +++ b/src/spicelib/devices/ind/muttemp.c @@ -42,8 +42,8 @@ MUTtemp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); - for (; model; model = model->MUTnextModel) - for (here = model->MUTinstances; here; here = here->MUTnextInstance) { + for (; model; model = MUTnextModel(model)) + for (here = MUTinstances(model); here; here = MUTnextInstance(here)) { /* Value Processing for mutual inductors */ diff --git a/src/spicelib/devices/isrc/isrcacct.c b/src/spicelib/devices/isrc/isrcacct.c index c56617569..5c86dc954 100644 --- a/src/spicelib/devices/isrc/isrcacct.c +++ b/src/spicelib/devices/isrc/isrcacct.c @@ -30,11 +30,11 @@ ISRCaccept(CKTcircuit *ckt, GENmodel *inModel) int error; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->ISRCnextModel ) { + for( ; model != NULL; model = ISRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->ISRCinstances; here != NULL ; - here=here->ISRCnextInstance) { + for (here = ISRCinstances(model); here != NULL ; + here=ISRCnextInstance(here)) { if(!(ckt->CKTmode & (MODETRAN | MODETRANOP))) { /* not transient, so shouldn't be here */ diff --git a/src/spicelib/devices/isrc/isrcacld.c b/src/spicelib/devices/isrc/isrcacld.c index 48fa57402..a5cc29ded 100644 --- a/src/spicelib/devices/isrc/isrcacld.c +++ b/src/spicelib/devices/isrc/isrcacld.c @@ -17,11 +17,11 @@ ISRCacLoad(GENmodel *inModel, CKTcircuit *ckt) ISRCinstance *here; double m; - for( ; model != NULL; model = model->ISRCnextModel ) { + for( ; model != NULL; model = ISRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->ISRCinstances; here != NULL ; - here=here->ISRCnextInstance) { + for (here = ISRCinstances(model); here != NULL ; + here=ISRCnextInstance(here)) { double acReal, acImag; diff --git a/src/spicelib/devices/isrc/isrcload.c b/src/spicelib/devices/isrc/isrcload.c index f82f628d0..d5deca331 100644 --- a/src/spicelib/devices/isrc/isrcload.c +++ b/src/spicelib/devices/isrc/isrcload.c @@ -35,11 +35,11 @@ ISRCload(GENmodel *inModel, CKTcircuit *ckt) double m; /* loop through all the source models */ - for( ; model != NULL; model = model->ISRCnextModel ) { + for( ; model != NULL; model = ISRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->ISRCinstances; here != NULL ; - here=here->ISRCnextInstance) { + for (here = ISRCinstances(model); here != NULL ; + here=ISRCnextInstance(here)) { m = here->ISRCmValue; diff --git a/src/spicelib/devices/isrc/isrctemp.c b/src/spicelib/devices/isrc/isrctemp.c index 54aa10209..d0fa55aef 100644 --- a/src/spicelib/devices/isrc/isrctemp.c +++ b/src/spicelib/devices/isrc/isrctemp.c @@ -23,11 +23,11 @@ ISRCtemp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->ISRCnextModel ) { + for( ; model != NULL; model = ISRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->ISRCinstances; here != NULL ; - here=here->ISRCnextInstance) { + for (here = ISRCinstances(model); here != NULL ; + here=ISRCnextInstance(here)) { if(here->ISRCacGiven && !here->ISRCacMGiven) { here->ISRCacMag = 1; diff --git a/src/spicelib/devices/jfet/jfetacld.c b/src/spicelib/devices/jfet/jfetacld.c index 390757f44..c75530b7d 100644 --- a/src/spicelib/devices/jfet/jfetacld.c +++ b/src/spicelib/devices/jfet/jfetacld.c @@ -28,10 +28,10 @@ JFETacLoad(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->JFETnextModel ) { + for( ; model != NULL; model = JFETnextModel(model)) { - for( here = model->JFETinstances; here != NULL; - here = here->JFETnextInstance) { + for( here = JFETinstances(model); here != NULL; + here = JFETnextInstance(here)) { gdpr=model->JFETdrainConduct * here->JFETarea; gspr=model->JFETsourceConduct * here->JFETarea; diff --git a/src/spicelib/devices/jfet/jfetdist.c b/src/spicelib/devices/jfet/jfetdist.c index b9517a38b..716af2b0e 100644 --- a/src/spicelib/devices/jfet/jfetdist.c +++ b/src/spicelib/devices/jfet/jfetdist.c @@ -40,11 +40,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the JFET models */ -for( ; model != NULL; model = model->JFETnextModel ) { +for( ; model != NULL; model = JFETnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->JFETinstances; here != NULL ; - here=here->JFETnextInstance) { + for (here = JFETinstances(model); here != NULL ; + here=JFETnextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/jfet/jfetdset.c b/src/spicelib/devices/jfet/jfetdset.c index 6189e7ef3..ea20efcfc 100644 --- a/src/spicelib/devices/jfet/jfetdset.c +++ b/src/spicelib/devices/jfet/jfetdset.c @@ -67,11 +67,11 @@ JFETdSetup(GENmodel *inModel, CKTcircuit *ckt) double vgst; /* loop through all the models */ - for( ; model != NULL; model = model->JFETnextModel ) { + for( ; model != NULL; model = JFETnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->JFETinstances; here != NULL ; - here=here->JFETnextInstance) { + for (here = JFETinstances(model); here != NULL ; + here=JFETnextInstance(here)) { /* * dc model parameters diff --git a/src/spicelib/devices/jfet/jfetic.c b/src/spicelib/devices/jfet/jfetic.c index 30bc558fd..222c0e576 100644 --- a/src/spicelib/devices/jfet/jfetic.c +++ b/src/spicelib/devices/jfet/jfetic.c @@ -22,8 +22,8 @@ JFETgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->JFETnextModel) { - for(here = model->JFETinstances; here ; here = here->JFETnextInstance) { + for( ; model ; model = JFETnextModel(model)) { + for(here = JFETinstances(model); here ; here = JFETnextInstance(here)) { if(!here->JFETicVDSGiven) { here->JFETicVDS = diff --git a/src/spicelib/devices/jfet/jfetload.c b/src/spicelib/devices/jfet/jfetload.c index 2cf68c326..cc0fc2d28 100644 --- a/src/spicelib/devices/jfet/jfetload.c +++ b/src/spicelib/devices/jfet/jfetload.c @@ -80,11 +80,11 @@ JFETload(GENmodel *inModel, CKTcircuit *ckt) double m; /* loop through all the models */ - for( ; model != NULL; model = model->JFETnextModel ) { + for( ; model != NULL; model = JFETnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->JFETinstances; here != NULL ; - here=here->JFETnextInstance) { + for (here = JFETinstances(model); here != NULL ; + here=JFETnextInstance(here)) { /* * dc model parameters diff --git a/src/spicelib/devices/jfet/jfetnoi.c b/src/spicelib/devices/jfet/jfetnoi.c index 1c35cefdd..5b70f97e5 100644 --- a/src/spicelib/devices/jfet/jfetnoi.c +++ b/src/spicelib/devices/jfet/jfetnoi.c @@ -46,8 +46,8 @@ JFETnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata * "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->JFETnextModel) { - for (inst=model->JFETinstances; inst != NULL; inst=inst->JFETnextInstance) { + for (model=firstModel; model != NULL; model=JFETnextModel(model)) { + for (inst=JFETinstances(model); inst != NULL; inst=JFETnextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/jfet/jfetpzld.c b/src/spicelib/devices/jfet/jfetpzld.c index 6c9b79fa4..f133aac4a 100644 --- a/src/spicelib/devices/jfet/jfetpzld.c +++ b/src/spicelib/devices/jfet/jfetpzld.c @@ -29,10 +29,10 @@ JFETpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double m; - for( ; model != NULL; model = model->JFETnextModel ) { + for( ; model != NULL; model = JFETnextModel(model)) { - for( here = model->JFETinstances; here != NULL; - here = here->JFETnextInstance) { + for( here = JFETinstances(model); here != NULL; + here = JFETnextInstance(here)) { m = here->JFETm; diff --git a/src/spicelib/devices/jfet/jfetset.c b/src/spicelib/devices/jfet/jfetset.c index 1ee580749..d2de3d65f 100644 --- a/src/spicelib/devices/jfet/jfetset.c +++ b/src/spicelib/devices/jfet/jfetset.c @@ -27,7 +27,7 @@ JFETsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the diode models */ - for( ; model != NULL; model = model->JFETnextModel ) { + for( ; model != NULL; model = JFETnextModel(model)) { if( (model->JFETtype != NJF) && (model->JFETtype != PJF) ) { model->JFETtype = NJF; @@ -100,8 +100,8 @@ JFETsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->JFETinstances; here != NULL ; - here=here->JFETnextInstance) { + for (here = JFETinstances(model); here != NULL ; + here=JFETnextInstance(here)) { if(!here->JFETareaGiven) { here->JFETarea = 1; @@ -190,10 +190,10 @@ JFETunsetup(GENmodel *inModel, CKTcircuit *ckt) JFETinstance *here; for (model = (JFETmodel *)inModel; model != NULL; - model = model->JFETnextModel) + model = JFETnextModel(model)) { - for (here = model->JFETinstances; here != NULL; - here=here->JFETnextInstance) + for (here = JFETinstances(model); here != NULL; + here=JFETnextInstance(here)) { if (here->JFETdrainPrimeNode > 0 && here->JFETdrainPrimeNode != here->JFETdrainNode) diff --git a/src/spicelib/devices/jfet/jfettemp.c b/src/spicelib/devices/jfet/jfettemp.c index f5fd2daf4..1a58db8fd 100644 --- a/src/spicelib/devices/jfet/jfettemp.c +++ b/src/spicelib/devices/jfet/jfettemp.c @@ -35,7 +35,7 @@ JFETtemp(GENmodel *inModel, CKTcircuit *ckt) double cjfact,cjfact1; /* loop through all the diode models */ - for( ; model != NULL; model = model->JFETnextModel ) { + for( ; model != NULL; model = JFETnextModel(model)) { if(!(model->JFETtnomGiven)) { model->JFETtnom = ckt->CKTnomTemp; @@ -77,8 +77,8 @@ JFETtemp(GENmodel *inModel, CKTcircuit *ckt) /* end Sydney University mod */ /* loop through all the instances of the model */ - for (here = model->JFETinstances; here != NULL ; - here=here->JFETnextInstance) { + for (here = JFETinstances(model); here != NULL ; + here=JFETnextInstance(here)) { if(!(here->JFETdtempGiven)) { here->JFETdtemp = 0.0; diff --git a/src/spicelib/devices/jfet/jfettrun.c b/src/spicelib/devices/jfet/jfettrun.c index e3259803e..14d4c9f3f 100644 --- a/src/spicelib/devices/jfet/jfettrun.c +++ b/src/spicelib/devices/jfet/jfettrun.c @@ -18,8 +18,8 @@ JFETtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) JFETmodel *model = (JFETmodel*)inModel; JFETinstance *here; - for( ; model != NULL; model = model->JFETnextModel) { - for(here=model->JFETinstances;here!=NULL;here = here->JFETnextInstance){ + for( ; model != NULL; model = JFETnextModel(model)) { + for(here=JFETinstances(model);here!=NULL;here = JFETnextInstance(here)){ CKTterr(here->JFETqgs,ckt,timeStep); CKTterr(here->JFETqgd,ckt,timeStep); diff --git a/src/spicelib/devices/jfet2/jfet2acld.c b/src/spicelib/devices/jfet2/jfet2acld.c index 0cb7bea2a..e56c3a9c2 100644 --- a/src/spicelib/devices/jfet2/jfet2acld.c +++ b/src/spicelib/devices/jfet2/jfet2acld.c @@ -32,10 +32,10 @@ JFET2acLoad(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->JFET2nextModel ) { + for( ; model != NULL; model = JFET2nextModel(model)) { - for( here = model->JFET2instances; here != NULL; - here = here->JFET2nextInstance) { + for( here = JFET2instances(model); here != NULL; + here = JFET2nextInstance(here)) { gdpr=model->JFET2drainConduct * here->JFET2area; gspr=model->JFET2sourceConduct * here->JFET2area; diff --git a/src/spicelib/devices/jfet2/jfet2ic.c b/src/spicelib/devices/jfet2/jfet2ic.c index 35bd77418..c4bfc5404 100644 --- a/src/spicelib/devices/jfet2/jfet2ic.c +++ b/src/spicelib/devices/jfet2/jfet2ic.c @@ -26,8 +26,8 @@ JFET2getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->JFET2nextModel) { - for(here = model->JFET2instances; here ; here = here->JFET2nextInstance) { + for( ; model ; model = JFET2nextModel(model)) { + for(here = JFET2instances(model); here ; here = JFET2nextInstance(here)) { if(!here->JFET2icVDSGiven) { here->JFET2icVDS = *(ckt->CKTrhs + here->JFET2drainNode) - diff --git a/src/spicelib/devices/jfet2/jfet2load.c b/src/spicelib/devices/jfet2/jfet2load.c index 4f5d0b08a..ff68f3745 100644 --- a/src/spicelib/devices/jfet2/jfet2load.c +++ b/src/spicelib/devices/jfet2/jfet2load.c @@ -60,11 +60,11 @@ JFET2load(GENmodel *inModel, CKTcircuit *ckt) double m; /* loop through all the models */ - for( ; model != NULL; model = model->JFET2nextModel ) { + for( ; model != NULL; model = JFET2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->JFET2instances; here != NULL ; - here=here->JFET2nextInstance) { + for (here = JFET2instances(model); here != NULL ; + here=JFET2nextInstance(here)) { /* * dc model parameters */ diff --git a/src/spicelib/devices/jfet2/jfet2noi.c b/src/spicelib/devices/jfet2/jfet2noi.c index f3ff8b14a..18742e097 100644 --- a/src/spicelib/devices/jfet2/jfet2noi.c +++ b/src/spicelib/devices/jfet2/jfet2noi.c @@ -50,8 +50,8 @@ JFET2noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->JFET2nextModel) { - for (inst=model->JFET2instances; inst != NULL; inst=inst->JFET2nextInstance) { + for (model=firstModel; model != NULL; model=JFET2nextModel(model)) { + for (inst=JFET2instances(model); inst != NULL; inst=JFET2nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/jfet2/jfet2set.c b/src/spicelib/devices/jfet2/jfet2set.c index 9ba95678c..344379320 100644 --- a/src/spicelib/devices/jfet2/jfet2set.c +++ b/src/spicelib/devices/jfet2/jfet2set.c @@ -28,7 +28,7 @@ JFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the diode models */ - for( ; model != NULL; model = model->JFET2nextModel ) { + for( ; model != NULL; model = JFET2nextModel(model)) { if( (model->JFET2type != NJF) && (model->JFET2type != PJF) ) { model->JFET2type = NJF; @@ -38,8 +38,8 @@ JFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) #include "jfet2parm.h" /* loop through all the instances of the model */ - for (here = model->JFET2instances; here != NULL ; - here=here->JFET2nextInstance) { + for (here = JFET2instances(model); here != NULL ; + here=JFET2nextInstance(here)) { if(!here->JFET2areaGiven) { here->JFET2area = 1; @@ -130,10 +130,10 @@ JFET2unsetup(GENmodel *inModel, CKTcircuit *ckt) JFET2instance *here; for (model = (JFET2model *)inModel; model != NULL; - model = model->JFET2nextModel) + model = JFET2nextModel(model)) { - for (here = model->JFET2instances; here != NULL; - here=here->JFET2nextInstance) + for (here = JFET2instances(model); here != NULL; + here=JFET2nextInstance(here)) { if (here->JFET2drainPrimeNode > 0 && here->JFET2drainPrimeNode != here->JFET2drainNode) diff --git a/src/spicelib/devices/jfet2/jfet2temp.c b/src/spicelib/devices/jfet2/jfet2temp.c index 9ba4dc46f..8f6014361 100644 --- a/src/spicelib/devices/jfet2/jfet2temp.c +++ b/src/spicelib/devices/jfet2/jfet2temp.c @@ -40,7 +40,7 @@ JFET2temp(GENmodel *inModel, CKTcircuit *ckt) double cjfact,cjfact1; /* loop through all the diode models */ - for( ; model != NULL; model = model->JFET2nextModel ) { + for( ; model != NULL; model = JFET2nextModel(model)) { if(!(model->JFET2tnomGiven)) { model->JFET2tnom = ckt->CKTnomTemp; @@ -78,8 +78,8 @@ JFET2temp(GENmodel *inModel, CKTcircuit *ckt) model->JFET2f3 = 1 - model->JFET2fc * (1 + .5); /* loop through all the instances of the model */ - for (here = model->JFET2instances; here != NULL ; - here=here->JFET2nextInstance) { + for (here = JFET2instances(model); here != NULL ; + here=JFET2nextInstance(here)) { if(!(here->JFET2dtempGiven)) { here->JFET2dtemp = 0.0; diff --git a/src/spicelib/devices/jfet2/jfet2trun.c b/src/spicelib/devices/jfet2/jfet2trun.c index 19f9c7813..a05e09cb5 100644 --- a/src/spicelib/devices/jfet2/jfet2trun.c +++ b/src/spicelib/devices/jfet2/jfet2trun.c @@ -22,8 +22,8 @@ JFET2trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) JFET2model *model = (JFET2model*)inModel; JFET2instance *here; - for( ; model != NULL; model = model->JFET2nextModel) { - for(here=model->JFET2instances;here!=NULL;here = here->JFET2nextInstance){ + for( ; model != NULL; model = JFET2nextModel(model)) { + for(here=JFET2instances(model);here!=NULL;here = JFET2nextInstance(here)){ CKTterr(here->JFET2qgs,ckt,timeStep); CKTterr(here->JFET2qgd,ckt,timeStep); diff --git a/src/spicelib/devices/ltra/ltraacct.c b/src/spicelib/devices/ltra/ltraacct.c index e2b30b49c..2615100e7 100644 --- a/src/spicelib/devices/ltra/ltraacct.c +++ b/src/spicelib/devices/ltra/ltraacct.c @@ -22,7 +22,7 @@ LTRAaccept(CKTcircuit *ckt, GENmodel *inModel) /* loop through all the transmission line models */ - for (; model != NULL; model = model->LTRAnextModel) { + for (; model != NULL; model = LTRAnextModel(model)) { if (ckt->CKTmode & MODEINITTRAN) { @@ -46,8 +46,8 @@ LTRAaccept(CKTcircuit *ckt, GENmodel *inModel) model->LTRAh3dashCoeffs = TREALLOC(double, model->LTRAh3dashCoeffs, model->LTRAmodelListSize); } /* loop through all the instances of the model */ - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { if (ckt->CKTmode & MODEINITTRAN) { here->LTRAinstListSize = 10; @@ -269,9 +269,9 @@ LTRAaccept(CKTcircuit *ckt, GENmodel *inModel) */ model = (LTRAmodel *) inModel; - for (; model != NULL; model = model->LTRAnextModel) { - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + for (; model != NULL; model = LTRAnextModel(model)) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { *(here->LTRAv1 + ckt->CKTtimeIndex - 1) = *(here->LTRAv1 + ckt->CKTtimeIndex); *(here->LTRAv2 + ckt->CKTtimeIndex - 1) = *(here->LTRAv2 + diff --git a/src/spicelib/devices/ltra/ltraacld.c b/src/spicelib/devices/ltra/ltraacld.c index a1625f64f..88c277059 100644 --- a/src/spicelib/devices/ltra/ltraacld.c +++ b/src/spicelib/devices/ltra/ltraacld.c @@ -44,7 +44,7 @@ LTRAacLoad(GENmodel *inModel, CKTcircuit *ckt) */ /* loop through all the transmission line models */ - for (; model != NULL; model = model->LTRAnextModel) { + for (; model != NULL; model = LTRAnextModel(model)) { switch (model->LTRAspecialCase) { @@ -103,8 +103,8 @@ LTRAacLoad(GENmodel *inModel, CKTcircuit *ckt) y0exp_i = y0_r * explambda_i + y0_i * explambda_r; /* loop through all the instances of the model */ - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { *(here->LTRAibr1Pos1Ptr + 0) += y0_r; *(here->LTRAibr1Pos1Ptr + 1) += y0_i; diff --git a/src/spicelib/devices/ltra/ltraask.c b/src/spicelib/devices/ltra/ltraask.c index 901b69747..022e73374 100644 --- a/src/spicelib/devices/ltra/ltraask.c +++ b/src/spicelib/devices/ltra/ltraask.c @@ -39,16 +39,16 @@ LTRAask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue * value->iValue = here->LTRAnegNode2; return (OK); case LTRA_MOD_Z0: - value->rValue = here->LTRAmodPtr->LTRAimped; + value->rValue = LTRAmodPtr(here)->LTRAimped; return (OK); case LTRA_MOD_TD: - value->rValue = here->LTRAmodPtr->LTRAtd; + value->rValue = LTRAmodPtr(here)->LTRAtd; return (OK); case LTRA_MOD_NL: - value->rValue = here->LTRAmodPtr->LTRAnl; + value->rValue = LTRAmodPtr(here)->LTRAnl; return (OK); case LTRA_MOD_FREQ: - value->rValue = here->LTRAmodPtr->LTRAf; + value->rValue = LTRAmodPtr(here)->LTRAf; return (OK); case LTRA_V1: value->rValue = here->LTRAinitVolt1; @@ -63,10 +63,10 @@ LTRAask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue * value->rValue = here->LTRAinitCur2; return (OK); case LTRA_MOD_RELTOL: - value->rValue = here->LTRAmodPtr->LTRAreltol; + value->rValue = LTRAmodPtr(here)->LTRAreltol; return (OK); case LTRA_MOD_ABSTOL: - value->rValue = here->LTRAmodPtr->LTRAabstol; + value->rValue = LTRAmodPtr(here)->LTRAabstol; return (OK); case LTRA_BR_EQ1: value->rValue = here->LTRAbrEq1; diff --git a/src/spicelib/devices/ltra/ltraload.c b/src/spicelib/devices/ltra/ltraload.c index ec65e6ab8..4dfb791f9 100644 --- a/src/spicelib/devices/ltra/ltraload.c +++ b/src/spicelib/devices/ltra/ltraload.c @@ -30,7 +30,7 @@ LTRAload(GENmodel *inModel, CKTcircuit *ckt) double max = 0.0, min = 0.0; /* loop through all the transmission line models */ - for (; model != NULL; model = model->LTRAnextModel) { + for (; model != NULL; model = LTRAnextModel(model)) { if (ckt->CKTmode & MODEDC) { switch (model->LTRAspecialCase) { @@ -219,8 +219,8 @@ LTRAload(GENmodel *inModel, CKTcircuit *ckt) } } /* loop through all the instances of the model */ - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { if ((ckt->CKTmode & MODEDC) || (model->LTRAspecialCase == LTRA_MOD_RG)) { diff --git a/src/spicelib/devices/ltra/ltraset.c b/src/spicelib/devices/ltra/ltraset.c index 30f21b3a1..947dde4fb 100644 --- a/src/spicelib/devices/ltra/ltraset.c +++ b/src/spicelib/devices/ltra/ltraset.c @@ -25,7 +25,7 @@ LTRAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) NG_IGNORE(state); /* loop through all the transmission line models */ - for (; model != NULL; model = model->LTRAnextModel) { + for (; model != NULL; model = LTRAnextModel(model)) { if (!model->LTRAnlGiven) { model->LTRAnl = .25; @@ -169,8 +169,8 @@ LTRAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) return (E_BADPARM); } /* loop through all the instances of the model */ - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { if (here->LTRAbrEq1 == 0) { error = CKTmkVolt(ckt, &tmp, here->LTRAname, "i1"); @@ -226,9 +226,9 @@ LTRAunsetup(GENmodel *inModel, CKTcircuit *ckt) LTRAinstance *here; for (model = (LTRAmodel *) inModel; model != NULL; - model = model->LTRAnextModel) { - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + model = LTRAnextModel(model)) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { if (here->LTRAbrEq2 > 0) CKTdltNNum(ckt, here->LTRAbrEq2); here->LTRAbrEq2 = 0; diff --git a/src/spicelib/devices/ltra/ltratemp.c b/src/spicelib/devices/ltra/ltratemp.c index eda23f03a..4b009904e 100644 --- a/src/spicelib/devices/ltra/ltratemp.c +++ b/src/spicelib/devices/ltra/ltratemp.c @@ -23,7 +23,7 @@ LTRAtemp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the transmission line models */ - for (; model != NULL; model = model->LTRAnextModel) { + for (; model != NULL; model = LTRAnextModel(model)) { /* * if(!model->LTRAtdGiven) { model->LTRAtd = model->LTRAnl/model->LTRAf; * } @@ -147,8 +147,8 @@ LTRAtemp(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the instances of the model */ - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { here->LTRAv1 = NULL; here->LTRAi1 = NULL; diff --git a/src/spicelib/devices/ltra/ltratrun.c b/src/spicelib/devices/ltra/ltratrun.c index 2b3a81db6..0332d65f3 100644 --- a/src/spicelib/devices/ltra/ltratrun.c +++ b/src/spicelib/devices/ltra/ltratrun.c @@ -24,10 +24,10 @@ LTRAtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) double x, y, change, deriv, deriv_delta; /* loop through all the transmission line models */ - for (; model != NULL; model = model->LTRAnextModel) { + for (; model != NULL; model = LTRAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->LTRAinstances; here != NULL; - here = here->LTRAnextInstance) { + for (here = LTRAinstances(model); here != NULL; + here = LTRAnextInstance(here)) { switch (model->LTRAspecialCase) { diff --git a/src/spicelib/devices/mes/mesacl.c b/src/spicelib/devices/mes/mesacl.c index 1a323743a..dda311fc2 100644 --- a/src/spicelib/devices/mes/mesacl.c +++ b/src/spicelib/devices/mes/mesacl.c @@ -28,10 +28,10 @@ MESacLoad(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->MESnextModel ) { + for( ; model != NULL; model = MESnextModel(model)) { - for( here = model->MESinstances; here != NULL; - here = here->MESnextInstance) { + for( here = MESinstances(model); here != NULL; + here = MESnextInstance(here)) { m = here->MESm; diff --git a/src/spicelib/devices/mes/mesdisto.c b/src/spicelib/devices/mes/mesdisto.c index b7ec3e248..62567542d 100644 --- a/src/spicelib/devices/mes/mesdisto.c +++ b/src/spicelib/devices/mes/mesdisto.c @@ -40,11 +40,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the MES models */ -for( ; model != NULL; model = model->MESnextModel ) { +for( ; model != NULL; model = MESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MESinstances; here != NULL ; - here=here->MESnextInstance) { + for (here = MESinstances(model); here != NULL ; + here=MESnextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/mes/mesdset.c b/src/spicelib/devices/mes/mesdset.c index 0b64e12ad..bc27ba32f 100644 --- a/src/spicelib/devices/mes/mesdset.c +++ b/src/spicelib/devices/mes/mesdset.c @@ -55,11 +55,11 @@ MESdSetup(GENmodel *inModel, CKTcircuit *ckt) Dderivs d_p, d_q, d_r, d_zero; /* loop through all the models */ - for( ; model != NULL; model = model->MESnextModel ) { + for( ; model != NULL; model = MESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MESinstances; here != NULL ; - here=here->MESnextInstance) { + for (here = MESinstances(model); here != NULL ; + here=MESnextInstance(here)) { /* * dc model parameters diff --git a/src/spicelib/devices/mes/mesgetic.c b/src/spicelib/devices/mes/mesgetic.c index 586962dab..8622a9585 100644 --- a/src/spicelib/devices/mes/mesgetic.c +++ b/src/spicelib/devices/mes/mesgetic.c @@ -22,8 +22,8 @@ MESgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->MESnextModel) { - for(here = model->MESinstances; here ; here = here->MESnextInstance) { + for( ; model ; model = MESnextModel(model)) { + for(here = MESinstances(model); here ; here = MESnextInstance(here)) { if(!here->MESicVDSGiven) { here->MESicVDS = diff --git a/src/spicelib/devices/mes/mesload.c b/src/spicelib/devices/mes/mesload.c index 8eda10ef1..2226991ba 100644 --- a/src/spicelib/devices/mes/mesload.c +++ b/src/spicelib/devices/mes/mesload.c @@ -85,11 +85,11 @@ MESload(GENmodel *inModel, CKTcircuit *ckt) double m; /* loop through all the models */ - for( ; model != NULL; model = model->MESnextModel ) { + for( ; model != NULL; model = MESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MESinstances; here != NULL ; - here=here->MESnextInstance) { + for (here = MESinstances(model); here != NULL ; + here=MESnextInstance(here)) { /* * dc model parameters diff --git a/src/spicelib/devices/mes/mesnoise.c b/src/spicelib/devices/mes/mesnoise.c index e4193cece..8cb3c9d9f 100644 --- a/src/spicelib/devices/mes/mesnoise.c +++ b/src/spicelib/devices/mes/mesnoise.c @@ -45,8 +45,8 @@ MESnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *d "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->MESnextModel) { - for (inst=model->MESinstances; inst != NULL; inst=inst->MESnextInstance) { + for (model=firstModel; model != NULL; model=MESnextModel(model)) { + for (inst=MESinstances(model); inst != NULL; inst=MESnextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/mes/mespzld.c b/src/spicelib/devices/mes/mespzld.c index 81bd34c4d..97af33fab 100644 --- a/src/spicelib/devices/mes/mespzld.c +++ b/src/spicelib/devices/mes/mespzld.c @@ -29,10 +29,10 @@ MESpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double m; - for( ; model != NULL; model = model->MESnextModel ) { + for( ; model != NULL; model = MESnextModel(model)) { - for( here = model->MESinstances; here != NULL; - here = here->MESnextInstance) { + for( here = MESinstances(model); here != NULL; + here = MESnextInstance(here)) { m = here->MESm; diff --git a/src/spicelib/devices/mes/messetup.c b/src/spicelib/devices/mes/messetup.c index e7c885361..61f0dac9e 100644 --- a/src/spicelib/devices/mes/messetup.c +++ b/src/spicelib/devices/mes/messetup.c @@ -24,7 +24,7 @@ MESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the diode models */ - for( ; model != NULL; model = model->MESnextModel ) { + for( ; model != NULL; model = MESnextModel(model)) { if( (model->MEStype != NMF) && (model->MEStype != PMF) ) { model->MEStype = NMF; @@ -73,8 +73,8 @@ MESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->MESinstances; here != NULL ; - here=here->MESnextInstance) { + for (here = MESinstances(model); here != NULL ; + here=MESnextInstance(here)) { if(!here->MESareaGiven) { here->MESarea = 1.0; @@ -163,10 +163,10 @@ MESunsetup(GENmodel *inModel, CKTcircuit *ckt) MESinstance *here; for (model = (MESmodel *)inModel; model != NULL; - model = model->MESnextModel) + model = MESnextModel(model)) { - for (here = model->MESinstances; here != NULL; - here=here->MESnextInstance) + for (here = MESinstances(model); here != NULL; + here=MESnextInstance(here)) { if (here->MESdrainPrimeNode > 0 && here->MESdrainPrimeNode != here->MESdrainNode) diff --git a/src/spicelib/devices/mes/mestemp.c b/src/spicelib/devices/mes/mestemp.c index c82bf5f9e..1329bc9ab 100644 --- a/src/spicelib/devices/mes/mestemp.c +++ b/src/spicelib/devices/mes/mestemp.c @@ -24,7 +24,7 @@ MEStemp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the diode models */ - for( ; model != NULL; model = model->MESnextModel ) { + for( ; model != NULL; model = MESnextModel(model)) { if(model->MESdrainResist != 0) { model->MESdrainConduct = 1/model->MESdrainResist; diff --git a/src/spicelib/devices/mes/mestrunc.c b/src/spicelib/devices/mes/mestrunc.c index 74b1ac89b..b6d8f5354 100644 --- a/src/spicelib/devices/mes/mestrunc.c +++ b/src/spicelib/devices/mes/mestrunc.c @@ -18,8 +18,8 @@ MEStrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) MESmodel *model = (MESmodel*)inModel; MESinstance *here; - for( ; model != NULL; model = model->MESnextModel) { - for(here=model->MESinstances;here!=NULL;here = here->MESnextInstance){ + for( ; model != NULL; model = MESnextModel(model)) { + for(here=MESinstances(model);here!=NULL;here = MESnextInstance(here)){ CKTterr(here->MESqgs,ckt,timeStep); CKTterr(here->MESqgd,ckt,timeStep); diff --git a/src/spicelib/devices/mesa/mesaacl.c b/src/spicelib/devices/mesa/mesaacl.c index 6ac5db842..67341f728 100644 --- a/src/spicelib/devices/mesa/mesaacl.c +++ b/src/spicelib/devices/mesa/mesaacl.c @@ -31,9 +31,9 @@ MESAacLoad(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->MESAnextModel ) { - for( here = model->MESAinstances; here != NULL; - here = here->MESAnextInstance) { + for( ; model != NULL; model = MESAnextModel(model)) { + for( here = MESAinstances(model); here != NULL; + here = MESAnextInstance(here)) { f = ckt->CKTomega/2/M_PI; if(here->MESAdelf == 0) diff --git a/src/spicelib/devices/mesa/mesagetic.c b/src/spicelib/devices/mesa/mesagetic.c index 9b146db90..13f6d44cd 100644 --- a/src/spicelib/devices/mesa/mesagetic.c +++ b/src/spicelib/devices/mesa/mesagetic.c @@ -20,8 +20,8 @@ MESAgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->MESAnextModel) { - for(here = model->MESAinstances; here ; here = here->MESAnextInstance) { + for( ; model ; model = MESAnextModel(model)) { + for(here = MESAinstances(model); here ; here = MESAnextInstance(here)) { if(!here->MESAicVDSGiven) { here->MESAicVDS = diff --git a/src/spicelib/devices/mesa/mesaload.c b/src/spicelib/devices/mesa/mesaload.c index aaf23df6e..e1ffecd4a 100644 --- a/src/spicelib/devices/mesa/mesaload.c +++ b/src/spicelib/devices/mesa/mesaload.c @@ -95,11 +95,11 @@ MESAload(GENmodel *inModel, CKTcircuit *ckt) double m; /* loop through all the models */ - for( ; model != NULL; model = model->MESAnextModel ) { + for( ; model != NULL; model = MESAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MESAinstances; here != NULL ; - here=here->MESAnextInstance) { + for (here = MESAinstances(model); here != NULL ; + here=MESAnextInstance(here)) { /* * dc model parameters diff --git a/src/spicelib/devices/mesa/mesapzl.c b/src/spicelib/devices/mesa/mesapzl.c index 830542256..86b464f81 100644 --- a/src/spicelib/devices/mesa/mesapzl.c +++ b/src/spicelib/devices/mesa/mesapzl.c @@ -31,9 +31,9 @@ MESApzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double m; - for( ; model != NULL; model = model->MESAnextModel ) { - for( here = model->MESAinstances; here != NULL; - here = here->MESAnextInstance) { + for( ; model != NULL; model = MESAnextModel(model)) { + for( here = MESAinstances(model); here != NULL; + here = MESAnextInstance(here)) { f = ckt->CKTomega/2/M_PI; if(here->MESAdelf == 0) diff --git a/src/spicelib/devices/mesa/mesasetup.c b/src/spicelib/devices/mesa/mesasetup.c index b11ebac5b..95c7a05ec 100644 --- a/src/spicelib/devices/mesa/mesasetup.c +++ b/src/spicelib/devices/mesa/mesasetup.c @@ -27,7 +27,7 @@ MESAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the diode models */ - for( ; model != NULL; model = model->MESAnextModel ) { + for( ; model != NULL; model = MESAnextModel(model)) { if( (model->MESAtype != NMF) ) { fprintf(stderr, "Only nmf model type supported, set to nmf\n"); model->MESAtype = NMF; @@ -227,8 +227,8 @@ MESAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) model->MESAvcrit = 0.; /* until model has changed */ /* loop through all the instances of the model */ - for (here = model->MESAinstances; here != NULL ; - here=here->MESAnextInstance) { + for (here = MESAinstances(model); here != NULL ; + here=MESAnextInstance(here)) { if(!here->MESAlengthGiven) { here->MESAlength = 1e-6; @@ -414,10 +414,10 @@ MESAunsetup(GENmodel *inModel, CKTcircuit *ckt) MESAinstance *here; for (model = (MESAmodel *)inModel; model != NULL; - model = model->MESAnextModel) + model = MESAnextModel(model)) { - for (here = model->MESAinstances; here != NULL; - here=here->MESAnextInstance) + for (here = MESAinstances(model); here != NULL; + here=MESAnextInstance(here)) { if (here->MESAdrainPrmPrmNode > 0 && here->MESAdrainPrmPrmNode != here->MESAdrainPrimeNode) diff --git a/src/spicelib/devices/mesa/mesatemp.c b/src/spicelib/devices/mesa/mesatemp.c index 88c08e788..4d8b4136a 100644 --- a/src/spicelib/devices/mesa/mesatemp.c +++ b/src/spicelib/devices/mesa/mesatemp.c @@ -25,7 +25,7 @@ MESAtemp(GENmodel *inModel, CKTcircuit *ckt) double d; - for( ; model != NULL; model = model->MESAnextModel ) { + for( ; model != NULL; model = MESAnextModel(model)) { if(!model->MESAlambdahfGiven) model->MESAlambdahf = model->MESAlambda; if(model->MESAlevel == 2) @@ -40,8 +40,8 @@ MESAtemp(GENmodel *inModel, CKTcircuit *ckt) } model->MESAdeltaSqr = model->MESAdelta*model->MESAdelta; - for (here = model->MESAinstances; here != NULL ; - here=here->MESAnextInstance) { + for (here = MESAinstances(model); here != NULL ; + here=MESAnextInstance(here)) { vt = CONSTKoverQ * here->MESAts; if(model->MESAmu1 == 0 && model->MESAmu2 == 0) diff --git a/src/spicelib/devices/mesa/mesatrunc.c b/src/spicelib/devices/mesa/mesatrunc.c index e81909983..300aa3f6c 100644 --- a/src/spicelib/devices/mesa/mesatrunc.c +++ b/src/spicelib/devices/mesa/mesatrunc.c @@ -16,9 +16,9 @@ MESAtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) MESAmodel *model = (MESAmodel*)inModel; MESAinstance *here; - for( ; model != NULL; model = model->MESAnextModel) { - for(here=model->MESAinstances;here!=NULL; - here = here->MESAnextInstance){ + for( ; model != NULL; model = MESAnextModel(model)) { + for(here=MESAinstances(model);here!=NULL; + here = MESAnextInstance(here)){ CKTterr(here->MESAqgs,ckt,timeStep); CKTterr(here->MESAqgd,ckt,timeStep); diff --git a/src/spicelib/devices/mos1/mos1acld.c b/src/spicelib/devices/mos1/mos1acld.c index 92d8b372a..5cc8ca312 100644 --- a/src/spicelib/devices/mos1/mos1acld.c +++ b/src/spicelib/devices/mos1/mos1acld.c @@ -33,9 +33,9 @@ MOS1acLoad(GENmodel *inModel, CKTcircuit *ckt) double GateSourceOverlapCap; double EffectiveLength; - for( ; model != NULL; model = model->MOS1nextModel) { - for(here = model->MOS1instances; here!= NULL; - here = here->MOS1nextInstance) { + for( ; model != NULL; model = MOS1nextModel(model)) { + for(here = MOS1instances(model); here!= NULL; + here = MOS1nextInstance(here)) { if (here->MOS1mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos1/mos1ask.c b/src/spicelib/devices/mos1/mos1ask.c index d913c162d..8d182044d 100644 --- a/src/spicelib/devices/mos1/mos1ask.c +++ b/src/spicelib/devices/mos1/mos1ask.c @@ -182,7 +182,7 @@ MOS1ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS1_CAPGS: value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgs); /* add overlap capacitance */ - value->rValue += (here->MOS1modPtr->MOS1gateSourceOverlapCapFactor) + value->rValue += (MOS1modPtr(here)->MOS1gateSourceOverlapCapFactor) * here->MOS1m * (here->MOS1w); return(OK); @@ -195,7 +195,7 @@ MOS1ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS1_CAPGD: value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgd); /* add overlap capacitance */ - value->rValue += (here->MOS1modPtr->MOS1gateDrainOverlapCapFactor) + value->rValue += (MOS1modPtr(here)->MOS1gateDrainOverlapCapFactor) * here->MOS1m * (here->MOS1w); return(OK); @@ -208,10 +208,10 @@ MOS1ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS1_CAPGB: value->rValue = 2* *(ckt->CKTstate0 + here->MOS1capgb); /* add overlap capacitance */ - value->rValue += (here->MOS1modPtr->MOS1gateBulkOverlapCapFactor) + value->rValue += (MOS1modPtr(here)->MOS1gateBulkOverlapCapFactor) * here->MOS1m * (here->MOS1l - -2*(here->MOS1modPtr->MOS1latDiff)); + -2*(MOS1modPtr(here)->MOS1latDiff)); return(OK); case MOS1_QGB: value->rValue = *(ckt->CKTstate0 + here->MOS1qgb); diff --git a/src/spicelib/devices/mos1/mos1conv.c b/src/spicelib/devices/mos1/mos1conv.c index 66fdd5ef1..ec333a12b 100644 --- a/src/spicelib/devices/mos1/mos1conv.c +++ b/src/spicelib/devices/mos1/mos1conv.c @@ -29,9 +29,9 @@ MOS1convTest(GENmodel *inModel, CKTcircuit *ckt) double vgdo; double tol; - for( ; model != NULL; model = model->MOS1nextModel) { - for(here = model->MOS1instances; here!= NULL; - here = here->MOS1nextInstance) { + for( ; model != NULL; model = MOS1nextModel(model)) { + for(here = MOS1instances(model); here!= NULL; + here = MOS1nextInstance(here)) { vbs = model->MOS1type * ( *(ckt->CKTrhs+here->MOS1bNode) - diff --git a/src/spicelib/devices/mos1/mos1dist.c b/src/spicelib/devices/mos1/mos1dist.c index 437cf93f4..4cc6e8b58 100644 --- a/src/spicelib/devices/mos1/mos1dist.c +++ b/src/spicelib/devices/mos1/mos1dist.c @@ -46,11 +46,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the MOS1 models */ -for( ; model != NULL; model = model->MOS1nextModel ) { +for( ; model != NULL; model = MOS1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/mos1/mos1dset.c b/src/spicelib/devices/mos1/mos1dset.c index f90e85b19..238ca1c4a 100644 --- a/src/spicelib/devices/mos1/mos1dset.c +++ b/src/spicelib/devices/mos1/mos1dset.c @@ -80,10 +80,10 @@ MOS1dSetup(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the MOS1 device models */ - for( ; model != NULL; model = model->MOS1nextModel ) { + for( ; model != NULL; model = MOS1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { vt = CONSTKoverQ * here->MOS1temp; EffectiveLength=here->MOS1l - 2*model->MOS1latDiff; diff --git a/src/spicelib/devices/mos1/mos1ic.c b/src/spicelib/devices/mos1/mos1ic.c index 31aa4a765..934e00248 100644 --- a/src/spicelib/devices/mos1/mos1ic.c +++ b/src/spicelib/devices/mos1/mos1ic.c @@ -22,8 +22,8 @@ MOS1getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->MOS1nextModel) { - for(here = model->MOS1instances; here ; here = here->MOS1nextInstance) { + for( ; model ; model = MOS1nextModel(model)) { + for(here = MOS1instances(model); here ; here = MOS1nextInstance(here)) { if(!here->MOS1icVBSGiven) { here->MOS1icVBS = diff --git a/src/spicelib/devices/mos1/mos1load.c b/src/spicelib/devices/mos1/mos1load.c index 78904c25a..d013aeba6 100644 --- a/src/spicelib/devices/mos1/mos1load.c +++ b/src/spicelib/devices/mos1/mos1load.c @@ -95,11 +95,11 @@ MOS1load(GENmodel *inModel, CKTcircuit *ckt) #endif /* CAPBYPASS */ /* loop through all the MOS1 device models */ - for( ; model != NULL; model = model->MOS1nextModel ) { + for( ; model != NULL; model = MOS1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { vt = CONSTKoverQ * here->MOS1temp; Check=1; diff --git a/src/spicelib/devices/mos1/mos1noi.c b/src/spicelib/devices/mos1/mos1noi.c index 31f171966..9b97961af 100644 --- a/src/spicelib/devices/mos1/mos1noi.c +++ b/src/spicelib/devices/mos1/mos1noi.c @@ -47,7 +47,7 @@ MOS1noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->MOS1nextModel) { + for (model=firstModel; model != NULL; model=MOS1nextModel(model)) { /* Oxide capacitance can be zero in MOS level 1. Since this will give us problems in our 1/f */ /* noise model, we ASSUME an actual "tox" of 1e-7 */ @@ -58,7 +58,7 @@ MOS1noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, coxSquared = model->MOS1oxideCapFactor; } coxSquared *= coxSquared; - for (inst=model->MOS1instances; inst != NULL; inst=inst->MOS1nextInstance) { + for (inst=MOS1instances(model); inst != NULL; inst=MOS1nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/mos1/mos1pzld.c b/src/spicelib/devices/mos1/mos1pzld.c index 721c539cd..c260527ea 100644 --- a/src/spicelib/devices/mos1/mos1pzld.c +++ b/src/spicelib/devices/mos1/mos1pzld.c @@ -34,9 +34,9 @@ MOS1pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double GateSourceOverlapCap; double EffectiveLength; - for( ; model != NULL; model = model->MOS1nextModel) { - for(here = model->MOS1instances; here!= NULL; - here = here->MOS1nextInstance) { + for( ; model != NULL; model = MOS1nextModel(model)) { + for(here = MOS1instances(model); here!= NULL; + here = MOS1nextInstance(here)) { if (here->MOS1mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos1/mos1sacl.c b/src/spicelib/devices/mos1/mos1sacl.c index c71101dc7..03f8272b5 100644 --- a/src/spicelib/devices/mos1/mos1sacl.c +++ b/src/spicelib/devices/mos1/mos1sacl.c @@ -128,9 +128,9 @@ MOS1sAcLoad(GENmodel *inModel, CKTcircuit *ckt) #endif /* SENSDEBUG */ info = ckt->CKTsenInfo; info->SENstatus = PERTURBATION; - for( ; model != NULL; model = model->MOS1nextModel) { - for(here = model->MOS1instances; here!= NULL; - here = here->MOS1nextInstance) { + for( ; model != NULL; model = MOS1nextModel(model)) { + for(here = MOS1instances(model); here!= NULL; + here = MOS1nextInstance(here)) { /* save the unperturbed values in the state vector */ for(i=0; i <= 16; i++) diff --git a/src/spicelib/devices/mos1/mos1set.c b/src/spicelib/devices/mos1/mos1set.c index 128c6769e..a4483de3a 100644 --- a/src/spicelib/devices/mos1/mos1set.c +++ b/src/spicelib/devices/mos1/mos1set.c @@ -25,7 +25,7 @@ MOS1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, CKTnode *tmp; /* loop through all the MOS1 device models */ - for( ; model != NULL; model = model->MOS1nextModel ) { + for( ; model != NULL; model = MOS1nextModel(model)) { if(!model->MOS1typeGiven) { model->MOS1type = NMOS; @@ -89,8 +89,8 @@ MOS1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, } /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { /* allocate a chunk of the state vector */ here->MOS1states = *states; @@ -218,10 +218,10 @@ MOS1unsetup(GENmodel *inModel, CKTcircuit *ckt) MOS1instance *here; for (model = (MOS1model *)inModel; model != NULL; - model = model->MOS1nextModel) + model = MOS1nextModel(model)) { - for (here = model->MOS1instances; here != NULL; - here=here->MOS1nextInstance) + for (here = MOS1instances(model); here != NULL; + here=MOS1nextInstance(here)) { if (here->MOS1sNodePrime > 0 && here->MOS1sNodePrime != here->MOS1sNode) diff --git a/src/spicelib/devices/mos1/mos1sld.c b/src/spicelib/devices/mos1/mos1sld.c index 97cb54754..f2240b289 100644 --- a/src/spicelib/devices/mos1/mos1sld.c +++ b/src/spicelib/devices/mos1/mos1sld.c @@ -93,11 +93,11 @@ MOS1sLoad(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the models */ - for( ; model != NULL; model = model->MOS1nextModel ) { + for( ; model != NULL; model = MOS1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { #ifdef SENSDEBUG printf("senload instance name %s\n",here->MOS1name); diff --git a/src/spicelib/devices/mos1/mos1sprt.c b/src/spicelib/devices/mos1/mos1sprt.c index c13e6078e..5e5e402d1 100644 --- a/src/spicelib/devices/mos1/mos1sprt.c +++ b/src/spicelib/devices/mos1/mos1sprt.c @@ -28,13 +28,13 @@ MOS1sPrint(GENmodel *inModel, CKTcircuit *ckt) printf("LEVEL 1 MOSFETS-----------------\n"); /* loop through all the MOS1 models */ - for( ; model != NULL; model = model->MOS1nextModel ) { + for( ; model != NULL; model = MOS1nextModel(model)) { printf("Model name:%s\n",model->MOS1modName); /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { printf(" Instance name:%s\n",here->MOS1name); printf(" Drain, Gate , Source nodes: %s, %s ,%s\n", diff --git a/src/spicelib/devices/mos1/mos1sset.c b/src/spicelib/devices/mos1/mos1sset.c index 10bbc8789..1cff312b9 100644 --- a/src/spicelib/devices/mos1/mos1sset.c +++ b/src/spicelib/devices/mos1/mos1sset.c @@ -22,11 +22,11 @@ MOS1sSetup(SENstruct *info, GENmodel *inModel) MOS1instance *here; /* loop through all the models */ - for( ; model != NULL; model = model->MOS1nextModel ) { + for( ; model != NULL; model = MOS1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { if(here->MOS1senParmNo){ if((here->MOS1sens_l)&&(here->MOS1sens_w)){ diff --git a/src/spicelib/devices/mos1/mos1supd.c b/src/spicelib/devices/mos1/mos1supd.c index bee4c31c3..2df92a6b3 100644 --- a/src/spicelib/devices/mos1/mos1supd.c +++ b/src/spicelib/devices/mos1/mos1supd.c @@ -51,11 +51,11 @@ MOS1sUpdate(GENmodel *inModel, CKTcircuit *ckt) dummy2 = 0; /* loop through all the MOS1 models */ - for( ; model != NULL; model = model->MOS1nextModel ) { + for( ; model != NULL; model = MOS1nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS1instances; here != NULL ; - here=here->MOS1nextInstance) { + for (here = MOS1instances(model); here != NULL ; + here=MOS1nextInstance(here)) { #ifdef SENSDEBUG printf("senupdate instance name %s\n",here->MOS1name); diff --git a/src/spicelib/devices/mos1/mos1temp.c b/src/spicelib/devices/mos1/mos1temp.c index 2f0ecf2cc..83bc15664 100644 --- a/src/spicelib/devices/mos1/mos1temp.c +++ b/src/spicelib/devices/mos1/mos1temp.c @@ -34,7 +34,7 @@ MOS1temp(GENmodel *inModel, CKTcircuit *ckt) double fermis; double vfb; /* loop through all the resistor models */ - for( ; model != NULL; model = model->MOS1nextModel) { + for( ; model != NULL; model = MOS1nextModel(model)) { /* perform model defaulting */ @@ -114,8 +114,8 @@ MOS1temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all instances of the model */ - for(here = model->MOS1instances; here!= NULL; - here = here->MOS1nextInstance) { + for(here = MOS1instances(model); here!= NULL; + here = MOS1nextInstance(here)) { double czbd; /* zero voltage bulk-drain capacitance */ double czbdsw; /* zero voltage bulk-drain sidewall capacitance */ double czbs; /* zero voltage bulk-source capacitance */ diff --git a/src/spicelib/devices/mos1/mos1trun.c b/src/spicelib/devices/mos1/mos1trun.c index 2090b6bf8..81e11fdf0 100644 --- a/src/spicelib/devices/mos1/mos1trun.c +++ b/src/spicelib/devices/mos1/mos1trun.c @@ -18,8 +18,8 @@ MOS1trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) MOS1model *model = (MOS1model *)inModel; MOS1instance *here; - for( ; model != NULL; model = model->MOS1nextModel) { - for(here=model->MOS1instances;here!=NULL;here = here->MOS1nextInstance){ + for( ; model != NULL; model = MOS1nextModel(model)) { + for(here=MOS1instances(model);here!=NULL;here = MOS1nextInstance(here)){ CKTterr(here->MOS1qgs,ckt,timeStep); CKTterr(here->MOS1qgd,ckt,timeStep); diff --git a/src/spicelib/devices/mos2/mos2acld.c b/src/spicelib/devices/mos2/mos2acld.c index 6e24c7bde..7e4fea7b5 100644 --- a/src/spicelib/devices/mos2/mos2acld.c +++ b/src/spicelib/devices/mos2/mos2acld.c @@ -33,9 +33,9 @@ MOS2acLoad(GENmodel *inModel, CKTcircuit *ckt) double GateSourceOverlapCap; double EffectiveLength; - for( ; model != NULL; model = model->MOS2nextModel) { - for(here = model->MOS2instances; here!= NULL; - here = here->MOS2nextInstance) { + for( ; model != NULL; model = MOS2nextModel(model)) { + for(here = MOS2instances(model); here!= NULL; + here = MOS2nextInstance(here)) { if (here->MOS2mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos2/mos2ask.c b/src/spicelib/devices/mos2/mos2ask.c index 36378479e..19243a040 100644 --- a/src/spicelib/devices/mos2/mos2ask.c +++ b/src/spicelib/devices/mos2/mos2ask.c @@ -182,7 +182,7 @@ MOS2ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS2_CAPGS: value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgs); /* add overlap capacitance */ - value->rValue += (here->MOS2modPtr->MOS2gateSourceOverlapCapFactor) + value->rValue += (MOS2modPtr(here)->MOS2gateSourceOverlapCapFactor) * here->MOS2m * (here->MOS2w); return(OK); @@ -195,7 +195,7 @@ MOS2ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS2_CAPGD: value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgd); /* add overlap capacitance */ - value->rValue += (here->MOS2modPtr->MOS2gateDrainOverlapCapFactor) + value->rValue += (MOS2modPtr(here)->MOS2gateDrainOverlapCapFactor) * here->MOS2m * (here->MOS2w); return(OK); @@ -208,10 +208,10 @@ MOS2ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS2_CAPGB: value->rValue = 2* *(ckt->CKTstate0 + here->MOS2capgb); /* add overlap capacitance */ - value->rValue += (here->MOS2modPtr->MOS2gateBulkOverlapCapFactor) + value->rValue += (MOS2modPtr(here)->MOS2gateBulkOverlapCapFactor) * here->MOS2m * (here->MOS2l - -2*(here->MOS2modPtr->MOS2latDiff)); + -2*(MOS2modPtr(here)->MOS2latDiff)); return(OK); case MOS2_QGB: value->rValue = *(ckt->CKTstate0 + here->MOS2qgb); diff --git a/src/spicelib/devices/mos2/mos2conv.c b/src/spicelib/devices/mos2/mos2conv.c index 7748f82a1..3d035447c 100644 --- a/src/spicelib/devices/mos2/mos2conv.c +++ b/src/spicelib/devices/mos2/mos2conv.c @@ -29,9 +29,9 @@ MOS2convTest(GENmodel *inModel, CKTcircuit *ckt) double vgdo; double tol; - for( ; model != NULL; model = model->MOS2nextModel) { - for(here = model->MOS2instances; here!= NULL; - here = here->MOS2nextInstance) { + for( ; model != NULL; model = MOS2nextModel(model)) { + for(here = MOS2instances(model); here!= NULL; + here = MOS2nextInstance(here)) { vbs = model->MOS2type * ( *(ckt->CKTrhs+here->MOS2bNode) - diff --git a/src/spicelib/devices/mos2/mos2dist.c b/src/spicelib/devices/mos2/mos2dist.c index 04ed67743..b3ff644cd 100644 --- a/src/spicelib/devices/mos2/mos2dist.c +++ b/src/spicelib/devices/mos2/mos2dist.c @@ -45,11 +45,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the MOS2 models */ -for( ; model != NULL; model = model->MOS2nextModel ) { +for( ; model != NULL; model = MOS2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/mos2/mos2dset.c b/src/spicelib/devices/mos2/mos2dset.c index 939dc4acd..388a1fa5b 100644 --- a/src/spicelib/devices/mos2/mos2dset.c +++ b/src/spicelib/devices/mos2/mos2dset.c @@ -70,11 +70,11 @@ double gmbds; Dderivs d_cdrain; /* loop through all the MOS2 device models */ - for( ; model != NULL; model = model->MOS2nextModel ) { + for( ; model != NULL; model = MOS2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { vt = CONSTKoverQ * here->MOS2temp; diff --git a/src/spicelib/devices/mos2/mos2ic.c b/src/spicelib/devices/mos2/mos2ic.c index 9b85538b5..d0fbb74fa 100644 --- a/src/spicelib/devices/mos2/mos2ic.c +++ b/src/spicelib/devices/mos2/mos2ic.c @@ -22,8 +22,8 @@ MOS2getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->MOS2nextModel) { - for(here = model->MOS2instances; here ; here = here->MOS2nextInstance) { + for( ; model ; model = MOS2nextModel(model)) { + for(here = MOS2instances(model); here ; here = MOS2nextInstance(here)) { if(!here->MOS2icVBSGiven) { here->MOS2icVBS = diff --git a/src/spicelib/devices/mos2/mos2load.c b/src/spicelib/devices/mos2/mos2load.c index fb4683338..364429a13 100644 --- a/src/spicelib/devices/mos2/mos2load.c +++ b/src/spicelib/devices/mos2/mos2load.c @@ -103,11 +103,11 @@ MOS2load(GENmodel *inModel, CKTcircuit *ckt) #endif /* CAPBYPASS */ /* loop through all the MOS2 device models */ - for( ; model != NULL; model = model->MOS2nextModel ) { + for( ; model != NULL; model = MOS2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { vt = CONSTKoverQ * here->MOS2temp; Check=1; diff --git a/src/spicelib/devices/mos2/mos2noi.c b/src/spicelib/devices/mos2/mos2noi.c index ecfbf01cc..4069c653c 100644 --- a/src/spicelib/devices/mos2/mos2noi.c +++ b/src/spicelib/devices/mos2/mos2noi.c @@ -46,8 +46,8 @@ MOS2noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->MOS2nextModel) { - for (inst=model->MOS2instances; inst != NULL; inst=inst->MOS2nextInstance) { + for (model=firstModel; model != NULL; model=MOS2nextModel(model)) { + for (inst=MOS2instances(model); inst != NULL; inst=MOS2nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/mos2/mos2pzld.c b/src/spicelib/devices/mos2/mos2pzld.c index 27363fa97..c7c262937 100644 --- a/src/spicelib/devices/mos2/mos2pzld.c +++ b/src/spicelib/devices/mos2/mos2pzld.c @@ -34,9 +34,9 @@ MOS2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double GateSourceOverlapCap; double EffectiveLength; - for( ; model != NULL; model = model->MOS2nextModel) { - for(here = model->MOS2instances; here!= NULL; - here = here->MOS2nextInstance) { + for( ; model != NULL; model = MOS2nextModel(model)) { + for(here = MOS2instances(model); here!= NULL; + here = MOS2nextInstance(here)) { if (here->MOS2mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos2/mos2sacl.c b/src/spicelib/devices/mos2/mos2sacl.c index efef2a5ae..67f117721 100644 --- a/src/spicelib/devices/mos2/mos2sacl.c +++ b/src/spicelib/devices/mos2/mos2sacl.c @@ -128,9 +128,9 @@ MOS2sAcLoad(GENmodel *inModel, CKTcircuit *ckt) #endif /* SENSDEBUG */ info = ckt->CKTsenInfo; info->SENstatus = PERTURBATION; - for( ; model != NULL; model = model->MOS2nextModel) { - for(here = model->MOS2instances; here!= NULL; - here = here->MOS2nextInstance) { + for( ; model != NULL; model = MOS2nextModel(model)) { + for(here = MOS2instances(model); here!= NULL; + here = MOS2nextInstance(here)) { /* save the unperturbed values in the state vector */ for(i=0; i <= 16; i++) diff --git a/src/spicelib/devices/mos2/mos2set.c b/src/spicelib/devices/mos2/mos2set.c index 5ed8d5ce8..b12eb1a98 100644 --- a/src/spicelib/devices/mos2/mos2set.c +++ b/src/spicelib/devices/mos2/mos2set.c @@ -24,7 +24,7 @@ MOS2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the MOS2 device models */ - for( ; model != NULL; model = model->MOS2nextModel ) { + for( ; model != NULL; model = MOS2nextModel(model)) { if(!model->MOS2typeGiven) { model->MOS2type = NMOS; @@ -118,8 +118,8 @@ MOS2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -241,10 +241,10 @@ MOS2unsetup(GENmodel *inModel, CKTcircuit *ckt) MOS2instance *here; for (model = (MOS2model *)inModel; model != NULL; - model = model->MOS2nextModel) + model = MOS2nextModel(model)) { - for (here = model->MOS2instances; here != NULL; - here=here->MOS2nextInstance) + for (here = MOS2instances(model); here != NULL; + here=MOS2nextInstance(here)) { if (here->MOS2sNodePrime > 0 && here->MOS2sNodePrime != here->MOS2sNode) diff --git a/src/spicelib/devices/mos2/mos2sld.c b/src/spicelib/devices/mos2/mos2sld.c index 7e24d99b9..0cf2c711f 100644 --- a/src/spicelib/devices/mos2/mos2sld.c +++ b/src/spicelib/devices/mos2/mos2sld.c @@ -93,11 +93,11 @@ MOS2sLoad(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the models */ - for( ; model != NULL; model = model->MOS2nextModel ) { + for( ; model != NULL; model = MOS2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { #ifdef SENSDEBUG printf("senload instance name %s\n",here->MOS2name); diff --git a/src/spicelib/devices/mos2/mos2sprt.c b/src/spicelib/devices/mos2/mos2sprt.c index e92879391..303c14b86 100644 --- a/src/spicelib/devices/mos2/mos2sprt.c +++ b/src/spicelib/devices/mos2/mos2sprt.c @@ -24,13 +24,13 @@ MOS2sPrint(GENmodel *inModel, CKTcircuit *ckt) printf("LEVEL 2 MOSFETS-----------------\n"); /* loop through all the MOS2 models */ - for( ; model != NULL; model = model->MOS2nextModel ) { + for( ; model != NULL; model = MOS2nextModel(model)) { printf("Model name:%s\n",model->MOS2modName); /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { printf(" Instance name:%s\n",here->MOS2name); printf(" Drain, Gate , Source nodes: %s, %s ,%s\n", diff --git a/src/spicelib/devices/mos2/mos2sset.c b/src/spicelib/devices/mos2/mos2sset.c index 838c34b86..b82661c20 100644 --- a/src/spicelib/devices/mos2/mos2sset.c +++ b/src/spicelib/devices/mos2/mos2sset.c @@ -22,11 +22,11 @@ MOS2sSetup(SENstruct *info, GENmodel *inModel) MOS2instance *here; /* loop through all the models */ - for( ; model != NULL; model = model->MOS2nextModel ) { + for( ; model != NULL; model = MOS2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { if(here->MOS2senParmNo){ if((here->MOS2sens_l)&&(here->MOS2sens_w)){ diff --git a/src/spicelib/devices/mos2/mos2supd.c b/src/spicelib/devices/mos2/mos2supd.c index 275bb6eb9..5a1a78031 100644 --- a/src/spicelib/devices/mos2/mos2supd.c +++ b/src/spicelib/devices/mos2/mos2supd.c @@ -51,11 +51,11 @@ MOS2sUpdate(GENmodel *inModel, CKTcircuit *ckt) dummy2 = 0; /* loop through all the MOS2 models */ - for( ; model != NULL; model = model->MOS2nextModel ) { + for( ; model != NULL; model = MOS2nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS2instances; here != NULL ; - here=here->MOS2nextInstance) { + for (here = MOS2instances(model); here != NULL ; + here=MOS2nextInstance(here)) { #ifdef SENSDEBUG printf("senupdate instance name %s\n",here->MOS2name); diff --git a/src/spicelib/devices/mos2/mos2temp.c b/src/spicelib/devices/mos2/mos2temp.c index 29a83122d..f51deef98 100644 --- a/src/spicelib/devices/mos2/mos2temp.c +++ b/src/spicelib/devices/mos2/mos2temp.c @@ -37,7 +37,7 @@ MOS2temp(GENmodel *inModel, CKTcircuit *ckt) double gmaold,gmanew; double capfact; /* loop through all the resistor models */ - for( ; model != NULL; model = model->MOS2nextModel) { + for( ; model != NULL; model = MOS2nextModel(model)) { /* perform model defaulting */ @@ -121,8 +121,8 @@ MOS2temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all instances of the model */ - for(here = model->MOS2instances; here!= NULL; - here = here->MOS2nextInstance) { + for(here = MOS2instances(model); here!= NULL; + here = MOS2nextInstance(here)) { double czbd; /* zero voltage bulk-drain capacitance */ double czbdsw; /* zero voltage bulk-drain sidewall capacitance */ double czbs; /* zero voltage bulk-source capacitance */ diff --git a/src/spicelib/devices/mos2/mos2trun.c b/src/spicelib/devices/mos2/mos2trun.c index 76952bc01..20de2ef8b 100644 --- a/src/spicelib/devices/mos2/mos2trun.c +++ b/src/spicelib/devices/mos2/mos2trun.c @@ -18,8 +18,8 @@ MOS2trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) MOS2model *model = (MOS2model *)inModel; MOS2instance *here; - for( ; model != NULL; model = model->MOS2nextModel) { - for(here=model->MOS2instances;here!=NULL;here = here->MOS2nextInstance){ + for( ; model != NULL; model = MOS2nextModel(model)) { + for(here=MOS2instances(model);here!=NULL;here = MOS2nextInstance(here)){ CKTterr(here->MOS2qgs,ckt,timeStep); CKTterr(here->MOS2qgd,ckt,timeStep); diff --git a/src/spicelib/devices/mos3/mos3acld.c b/src/spicelib/devices/mos3/mos3acld.c index 61670e929..49c014e4f 100644 --- a/src/spicelib/devices/mos3/mos3acld.c +++ b/src/spicelib/devices/mos3/mos3acld.c @@ -34,9 +34,9 @@ MOS3acLoad(GENmodel *inModel, CKTcircuit *ckt) double GateDrainOverlapCap; double GateSourceOverlapCap; - for( ; model != NULL; model = model->MOS3nextModel) { - for(here = model->MOS3instances; here!= NULL; - here = here->MOS3nextInstance) { + for( ; model != NULL; model = MOS3nextModel(model)) { + for(here = MOS3instances(model); here!= NULL; + here = MOS3nextInstance(here)) { if (here->MOS3mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos3/mos3ask.c b/src/spicelib/devices/mos3/mos3ask.c index 5ac10f317..cadbbde3c 100644 --- a/src/spicelib/devices/mos3/mos3ask.c +++ b/src/spicelib/devices/mos3/mos3ask.c @@ -182,11 +182,11 @@ MOS3ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS3_CAPGS: value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgs); /* add overlap capacitance */ - value->rValue += (here->MOS3modPtr->MOS3gateSourceOverlapCapFactor) + value->rValue += (MOS3modPtr(here)->MOS3gateSourceOverlapCapFactor) * here->MOS3m * (here->MOS3w - +here->MOS3modPtr->MOS3widthAdjust - -2*(here->MOS3modPtr->MOS3widthNarrow)); + +MOS3modPtr(here)->MOS3widthAdjust + -2*(MOS3modPtr(here)->MOS3widthNarrow)); return(OK); case MOS3_QGS: value->rValue = *(ckt->CKTstate0 + here->MOS3qgs); @@ -197,11 +197,11 @@ MOS3ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS3_CAPGD: value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgd); /* add overlap capacitance */ - value->rValue += (here->MOS3modPtr->MOS3gateDrainOverlapCapFactor) + value->rValue += (MOS3modPtr(here)->MOS3gateDrainOverlapCapFactor) * here->MOS3m * (here->MOS3w - +here->MOS3modPtr->MOS3widthAdjust - -2*(here->MOS3modPtr->MOS3widthNarrow)); + +MOS3modPtr(here)->MOS3widthAdjust + -2*(MOS3modPtr(here)->MOS3widthNarrow)); return(OK); case MOS3_QGD: value->rValue = *(ckt->CKTstate0 + here->MOS3qgd); @@ -212,11 +212,11 @@ MOS3ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, case MOS3_CAPGB: value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgb); /* add overlap capacitance */ - value->rValue += (here->MOS3modPtr->MOS3gateBulkOverlapCapFactor) + value->rValue += (MOS3modPtr(here)->MOS3gateBulkOverlapCapFactor) * here->MOS3m * (here->MOS3l - +here->MOS3modPtr->MOS3lengthAdjust - -2*(here->MOS3modPtr->MOS3latDiff)); + +MOS3modPtr(here)->MOS3lengthAdjust + -2*(MOS3modPtr(here)->MOS3latDiff)); return(OK); case MOS3_QGB: value->rValue = *(ckt->CKTstate0 + here->MOS3qgb); diff --git a/src/spicelib/devices/mos3/mos3conv.c b/src/spicelib/devices/mos3/mos3conv.c index ae7419ab8..a746bb581 100644 --- a/src/spicelib/devices/mos3/mos3conv.c +++ b/src/spicelib/devices/mos3/mos3conv.c @@ -29,9 +29,9 @@ MOS3convTest(GENmodel *inModel, CKTcircuit *ckt) double vgdo; double tol; - for( ; model != NULL; model = model->MOS3nextModel) { - for(here = model->MOS3instances; here!= NULL; - here = here->MOS3nextInstance) { + for( ; model != NULL; model = MOS3nextModel(model)) { + for(here = MOS3instances(model); here!= NULL; + here = MOS3nextInstance(here)) { vbs = model->MOS3type * ( *(ckt->CKTrhs+here->MOS3bNode) - diff --git a/src/spicelib/devices/mos3/mos3dist.c b/src/spicelib/devices/mos3/mos3dist.c index 4e2b5f4ca..25fa52b76 100644 --- a/src/spicelib/devices/mos3/mos3dist.c +++ b/src/spicelib/devices/mos3/mos3dist.c @@ -45,11 +45,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the MOS3 models */ -for( ; model != NULL; model = model->MOS3nextModel ) { +for( ; model != NULL; model = MOS3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/mos3/mos3dset.c b/src/spicelib/devices/mos3/mos3dset.c index 6365ff29e..21c7fb783 100644 --- a/src/spicelib/devices/mos3/mos3dset.c +++ b/src/spicelib/devices/mos3/mos3dset.c @@ -61,11 +61,11 @@ MOS3dSetup(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the MOS3 device models */ - for( ; model != NULL; model = model->MOS3nextModel ) { + for( ; model != NULL; model = MOS3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { vt = CONSTKoverQ * here->MOS3temp; diff --git a/src/spicelib/devices/mos3/mos3ic.c b/src/spicelib/devices/mos3/mos3ic.c index 95d4d35a7..76dcd58e2 100644 --- a/src/spicelib/devices/mos3/mos3ic.c +++ b/src/spicelib/devices/mos3/mos3ic.c @@ -22,8 +22,8 @@ MOS3getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->MOS3nextModel) { - for(here = model->MOS3instances; here ; here = here->MOS3nextInstance) { + for( ; model ; model = MOS3nextModel(model)) { + for(here = MOS3instances(model); here ; here = MOS3nextInstance(here)) { if(!here->MOS3icVBSGiven) { here->MOS3icVBS = diff --git a/src/spicelib/devices/mos3/mos3load.c b/src/spicelib/devices/mos3/mos3load.c index d9b2b1b37..cd020b9eb 100644 --- a/src/spicelib/devices/mos3/mos3load.c +++ b/src/spicelib/devices/mos3/mos3load.c @@ -102,11 +102,11 @@ MOS3load(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the MOS3 device models */ next: - for( ; model != NULL; model = model->MOS3nextModel ) { + for( ; model != NULL; model = MOS3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { vt = CONSTKoverQ * here->MOS3temp; Check=1; diff --git a/src/spicelib/devices/mos3/mos3noi.c b/src/spicelib/devices/mos3/mos3noi.c index 383c7a6f8..82008d9b5 100644 --- a/src/spicelib/devices/mos3/mos3noi.c +++ b/src/spicelib/devices/mos3/mos3noi.c @@ -46,8 +46,8 @@ MOS3noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->MOS3nextModel) { - for (inst=model->MOS3instances; inst != NULL; inst=inst->MOS3nextInstance) { + for (model=firstModel; model != NULL; model=MOS3nextModel(model)) { + for (inst=MOS3instances(model); inst != NULL; inst=MOS3nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/mos3/mos3pzld.c b/src/spicelib/devices/mos3/mos3pzld.c index 744134e35..7ac8d5891 100644 --- a/src/spicelib/devices/mos3/mos3pzld.c +++ b/src/spicelib/devices/mos3/mos3pzld.c @@ -35,9 +35,9 @@ MOS3pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double EffectiveLength; double EffectiveWidth; - for( ; model != NULL; model = model->MOS3nextModel) { - for(here = model->MOS3instances; here!= NULL; - here = here->MOS3nextInstance) { + for( ; model != NULL; model = MOS3nextModel(model)) { + for(here = MOS3instances(model); here!= NULL; + here = MOS3nextInstance(here)) { if (here->MOS3mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos3/mos3sacl.c b/src/spicelib/devices/mos3/mos3sacl.c index 4cb06a833..0e74295ed 100644 --- a/src/spicelib/devices/mos3/mos3sacl.c +++ b/src/spicelib/devices/mos3/mos3sacl.c @@ -128,9 +128,9 @@ MOS3sAcLoad(GENmodel *inModel, CKTcircuit *ckt) #endif /* SENSDEBUG */ info = ckt->CKTsenInfo; info->SENstatus = PERTURBATION; - for( ; model != NULL; model = model->MOS3nextModel) { - for(here = model->MOS3instances; here!= NULL; - here = here->MOS3nextInstance) { + for( ; model != NULL; model = MOS3nextModel(model)) { + for(here = MOS3instances(model); here!= NULL; + here = MOS3nextInstance(here)) { /* save the unperturbed values in the state vector */ for(i=0; i <= 16; i++) diff --git a/src/spicelib/devices/mos3/mos3set.c b/src/spicelib/devices/mos3/mos3set.c index 1e8cac082..4432ba461 100644 --- a/src/spicelib/devices/mos3/mos3set.c +++ b/src/spicelib/devices/mos3/mos3set.c @@ -28,7 +28,7 @@ MOS3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the MOS3 device models */ - for( ; model != NULL; model = model->MOS3nextModel ) { + for( ; model != NULL; model = MOS3nextModel(model)) { /* perform model defaulting */ if(!model->MOS3typeGiven) { @@ -141,8 +141,8 @@ MOS3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -266,10 +266,10 @@ MOS3unsetup(GENmodel *inModel, CKTcircuit *ckt) MOS3instance *here; for (model = (MOS3model *)inModel; model != NULL; - model = model->MOS3nextModel) + model = MOS3nextModel(model)) { - for (here = model->MOS3instances; here != NULL; - here=here->MOS3nextInstance) + for (here = MOS3instances(model); here != NULL; + here=MOS3nextInstance(here)) { if (here->MOS3sNodePrime > 0 && here->MOS3sNodePrime != here->MOS3sNode) diff --git a/src/spicelib/devices/mos3/mos3sld.c b/src/spicelib/devices/mos3/mos3sld.c index 729fef2b0..0259aef50 100644 --- a/src/spicelib/devices/mos3/mos3sld.c +++ b/src/spicelib/devices/mos3/mos3sld.c @@ -95,11 +95,11 @@ MOS3sLoad(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the models */ - for( ; model != NULL; model = model->MOS3nextModel ) { + for( ; model != NULL; model = MOS3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { #ifdef SENSDEBUG printf("senload instance name %s\n",here->MOS3name); diff --git a/src/spicelib/devices/mos3/mos3sprt.c b/src/spicelib/devices/mos3/mos3sprt.c index 24ddfc01c..cfa7356c7 100644 --- a/src/spicelib/devices/mos3/mos3sprt.c +++ b/src/spicelib/devices/mos3/mos3sprt.c @@ -25,13 +25,13 @@ MOS3sPrint(GENmodel *inModel, CKTcircuit *ckt) printf("LEVEL 3 MOSFETS-----------------\n"); /* loop through all the MOS3 models */ - for( ; model != NULL; model = model->MOS3nextModel ) { + for( ; model != NULL; model = MOS3nextModel(model)) { printf("Model name:%s\n",model->MOS3modName); /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { printf(" Instance name:%s\n",here->MOS3name); printf(" Drain, Gate , Source nodes: %s, %s ,%s\n", diff --git a/src/spicelib/devices/mos3/mos3sset.c b/src/spicelib/devices/mos3/mos3sset.c index b7a1f8899..0be5ee875 100644 --- a/src/spicelib/devices/mos3/mos3sset.c +++ b/src/spicelib/devices/mos3/mos3sset.c @@ -23,11 +23,11 @@ MOS3sSetup(SENstruct *info, GENmodel *inModel) MOS3instance *here; /* loop through all the models */ - for( ; model != NULL; model = model->MOS3nextModel ) { + for( ; model != NULL; model = MOS3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { if(here->MOS3senParmNo){ if((here->MOS3sens_l)&&(here->MOS3sens_w)){ diff --git a/src/spicelib/devices/mos3/mos3supd.c b/src/spicelib/devices/mos3/mos3supd.c index 0e1de533d..7215677a7 100644 --- a/src/spicelib/devices/mos3/mos3supd.c +++ b/src/spicelib/devices/mos3/mos3supd.c @@ -49,11 +49,11 @@ MOS3sUpdate(GENmodel *inModel, CKTcircuit *ckt) dummy2 = 0; /* loop through all the MOS3 models */ - for( ; model != NULL; model = model->MOS3nextModel ) { + for( ; model != NULL; model = MOS3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS3instances; here != NULL ; - here=here->MOS3nextInstance) { + for (here = MOS3instances(model); here != NULL ; + here=MOS3nextInstance(here)) { #ifdef SENSDEBUG printf("senupdate instance name %s\n",here->MOS3name); diff --git a/src/spicelib/devices/mos3/mos3temp.c b/src/spicelib/devices/mos3/mos3temp.c index 9f0b8e809..9dc912b70 100644 --- a/src/spicelib/devices/mos3/mos3temp.c +++ b/src/spicelib/devices/mos3/mos3temp.c @@ -36,7 +36,7 @@ MOS3temp(GENmodel *inModel, CKTcircuit *ckt) double gmanew,gmaold; double ni_temp, nifact; /* loop through all the mosfet models */ - for( ; model != NULL; model = model->MOS3nextModel) { + for( ; model != NULL; model = MOS3nextModel(model)) { if(!model->MOS3tnomGiven) { model->MOS3tnom = ckt->CKTnomTemp; @@ -115,8 +115,8 @@ MOS3temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all instances of the model */ - for(here = model->MOS3instances; here!= NULL; - here = here->MOS3nextInstance) { + for(here = MOS3instances(model); here!= NULL; + here = MOS3nextInstance(here)) { double czbd; /* zero voltage bulk-drain capacitance */ double czbdsw; /* zero voltage bulk-drain sidewall capacitance */ diff --git a/src/spicelib/devices/mos3/mos3trun.c b/src/spicelib/devices/mos3/mos3trun.c index 20c7bd12e..e345617a5 100644 --- a/src/spicelib/devices/mos3/mos3trun.c +++ b/src/spicelib/devices/mos3/mos3trun.c @@ -15,8 +15,8 @@ MOS3trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) MOS3model *model = (MOS3model *)inModel; MOS3instance *here; - for( ; model != NULL; model = model->MOS3nextModel) { - for(here=model->MOS3instances;here!=NULL;here = here->MOS3nextInstance){ + for( ; model != NULL; model = MOS3nextModel(model)) { + for(here=MOS3instances(model);here!=NULL;here = MOS3nextInstance(here)){ CKTterr(here->MOS3qgs,ckt,timeStep); CKTterr(here->MOS3qgd,ckt,timeStep); diff --git a/src/spicelib/devices/mos6/mos6ask.c b/src/spicelib/devices/mos6/mos6ask.c index 5740b2787..fc4aec4c1 100644 --- a/src/spicelib/devices/mos6/mos6ask.c +++ b/src/spicelib/devices/mos6/mos6ask.c @@ -209,7 +209,7 @@ MOS6ask(CKTcircuit *ckt, GENinstance *inst, int which, case MOS6_CAPGS: value->rValue = 2* *(ckt->CKTstate0 + here->MOS6capgs); /* add overlap capacitance */ - value->rValue += (here->MOS6modPtr->MOS6gateSourceOverlapCapFactor) + value->rValue += (MOS6modPtr(here)->MOS6gateSourceOverlapCapFactor) * (here->MOS6w); value->rValue *= here->MOS6m; return(OK); @@ -224,7 +224,7 @@ MOS6ask(CKTcircuit *ckt, GENinstance *inst, int which, case MOS6_CAPGD: value->rValue = 2* *(ckt->CKTstate0 + here->MOS6capgd); /* add overlap capacitance */ - value->rValue += (here->MOS6modPtr->MOS6gateSourceOverlapCapFactor) + value->rValue += (MOS6modPtr(here)->MOS6gateSourceOverlapCapFactor) * (here->MOS6w); value->rValue *= here->MOS6m; return(OK); @@ -239,9 +239,9 @@ MOS6ask(CKTcircuit *ckt, GENinstance *inst, int which, case MOS6_CAPGB: value->rValue = 2* *(ckt->CKTstate0 + here->MOS6capgb); /* add overlap capacitance */ - value->rValue += (here->MOS6modPtr->MOS6gateBulkOverlapCapFactor) + value->rValue += (MOS6modPtr(here)->MOS6gateBulkOverlapCapFactor) * (here->MOS6l - -2*(here->MOS6modPtr->MOS6latDiff)); + -2*(MOS6modPtr(here)->MOS6latDiff)); value->rValue *= here->MOS6m; return(OK); case MOS6_QGB: diff --git a/src/spicelib/devices/mos6/mos6conv.c b/src/spicelib/devices/mos6/mos6conv.c index 7fe542672..5b97b61d1 100644 --- a/src/spicelib/devices/mos6/mos6conv.c +++ b/src/spicelib/devices/mos6/mos6conv.c @@ -29,9 +29,9 @@ MOS6convTest(GENmodel *inModel, CKTcircuit *ckt) double vgdo; double tol; - for( ; model != NULL; model = model->MOS6nextModel) { - for(here = model->MOS6instances; here!= NULL; - here = here->MOS6nextInstance) { + for( ; model != NULL; model = MOS6nextModel(model)) { + for(here = MOS6instances(model); here!= NULL; + here = MOS6nextInstance(here)) { vbs = model->MOS6type * ( *(ckt->CKTrhs+here->MOS6bNode) - diff --git a/src/spicelib/devices/mos6/mos6ic.c b/src/spicelib/devices/mos6/mos6ic.c index f89f7e8f3..e2a290e8e 100644 --- a/src/spicelib/devices/mos6/mos6ic.c +++ b/src/spicelib/devices/mos6/mos6ic.c @@ -22,8 +22,8 @@ MOS6getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->MOS6nextModel) { - for(here = model->MOS6instances; here ; here = here->MOS6nextInstance) { + for( ; model ; model = MOS6nextModel(model)) { + for(here = MOS6instances(model); here ; here = MOS6nextInstance(here)) { if(!here->MOS6icVBSGiven) { here->MOS6icVBS = diff --git a/src/spicelib/devices/mos6/mos6load.c b/src/spicelib/devices/mos6/mos6load.c index 0f1eea531..a334393ea 100644 --- a/src/spicelib/devices/mos6/mos6load.c +++ b/src/spicelib/devices/mos6/mos6load.c @@ -95,11 +95,11 @@ MOS6load(GENmodel *inModel, CKTcircuit *ckt) #endif /* CAPBYPASS */ /* loop through all the MOS6 device models */ - for( ; model != NULL; model = model->MOS6nextModel ) { + for( ; model != NULL; model = MOS6nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS6instances; here != NULL ; - here=here->MOS6nextInstance) { + for (here = MOS6instances(model); here != NULL ; + here=MOS6nextInstance(here)) { vt = CONSTKoverQ * here->MOS6temp; Check=1; diff --git a/src/spicelib/devices/mos6/mos6set.c b/src/spicelib/devices/mos6/mos6set.c index 5e8a913b3..a46840630 100644 --- a/src/spicelib/devices/mos6/mos6set.c +++ b/src/spicelib/devices/mos6/mos6set.c @@ -25,7 +25,7 @@ MOS6setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, CKTnode *tmp; /* loop through all the MOS6 device models */ - for( ; model != NULL; model = model->MOS6nextModel ) { + for( ; model != NULL; model = MOS6nextModel(model)) { if(!model->MOS6typeGiven) { model->MOS6type = NMOS; @@ -110,8 +110,8 @@ MOS6setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, } /* loop through all the instances of the model */ - for (here = model->MOS6instances; here != NULL ; - here=here->MOS6nextInstance) { + for (here = MOS6instances(model); here != NULL ; + here=MOS6nextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -228,10 +228,10 @@ MOS6unsetup(GENmodel *inModel, CKTcircuit *ckt) MOS6instance *here; for (model = (MOS6model *)inModel; model != NULL; - model = model->MOS6nextModel) + model = MOS6nextModel(model)) { - for (here = model->MOS6instances; here != NULL; - here=here->MOS6nextInstance) + for (here = MOS6instances(model); here != NULL; + here=MOS6nextInstance(here)) { if (here->MOS6sNodePrime > 0 && here->MOS6sNodePrime != here->MOS6sNode) diff --git a/src/spicelib/devices/mos6/mos6temp.c b/src/spicelib/devices/mos6/mos6temp.c index fd509f226..bb263a997 100644 --- a/src/spicelib/devices/mos6/mos6temp.c +++ b/src/spicelib/devices/mos6/mos6temp.c @@ -33,7 +33,7 @@ MOS6temp(GENmodel *inModel, CKTcircuit *ckt) double fermis; double vfb; /* loop through all the resistor models */ - for( ; model != NULL; model = model->MOS6nextModel) { + for( ; model != NULL; model = MOS6nextModel(model)) { /* perform model defaulting */ @@ -116,8 +116,8 @@ MOS6temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all instances of the model */ - for(here = model->MOS6instances; here!= NULL; - here = here->MOS6nextInstance) { + for(here = MOS6instances(model); here!= NULL; + here = MOS6nextInstance(here)) { double czbd; /* zero voltage bulk-drain capacitance */ double czbdsw; /* zero voltage bulk-drain sidewall capacitance */ diff --git a/src/spicelib/devices/mos6/mos6trun.c b/src/spicelib/devices/mos6/mos6trun.c index bb8da497f..b86c33cd4 100644 --- a/src/spicelib/devices/mos6/mos6trun.c +++ b/src/spicelib/devices/mos6/mos6trun.c @@ -18,8 +18,8 @@ MOS6trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) MOS6model *model = (MOS6model *)inModel; MOS6instance *here; - for( ; model != NULL; model = model->MOS6nextModel) { - for(here=model->MOS6instances;here!=NULL;here = here->MOS6nextInstance){ + for( ; model != NULL; model = MOS6nextModel(model)) { + for(here=MOS6instances(model);here!=NULL;here = MOS6nextInstance(here)){ CKTterr(here->MOS6qgs,ckt,timeStep); CKTterr(here->MOS6qgd,ckt,timeStep); diff --git a/src/spicelib/devices/mos9/mos9acld.c b/src/spicelib/devices/mos9/mos9acld.c index 00c3b468f..ceefd8c32 100644 --- a/src/spicelib/devices/mos9/mos9acld.c +++ b/src/spicelib/devices/mos9/mos9acld.c @@ -34,9 +34,9 @@ MOS9acLoad(GENmodel *inModel, CKTcircuit *ckt) double GateDrainOverlapCap; double GateSourceOverlapCap; - for( ; model != NULL; model = model->MOS9nextModel) { - for(here = model->MOS9instances; here!= NULL; - here = here->MOS9nextInstance) { + for( ; model != NULL; model = MOS9nextModel(model)) { + for(here = MOS9instances(model); here!= NULL; + here = MOS9nextInstance(here)) { if (here->MOS9mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos9/mos9ask.c b/src/spicelib/devices/mos9/mos9ask.c index d74b75c11..56533509a 100644 --- a/src/spicelib/devices/mos9/mos9ask.c +++ b/src/spicelib/devices/mos9/mos9ask.c @@ -179,11 +179,11 @@ MOS9ask(CKTcircuit *ckt, GENinstance *inst, int which, case MOS9_CAPGS: value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgs); /* add overlap capacitance */ - value->rValue += (here->MOS9modPtr->MOS9gateSourceOverlapCapFactor) + value->rValue += (MOS9modPtr(here)->MOS9gateSourceOverlapCapFactor) * here->MOS9m * (here->MOS9w - +here->MOS9modPtr->MOS9widthAdjust - -2*(here->MOS9modPtr->MOS9widthNarrow)); + +MOS9modPtr(here)->MOS9widthAdjust + -2*(MOS9modPtr(here)->MOS9widthNarrow)); return(OK); case MOS9_QGS: value->rValue = *(ckt->CKTstate0 + here->MOS9qgs); @@ -194,11 +194,11 @@ MOS9ask(CKTcircuit *ckt, GENinstance *inst, int which, case MOS9_CAPGD: value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgd); /* add overlap capacitance */ - value->rValue += (here->MOS9modPtr->MOS9gateDrainOverlapCapFactor) + value->rValue += (MOS9modPtr(here)->MOS9gateDrainOverlapCapFactor) * here->MOS9m * (here->MOS9w - +here->MOS9modPtr->MOS9widthAdjust - -2*(here->MOS9modPtr->MOS9widthNarrow)); + +MOS9modPtr(here)->MOS9widthAdjust + -2*(MOS9modPtr(here)->MOS9widthNarrow)); return(OK); case MOS9_QGD: value->rValue = *(ckt->CKTstate0 + here->MOS9qgd); @@ -209,11 +209,11 @@ MOS9ask(CKTcircuit *ckt, GENinstance *inst, int which, case MOS9_CAPGB: value->rValue = 2* *(ckt->CKTstate0 + here->MOS9capgb); /* add overlap capacitance */ - value->rValue += (here->MOS9modPtr->MOS9gateBulkOverlapCapFactor) + value->rValue += (MOS9modPtr(here)->MOS9gateBulkOverlapCapFactor) * here->MOS9m * (here->MOS9l - +here->MOS9modPtr->MOS9lengthAdjust - -2*(here->MOS9modPtr->MOS9latDiff)); + +MOS9modPtr(here)->MOS9lengthAdjust + -2*(MOS9modPtr(here)->MOS9latDiff)); return(OK); case MOS9_QGB: value->rValue = *(ckt->CKTstate0 + here->MOS9qgb); diff --git a/src/spicelib/devices/mos9/mos9conv.c b/src/spicelib/devices/mos9/mos9conv.c index 7cdf4353e..0667db025 100644 --- a/src/spicelib/devices/mos9/mos9conv.c +++ b/src/spicelib/devices/mos9/mos9conv.c @@ -31,9 +31,9 @@ MOS9convTest(GENmodel *inModel, CKTcircuit *ckt) double vgdo; double tol; - for( ; model != NULL; model = model->MOS9nextModel) { - for(here = model->MOS9instances; here!= NULL; - here = here->MOS9nextInstance) { + for( ; model != NULL; model = MOS9nextModel(model)) { + for(here = MOS9instances(model); here!= NULL; + here = MOS9nextInstance(here)) { vbs = model->MOS9type * ( *(ckt->CKTrhs+here->MOS9bNode) - diff --git a/src/spicelib/devices/mos9/mos9dist.c b/src/spicelib/devices/mos9/mos9dist.c index 8748d095d..fe1f9649a 100644 --- a/src/spicelib/devices/mos9/mos9dist.c +++ b/src/spicelib/devices/mos9/mos9dist.c @@ -50,11 +50,11 @@ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_2F1MF2)) { /* loop through all the MOS9 models */ -for( ; model != NULL; model = model->MOS9nextModel ) { +for( ; model != NULL; model = MOS9nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { /* loading starts here */ diff --git a/src/spicelib/devices/mos9/mos9dset.c b/src/spicelib/devices/mos9/mos9dset.c index 89991df90..00f38aa80 100644 --- a/src/spicelib/devices/mos9/mos9dset.c +++ b/src/spicelib/devices/mos9/mos9dset.c @@ -61,11 +61,11 @@ MOS9dSetup(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the MOS9 device models */ - for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = MOS9nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { vt = CONSTKoverQ * here->MOS9temp; diff --git a/src/spicelib/devices/mos9/mos9ic.c b/src/spicelib/devices/mos9/mos9ic.c index 52a22b33a..63cb3f635 100644 --- a/src/spicelib/devices/mos9/mos9ic.c +++ b/src/spicelib/devices/mos9/mos9ic.c @@ -23,8 +23,8 @@ MOS9getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->MOS9nextModel) { - for(here = model->MOS9instances; here ; here = here->MOS9nextInstance) { + for( ; model ; model = MOS9nextModel(model)) { + for(here = MOS9instances(model); here ; here = MOS9nextInstance(here)) { if(!here->MOS9icVBSGiven) { here->MOS9icVBS = diff --git a/src/spicelib/devices/mos9/mos9load.c b/src/spicelib/devices/mos9/mos9load.c index 79aa257b9..51539c763 100644 --- a/src/spicelib/devices/mos9/mos9load.c +++ b/src/spicelib/devices/mos9/mos9load.c @@ -103,11 +103,11 @@ MOS9load(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the MOS9 device models */ next: - for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = MOS9nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { vt = CONSTKoverQ * here->MOS9temp; Check=1; diff --git a/src/spicelib/devices/mos9/mos9noi.c b/src/spicelib/devices/mos9/mos9noi.c index 92b750870..69f9bfd80 100644 --- a/src/spicelib/devices/mos9/mos9noi.c +++ b/src/spicelib/devices/mos9/mos9noi.c @@ -46,8 +46,8 @@ MOS9noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->MOS9nextModel) { - for (inst=model->MOS9instances; inst != NULL; inst=inst->MOS9nextInstance) { + for (model=firstModel; model != NULL; model=MOS9nextModel(model)) { + for (inst=MOS9instances(model); inst != NULL; inst=MOS9nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/mos9/mos9pzld.c b/src/spicelib/devices/mos9/mos9pzld.c index e12a1aa9d..7c140a052 100644 --- a/src/spicelib/devices/mos9/mos9pzld.c +++ b/src/spicelib/devices/mos9/mos9pzld.c @@ -35,9 +35,9 @@ MOS9pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) double EffectiveLength; double EffectiveWidth; - for( ; model != NULL; model = model->MOS9nextModel) { - for(here = model->MOS9instances; here!= NULL; - here = here->MOS9nextInstance) { + for( ; model != NULL; model = MOS9nextModel(model)) { + for(here = MOS9instances(model); here!= NULL; + here = MOS9nextInstance(here)) { if (here->MOS9mode < 0) { xnrm=0; diff --git a/src/spicelib/devices/mos9/mos9sacl.c b/src/spicelib/devices/mos9/mos9sacl.c index ddcf36e2b..3c4fa2871 100644 --- a/src/spicelib/devices/mos9/mos9sacl.c +++ b/src/spicelib/devices/mos9/mos9sacl.c @@ -129,9 +129,9 @@ MOS9sAcLoad(GENmodel *inModel, CKTcircuit *ckt) #endif /* SENSDEBUG */ info = ckt->CKTsenInfo; info->SENstatus = PERTURBATION; - for( ; model != NULL; model = model->MOS9nextModel) { - for(here = model->MOS9instances; here!= NULL; - here = here->MOS9nextInstance) { + for( ; model != NULL; model = MOS9nextModel(model)) { + for(here = MOS9instances(model); here!= NULL; + here = MOS9nextInstance(here)) { /* save the unperturbed values in the state vector */ for(i=0; i <= 16; i++) diff --git a/src/spicelib/devices/mos9/mos9set.c b/src/spicelib/devices/mos9/mos9set.c index 78d4abe47..1dddbd7e7 100644 --- a/src/spicelib/devices/mos9/mos9set.c +++ b/src/spicelib/devices/mos9/mos9set.c @@ -28,7 +28,7 @@ MOS9setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the MOS9 device models */ - for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = MOS9nextModel(model)) { /* perform model defaulting */ if(!model->MOS9typeGiven) { @@ -141,8 +141,8 @@ MOS9setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -266,10 +266,10 @@ MOS9unsetup(GENmodel *inModel, CKTcircuit *ckt) MOS9instance *here; for (model = (MOS9model *)inModel; model != NULL; - model = model->MOS9nextModel) + model = MOS9nextModel(model)) { - for (here = model->MOS9instances; here != NULL; - here=here->MOS9nextInstance) + for (here = MOS9instances(model); here != NULL; + here=MOS9nextInstance(here)) { if (here->MOS9sNodePrime > 0 && here->MOS9sNodePrime != here->MOS9sNode) diff --git a/src/spicelib/devices/mos9/mos9sld.c b/src/spicelib/devices/mos9/mos9sld.c index 93cf9aab6..ebb0bd94a 100644 --- a/src/spicelib/devices/mos9/mos9sld.c +++ b/src/spicelib/devices/mos9/mos9sld.c @@ -95,11 +95,11 @@ MOS9sLoad(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the models */ - for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = MOS9nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { #ifdef SENSDEBUG printf("senload instance name %s\n",here->MOS9name); diff --git a/src/spicelib/devices/mos9/mos9sprt.c b/src/spicelib/devices/mos9/mos9sprt.c index 2ec2069f1..7ced05e6a 100644 --- a/src/spicelib/devices/mos9/mos9sprt.c +++ b/src/spicelib/devices/mos9/mos9sprt.c @@ -25,13 +25,13 @@ MOS9sPrint(GENmodel *inModel, CKTcircuit *ckt) printf("LEVEL 9 MOSFETS (AG) -----------------\n"); /* loop through all the MOS9 models */ - for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = MOS9nextModel(model)) { printf("Model name:%s\n",model->MOS9modName); /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { printf(" Instance name:%s\n",here->MOS9name); printf(" Drain, Gate , Source nodes: %s, %s ,%s\n", diff --git a/src/spicelib/devices/mos9/mos9sset.c b/src/spicelib/devices/mos9/mos9sset.c index 25684571f..7e8324a81 100644 --- a/src/spicelib/devices/mos9/mos9sset.c +++ b/src/spicelib/devices/mos9/mos9sset.c @@ -24,11 +24,11 @@ MOS9sSetup(SENstruct *info, GENmodel *inModel) MOS9instance *here; /* loop through all the models */ - for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = MOS9nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { if(here->MOS9senParmNo){ if((here->MOS9sens_l)&&(here->MOS9sens_w)){ diff --git a/src/spicelib/devices/mos9/mos9supd.c b/src/spicelib/devices/mos9/mos9supd.c index 0d8e8a7f7..fea7baffa 100644 --- a/src/spicelib/devices/mos9/mos9supd.c +++ b/src/spicelib/devices/mos9/mos9supd.c @@ -50,11 +50,11 @@ MOS9sUpdate(GENmodel *inModel, CKTcircuit *ckt) dummy2 = 0; /* loop through all the MOS9 models */ - for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = MOS9nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->MOS9instances; here != NULL ; - here=here->MOS9nextInstance) { + for (here = MOS9instances(model); here != NULL ; + here=MOS9nextInstance(here)) { #ifdef SENSDEBUG printf("senupdate instance name %s\n",here->MOS9name); diff --git a/src/spicelib/devices/mos9/mos9temp.c b/src/spicelib/devices/mos9/mos9temp.c index 6c479128d..7f829ac2e 100644 --- a/src/spicelib/devices/mos9/mos9temp.c +++ b/src/spicelib/devices/mos9/mos9temp.c @@ -36,7 +36,7 @@ MOS9temp(GENmodel *inModel, CKTcircuit *ckt) double gmanew,gmaold; double ni_temp, nifact; /* loop through all the mosfet models */ - for( ; model != NULL; model = model->MOS9nextModel) { + for( ; model != NULL; model = MOS9nextModel(model)) { if(!model->MOS9tnomGiven) { model->MOS9tnom = ckt->CKTnomTemp; @@ -119,8 +119,8 @@ MOS9temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all instances of the model */ - for(here = model->MOS9instances; here!= NULL; - here = here->MOS9nextInstance) { + for(here = MOS9instances(model); here!= NULL; + here = MOS9nextInstance(here)) { double czbd; /* zero voltage bulk-drain capacitance */ double czbdsw; /* zero voltage bulk-drain sidewall capacitance */ diff --git a/src/spicelib/devices/mos9/mos9trun.c b/src/spicelib/devices/mos9/mos9trun.c index d5724dad7..f04f01f66 100644 --- a/src/spicelib/devices/mos9/mos9trun.c +++ b/src/spicelib/devices/mos9/mos9trun.c @@ -19,8 +19,8 @@ MOS9trunc( MOS9model *model = (MOS9model *)inModel; MOS9instance *here; - for( ; model != NULL; model = model->MOS9nextModel) { - for(here=model->MOS9instances;here!=NULL;here = here->MOS9nextInstance){ + for( ; model != NULL; model = MOS9nextModel(model)) { + for(here=MOS9instances(model);here!=NULL;here = MOS9nextInstance(here)){ CKTterr(here->MOS9qgs,ckt,timeStep); CKTterr(here->MOS9qgd,ckt,timeStep); diff --git a/src/spicelib/devices/nbjt/nbjtacld.c b/src/spicelib/devices/nbjt/nbjtacld.c index 454386194..24de3f1d1 100644 --- a/src/spicelib/devices/nbjt/nbjtacld.c +++ b/src/spicelib/devices/nbjt/nbjtacld.c @@ -30,7 +30,7 @@ NBJTacLoad(GENmodel *inModel, CKTcircuit *ckt) SPcomplex yIcVce, yIcVbe; double startTime; - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { FieldDepMobility = model->NBJTmodels->MODLfieldDepMobility; Srh = model->NBJTmodels->MODLsrh; Auger = model->NBJTmodels->MODLauger; @@ -39,8 +39,8 @@ NBJTacLoad(GENmodel *inModel, CKTcircuit *ckt) MobDeriv = model->NBJTmethods->METHmobDeriv; ONEacDebug = model->NBJToutputs->OUTPacDebug; - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/nbjt/nbjtdump.c b/src/spicelib/devices/nbjt/nbjtdump.c index 4cc762986..e53203c2b 100644 --- a/src/spicelib/devices/nbjt/nbjtdump.c +++ b/src/spicelib/devices/nbjt/nbjtdump.c @@ -55,10 +55,10 @@ NBJTdump(GENmodel *inModel, CKTcircuit *ckt) return; } - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { output = model->NBJToutputs; - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { if (inst->NBJTprintGiven) { if ((ckt->CKTmode & MODETRAN) && @@ -155,10 +155,10 @@ NBJTacct(GENmodel *inModel, CKTcircuit *ckt, FILE *file) NG_IGNORE(ckt); - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { output = model->NBJToutputs; - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { if (output->OUTPstats) { ONEmemStats(file, inst->NBJTpDevice); diff --git a/src/spicelib/devices/nbjt/nbjtload.c b/src/spicelib/devices/nbjt/nbjtload.c index 627b55b03..7a19361e9 100644 --- a/src/spicelib/devices/nbjt/nbjtload.c +++ b/src/spicelib/devices/nbjt/nbjtload.c @@ -55,7 +55,7 @@ NBJTload(GENmodel *inModel, CKTcircuit *ckt) char *initStateName; /* loop through all the models */ - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { FieldDepMobility = model->NBJTmodels->MODLfieldDepMobility; Srh = model->NBJTmodels->MODLsrh; Auger = model->NBJTmodels->MODLauger; @@ -91,8 +91,8 @@ NBJTload(GENmodel *inModel, CKTcircuit *ckt) model->NBJTpInfo->intCoeff, deltaNorm); } /* loop through all the instances of the model */ - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { pDevice = inst->NBJTpDevice; @@ -491,7 +491,7 @@ NBJTinitSmSig(NBJTinstance *inst) { SPcomplex yIeVce, yIeVbe; SPcomplex yIcVce, yIcVbe; - double omega = inst->NBJTmodPtr->NBJTmethods->METHomega; + double omega = NBJTmodPtr(inst)->NBJTmethods->METHomega; AcAnalysisMethod = SOR_ONLY; (void) NBJTadmittance(inst->NBJTpDevice, omega, diff --git a/src/spicelib/devices/nbjt/nbjtpzld.c b/src/spicelib/devices/nbjt/nbjtpzld.c index 3d73d1e17..b45007dab 100644 --- a/src/spicelib/devices/nbjt/nbjtpzld.c +++ b/src/spicelib/devices/nbjt/nbjtpzld.c @@ -31,7 +31,7 @@ NBJTpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { FieldDepMobility = model->NBJTmodels->MODLfieldDepMobility; Srh = model->NBJTmodels->MODLsrh; Auger = model->NBJTmodels->MODLauger; @@ -40,8 +40,8 @@ NBJTpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) MobDeriv = model->NBJTmethods->METHmobDeriv; ONEacDebug = model->NBJToutputs->OUTPacDebug; - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/nbjt/nbjtset.c b/src/spicelib/devices/nbjt/nbjtset.c index 2d723c087..187dab974 100644 --- a/src/spicelib/devices/nbjt/nbjtset.c +++ b/src/spicelib/devices/nbjt/nbjtset.c @@ -46,7 +46,7 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the diode models */ - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { if (!model->NBJTpInfo) { TSCALLOC(model->NBJTpInfo, 1, ONEtranInfo); } @@ -146,8 +146,8 @@ NBJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) model->NBJTdopTables = dopTableList; /* loop through all the instances of the model */ - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/nbjt/nbjttemp.c b/src/spicelib/devices/nbjt/nbjttemp.c index 5620fec2c..b22784e5a 100644 --- a/src/spicelib/devices/nbjt/nbjttemp.c +++ b/src/spicelib/devices/nbjt/nbjttemp.c @@ -35,7 +35,7 @@ NBJTtemp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the bjt models */ - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { methods = model->NBJTmethods; models = model->NBJTmodels; options = model->NBJToptions; @@ -53,8 +53,8 @@ NBJTtemp(GENmodel *inModel, CKTcircuit *ckt) TempDepMobility = models->MODLtempDepMobility; ConcDepMobility = models->MODLconcDepMobility; - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/nbjt/nbjttrun.c b/src/spicelib/devices/nbjt/nbjttrun.c index 9c7c87300..d7c620a48 100644 --- a/src/spicelib/devices/nbjt/nbjttrun.c +++ b/src/spicelib/devices/nbjt/nbjttrun.c @@ -30,12 +30,12 @@ NBJTtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) for (i = 0; i <= ckt->CKTmaxOrder; i++) { deltaNorm[i] = ckt->CKTdeltaOld[i] / TNorm; } - for (; model != NULL; model = model->NBJTnextModel) { + for (; model != NULL; model = NBJTnextModel(model)) { model->NBJTpInfo->order = ckt->CKTorder; model->NBJTpInfo->delta = deltaNorm; model->NBJTpInfo->lteCoeff = computeLTECoeff(model->NBJTpInfo); - for (inst = model->NBJTinstances; inst != NULL; - inst = inst->NBJTnextInstance) { + for (inst = NBJTinstances(model); inst != NULL; + inst = NBJTnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); deltaNew = ONEtrunc(inst->NBJTpDevice, model->NBJTpInfo, diff --git a/src/spicelib/devices/nbjt2/nbt2acld.c b/src/spicelib/devices/nbjt2/nbt2acld.c index fae45ddd0..811f57a7e 100644 --- a/src/spicelib/devices/nbjt2/nbt2acld.c +++ b/src/spicelib/devices/nbjt2/nbt2acld.c @@ -28,7 +28,7 @@ NBJT2acLoad(GENmodel *inModel, CKTcircuit *ckt) SPcomplex yIcVce, yIcVbe; double startTime; - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { FieldDepMobility = model->NBJT2models->MODLfieldDepMobility; TransDepMobility = model->NBJT2models->MODLtransDepMobility; SurfaceMobility = model->NBJT2models->MODLsurfaceMobility; @@ -40,8 +40,8 @@ NBJT2acLoad(GENmodel *inModel, CKTcircuit *ckt) MobDeriv = model->NBJT2methods->METHmobDeriv; TWOacDebug = model->NBJT2outputs->OUTPacDebug; - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/nbjt2/nbt2dump.c b/src/spicelib/devices/nbjt2/nbt2dump.c index 0954f401f..2a13ce0f5 100644 --- a/src/spicelib/devices/nbjt2/nbt2dump.c +++ b/src/spicelib/devices/nbjt2/nbt2dump.c @@ -56,10 +56,10 @@ NBJT2dump(GENmodel *inModel, CKTcircuit *ckt) return; } - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { output = model->NBJT2outputs; - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { if (inst->NBJT2printGiven) { if ((ckt->CKTmode & MODETRAN) && @@ -156,10 +156,10 @@ NBJT2acct(GENmodel *inModel, CKTcircuit *ckt, FILE *file) NG_IGNORE(ckt); - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { output = model->NBJT2outputs; - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { if (output->OUTPstats) { TWOmemStats(file, inst->NBJT2pDevice); diff --git a/src/spicelib/devices/nbjt2/nbt2load.c b/src/spicelib/devices/nbjt2/nbt2load.c index 93dcd5bed..e0c1ddbdb 100644 --- a/src/spicelib/devices/nbjt2/nbt2load.c +++ b/src/spicelib/devices/nbjt2/nbt2load.c @@ -55,7 +55,7 @@ NBJT2load(GENmodel *inModel, CKTcircuit *ckt) char *initStateName; /* loop through all the models */ - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { FieldDepMobility = model->NBJT2models->MODLfieldDepMobility; TransDepMobility = model->NBJT2models->MODLtransDepMobility; SurfaceMobility = model->NBJT2models->MODLsurfaceMobility; @@ -94,8 +94,8 @@ NBJT2load(GENmodel *inModel, CKTcircuit *ckt) model->NBJT2pInfo->intCoeff, deltaNorm); } /* loop through all the instances of the model */ - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { pDevice = inst->NBJT2pDevice; @@ -480,7 +480,7 @@ NBJT2initSmSig(NBJT2instance *inst) { SPcomplex yIeVce, yIeVbe; SPcomplex yIcVce, yIcVbe; - double omega = inst->NBJT2modPtr->NBJT2methods->METHomega; + double omega = NBJT2modPtr(inst)->NBJT2methods->METHomega; AcAnalysisMethod = SOR_ONLY; (void) NBJT2admittance(inst->NBJT2pDevice, omega, diff --git a/src/spicelib/devices/nbjt2/nbt2pzld.c b/src/spicelib/devices/nbjt2/nbt2pzld.c index 2fddc07f5..f508ecbba 100644 --- a/src/spicelib/devices/nbjt2/nbt2pzld.c +++ b/src/spicelib/devices/nbjt2/nbt2pzld.c @@ -25,7 +25,7 @@ NBJT2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { FieldDepMobility = model->NBJT2models->MODLfieldDepMobility; TransDepMobility = model->NBJT2models->MODLtransDepMobility; SurfaceMobility = model->NBJT2models->MODLsurfaceMobility; @@ -37,8 +37,8 @@ NBJT2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) MobDeriv = model->NBJT2methods->METHmobDeriv; TWOacDebug = model->NBJT2outputs->OUTPacDebug; - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/nbjt2/nbt2set.c b/src/spicelib/devices/nbjt2/nbt2set.c index c0b584da5..a39fe7684 100644 --- a/src/spicelib/devices/nbjt2/nbt2set.c +++ b/src/spicelib/devices/nbjt2/nbt2set.c @@ -50,7 +50,7 @@ NBJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the models */ - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { if (!model->NBJT2pInfo) { TSCALLOC(model->NBJT2pInfo, 1, TWOtranInfo); } @@ -162,8 +162,8 @@ NBJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) model->NBJT2dopTables = dopTableList; /* loop through all the instances of the model */ - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/nbjt2/nbt2temp.c b/src/spicelib/devices/nbjt2/nbt2temp.c index e0b52b08a..ad58f276d 100644 --- a/src/spicelib/devices/nbjt2/nbt2temp.c +++ b/src/spicelib/devices/nbjt2/nbt2temp.c @@ -33,7 +33,7 @@ NBJT2temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the models */ - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { methods = model->NBJT2methods; models = model->NBJT2models; options = model->NBJT2options; @@ -55,8 +55,8 @@ NBJT2temp(GENmodel *inModel, CKTcircuit *ckt) MatchingMobility = models->MODLmatchingMobility; OneCarrier = methods->METHoneCarrier; - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/nbjt2/nbt2trun.c b/src/spicelib/devices/nbjt2/nbt2trun.c index a9e02ff2a..31254aa7b 100644 --- a/src/spicelib/devices/nbjt2/nbt2trun.c +++ b/src/spicelib/devices/nbjt2/nbt2trun.c @@ -32,13 +32,13 @@ NBJT2trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) deltaNorm[i] = ckt->CKTdeltaOld[i] / TNorm; } - for (; model != NULL; model = model->NBJT2nextModel) { + for (; model != NULL; model = NBJT2nextModel(model)) { OneCarrier = model->NBJT2methods->METHoneCarrier; model->NBJT2pInfo->order = ckt->CKTorder; model->NBJT2pInfo->delta = deltaNorm; model->NBJT2pInfo->lteCoeff = computeLTECoeff(model->NBJT2pInfo); - for (inst = model->NBJT2instances; inst != NULL; - inst = inst->NBJT2nextInstance) { + for (inst = NBJT2instances(model); inst != NULL; + inst = NBJT2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); deltaNew = TWOtrunc(inst->NBJT2pDevice, model->NBJT2pInfo, diff --git a/src/spicelib/devices/ndev/ndevaccept.c b/src/spicelib/devices/ndev/ndevaccept.c index 88c1da922..34e5313a0 100644 --- a/src/spicelib/devices/ndev/ndevaccept.c +++ b/src/spicelib/devices/ndev/ndevaccept.c @@ -20,10 +20,10 @@ int NDEVaccept(CKTcircuit *ckt, GENmodel *inModel) NDEVmodel *model = (NDEVmodel *)inModel; NDEVinstance *here; /* loop through all the ndev models */ - for( ; model != NULL; model = model->NDEVnextModel ) + for( ; model != NULL; model = NDEVnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->NDEVinstances; here != NULL ; here=here->NDEVnextInstance) + for (here = NDEVinstances(model); here != NULL ; here=NDEVnextInstance(here)) { /* set ckt accept_flag */ here->CKTInfo.DEV_CALL = NDEV_ACCEPT; @@ -45,8 +45,8 @@ int NDEVconvTest(GENmodel *inModel, CKTcircuit *ckt) NDEVmodel *model = (NDEVmodel *)inModel; NDEVinstance *here; - for( ; model != NULL; model = model->NDEVnextModel) { - for(here=model->NDEVinstances;here!=NULL;here = here->NDEVnextInstance){ + for( ; model != NULL; model = NDEVnextModel(model)) { + for(here=NDEVinstances(model);here!=NULL;here = NDEVnextInstance(here)){ /* * get convergence information from ndev diff --git a/src/spicelib/devices/ndev/ndevload.c b/src/spicelib/devices/ndev/ndevload.c index eb76fa327..c13631ab5 100644 --- a/src/spicelib/devices/ndev/ndevload.c +++ b/src/spicelib/devices/ndev/ndevload.c @@ -23,11 +23,11 @@ NDEVload(GENmodel * inModel, CKTcircuit * ckt) int i,j; /* loop through all the ndev models */ - for( ; model != NULL; model = model->NDEVnextModel ) + for( ; model != NULL; model = NDEVnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->NDEVinstances; here != NULL ; here=here->NDEVnextInstance) + for (here = NDEVinstances(model); here != NULL ; here=NDEVnextInstance(here)) { /* sent ckt information to device simulator */ here->CKTInfo.DEV_CALL = NDEV_LOAD; @@ -50,11 +50,11 @@ NDEVload(GENmodel * inModel, CKTcircuit * ckt) /* loop through all the ndev models */ - for(model = (NDEVmodel *)inModel; model != NULL; model = model->NDEVnextModel ) + for(model = (NDEVmodel *)inModel; model != NULL; model = NDEVnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->NDEVinstances; here != NULL ; here=here->NDEVnextInstance) + for (here = NDEVinstances(model); here != NULL ; here=NDEVnextInstance(here)) { /* reveive terminal current and conductional matrix from device simulator */ for(i=0;iterm;i++) @@ -84,8 +84,8 @@ int NDEVgetic(GENmodel *inModel, CKTcircuit *ckt) printf("set ic\n"); - for( ; model ; model = model->NDEVnextModel) { - for(here = model->NDEVinstances; here ; here = here->NDEVnextInstance) { + for( ; model ; model = NDEVnextModel(model)) { + for(here = NDEVinstances(model); here ; here = NDEVnextInstance(here)) { /* if(!here->DIOinitCondGiven) { here->DIOinitCond = diff --git a/src/spicelib/devices/ndev/ndevset.c b/src/spicelib/devices/ndev/ndevset.c index 2b55ae89e..37bc09297 100644 --- a/src/spicelib/devices/ndev/ndevset.c +++ b/src/spicelib/devices/ndev/ndevset.c @@ -36,14 +36,14 @@ int NDEVsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states NG_IGNORE(states); /* loop through all the ndev models */ - for( ; model != NULL; model = model->NDEVnextModel ) { + for( ; model != NULL; model = NDEVnextModel(model)) { /* connect to remote device simulator */ if(NDEVmodelConnect(model)) return E_PRIVATE; /* loop through all the instances of the model */ - for (here = model->NDEVinstances; here != NULL ; - here=here->NDEVnextInstance) { + for (here = NDEVinstances(model); here != NULL ; + here=NDEVnextInstance(here)) { here->Ndevinfo.term = here->term; strncpy(here->Ndevinfo.NDEVname,here->NDEVname,32); diff --git a/src/spicelib/devices/numd/numdacld.c b/src/spicelib/devices/numd/numdacld.c index 5bbc0d470..6026f9f0c 100644 --- a/src/spicelib/devices/numd/numdacld.c +++ b/src/spicelib/devices/numd/numdacld.c @@ -30,7 +30,7 @@ NUMDacLoad(GENmodel *inModel, CKTcircuit *ckt) double startTime; /* loop through all the diode models */ - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { FieldDepMobility = model->NUMDmodels->MODLfieldDepMobility; Srh = model->NUMDmodels->MODLsrh; Auger = model->NUMDmodels->MODLauger; @@ -39,8 +39,8 @@ NUMDacLoad(GENmodel *inModel, CKTcircuit *ckt) MobDeriv = model->NUMDmethods->METHmobDeriv; ONEacDebug = model->NUMDoutputs->OUTPacDebug; - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/numd/numddump.c b/src/spicelib/devices/numd/numddump.c index 0b55e6992..88b708abe 100644 --- a/src/spicelib/devices/numd/numddump.c +++ b/src/spicelib/devices/numd/numddump.c @@ -55,10 +55,10 @@ NUMDdump(GENmodel *inModel, CKTcircuit *ckt) return; } - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { output = model->NUMDoutputs; - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { if (inst->NUMDprintGiven) { if ((ckt->CKTmode & MODETRAN) && @@ -142,10 +142,10 @@ NUMDacct(GENmodel *inModel, CKTcircuit *ckt, FILE *file) NG_IGNORE(ckt); - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { output = model->NUMDoutputs; - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { if (output->OUTPstats) { ONEmemStats(file, inst->NUMDpDevice); diff --git a/src/spicelib/devices/numd/numdload.c b/src/spicelib/devices/numd/numdload.c index aabb6de61..25e01555e 100644 --- a/src/spicelib/devices/numd/numdload.c +++ b/src/spicelib/devices/numd/numdload.c @@ -52,7 +52,7 @@ NUMDload(GENmodel *inModel, CKTcircuit *ckt) char *initStateName; /* loop through all the diode models */ - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { /* Do model things */ FieldDepMobility = model->NUMDmodels->MODLfieldDepMobility; Srh = model->NUMDmodels->MODLsrh; @@ -89,8 +89,8 @@ NUMDload(GENmodel *inModel, CKTcircuit *ckt) model->NUMDpInfo->intCoeff, deltaNorm); } /* Now do instance things */ - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { pDevice = inst->NUMDpDevice; @@ -377,7 +377,7 @@ int NUMDinitSmSig(NUMDinstance *inst) { SPcomplex yd; - double omega = inst->NUMDmodPtr->NUMDmethods->METHomega; + double omega = NUMDmodPtr(inst)->NUMDmethods->METHomega; AcAnalysisMethod = SOR_ONLY; (void) NUMDadmittance(inst->NUMDpDevice, omega, &yd); diff --git a/src/spicelib/devices/numd/numdpzld.c b/src/spicelib/devices/numd/numdpzld.c index 695c9b20c..408d3b0ff 100644 --- a/src/spicelib/devices/numd/numdpzld.c +++ b/src/spicelib/devices/numd/numdpzld.c @@ -26,7 +26,7 @@ NUMDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); /* loop through all the diode models */ - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { FieldDepMobility = model->NUMDmodels->MODLfieldDepMobility; Srh = model->NUMDmodels->MODLsrh; Auger = model->NUMDmodels->MODLauger; @@ -35,8 +35,8 @@ NUMDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) MobDeriv = model->NUMDmethods->METHmobDeriv; ONEacDebug = model->NUMDoutputs->OUTPacDebug; - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/numd/numdset.c b/src/spicelib/devices/numd/numdset.c index 310db3045..63748b2e0 100644 --- a/src/spicelib/devices/numd/numdset.c +++ b/src/spicelib/devices/numd/numdset.c @@ -47,7 +47,7 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the models */ - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { if (!model->NUMDpInfo) { TSCALLOC(model->NUMDpInfo, 1, ONEtranInfo); } @@ -141,8 +141,8 @@ NUMDsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) model->NUMDdopTables = dopTableList; /* loop through all the instances of the model */ - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/numd/numdtemp.c b/src/spicelib/devices/numd/numdtemp.c index d31d20acd..365bc008c 100644 --- a/src/spicelib/devices/numd/numdtemp.c +++ b/src/spicelib/devices/numd/numdtemp.c @@ -32,7 +32,7 @@ NUMDtemp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the diode models */ - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { methods = model->NUMDmethods; models = model->NUMDmodels; options = model->NUMDoptions; @@ -50,8 +50,8 @@ NUMDtemp(GENmodel *inModel, CKTcircuit *ckt) TempDepMobility = models->MODLtempDepMobility; ConcDepMobility = models->MODLconcDepMobility; - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/numd/numdtrun.c b/src/spicelib/devices/numd/numdtrun.c index 9e8e20085..901995829 100644 --- a/src/spicelib/devices/numd/numdtrun.c +++ b/src/spicelib/devices/numd/numdtrun.c @@ -26,12 +26,12 @@ NUMDtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) for (i = 0; i <= ckt->CKTmaxOrder; i++) { deltaNorm[i] = ckt->CKTdeltaOld[i] / TNorm; } - for (; model != NULL; model = model->NUMDnextModel) { + for (; model != NULL; model = NUMDnextModel(model)) { model->NUMDpInfo->order = ckt->CKTorder; model->NUMDpInfo->delta = deltaNorm; model->NUMDpInfo->lteCoeff = computeLTECoeff(model->NUMDpInfo); - for (inst = model->NUMDinstances; inst != NULL; - inst = inst->NUMDnextInstance) { + for (inst = NUMDinstances(model); inst != NULL; + inst = NUMDnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); deltaNew = ONEtrunc(inst->NUMDpDevice, model->NUMDpInfo, ckt->CKTdelta); diff --git a/src/spicelib/devices/numd2/nud2acld.c b/src/spicelib/devices/numd2/nud2acld.c index 4c61c03cf..d0f05583d 100644 --- a/src/spicelib/devices/numd2/nud2acld.c +++ b/src/spicelib/devices/numd2/nud2acld.c @@ -29,7 +29,7 @@ NUMD2acLoad(GENmodel *inModel, CKTcircuit *ckt) double startTime; /* loop through all the diode models */ - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { FieldDepMobility = model->NUMD2models->MODLfieldDepMobility; TransDepMobility = model->NUMD2models->MODLtransDepMobility; SurfaceMobility = model->NUMD2models->MODLsurfaceMobility; @@ -41,8 +41,8 @@ NUMD2acLoad(GENmodel *inModel, CKTcircuit *ckt) MobDeriv = model->NUMD2methods->METHmobDeriv; TWOacDebug = model->NUMD2outputs->OUTPacDebug; - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/numd2/nud2dump.c b/src/spicelib/devices/numd2/nud2dump.c index b2ddf1925..6d9bd20fb 100644 --- a/src/spicelib/devices/numd2/nud2dump.c +++ b/src/spicelib/devices/numd2/nud2dump.c @@ -56,10 +56,10 @@ NUMD2dump(GENmodel *inModel, CKTcircuit *ckt) return; } - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { output = model->NUMD2outputs; - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { if (inst->NUMD2printGiven) { if ((ckt->CKTmode & MODETRAN) && @@ -143,10 +143,10 @@ NUMD2acct(GENmodel *inModel, CKTcircuit *ckt, FILE *file) NG_IGNORE(ckt); - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { output = model->NUMD2outputs; - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { if (output->OUTPstats) { TWOmemStats(file, inst->NUMD2pDevice); diff --git a/src/spicelib/devices/numd2/nud2load.c b/src/spicelib/devices/numd2/nud2load.c index 83bdd59b9..614cf2503 100644 --- a/src/spicelib/devices/numd2/nud2load.c +++ b/src/spicelib/devices/numd2/nud2load.c @@ -50,7 +50,7 @@ NUMD2load(GENmodel *inModel, CKTcircuit *ckt) char *initStateName; /* loop through all the diode models */ - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { FieldDepMobility = model->NUMD2models->MODLfieldDepMobility; TransDepMobility = model->NUMD2models->MODLtransDepMobility; SurfaceMobility = model->NUMD2models->MODLsurfaceMobility; @@ -90,8 +90,8 @@ NUMD2load(GENmodel *inModel, CKTcircuit *ckt) model->NUMD2pInfo->intCoeff, deltaNorm); } /* loop through all the instances of the model */ - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { pDevice = inst->NUMD2pDevice; @@ -386,7 +386,7 @@ int NUMD2initSmSig(NUMD2instance *inst) { SPcomplex yd; - double omega = inst->NUMD2modPtr->NUMD2methods->METHomega; + double omega = NUMD2modPtr(inst)->NUMD2methods->METHomega; AcAnalysisMethod = SOR_ONLY; (void) NUMD2admittance(inst->NUMD2pDevice, omega, &yd); diff --git a/src/spicelib/devices/numd2/nud2pzld.c b/src/spicelib/devices/numd2/nud2pzld.c index 3f7febdc1..8cf962a66 100644 --- a/src/spicelib/devices/numd2/nud2pzld.c +++ b/src/spicelib/devices/numd2/nud2pzld.c @@ -25,7 +25,7 @@ NUMD2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); /* loop through all the diode models */ - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { FieldDepMobility = model->NUMD2models->MODLfieldDepMobility; TransDepMobility = model->NUMD2models->MODLtransDepMobility; SurfaceMobility = model->NUMD2models->MODLsurfaceMobility; @@ -37,8 +37,8 @@ NUMD2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) MobDeriv = model->NUMD2methods->METHmobDeriv; TWOacDebug = model->NUMD2outputs->OUTPacDebug; - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/numd2/nud2set.c b/src/spicelib/devices/numd2/nud2set.c index 126696d41..571dcdadc 100644 --- a/src/spicelib/devices/numd2/nud2set.c +++ b/src/spicelib/devices/numd2/nud2set.c @@ -49,7 +49,7 @@ NUMD2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the models */ - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { if (!model->NUMD2pInfo) { TSCALLOC(model->NUMD2pInfo, 1, TWOtranInfo); } @@ -161,8 +161,8 @@ NUMD2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) model->NUMD2dopTables = dopTableList; /* loop through all the instances of the model */ - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/numd2/nud2temp.c b/src/spicelib/devices/numd2/nud2temp.c index bf68328fa..2a59707b8 100644 --- a/src/spicelib/devices/numd2/nud2temp.c +++ b/src/spicelib/devices/numd2/nud2temp.c @@ -32,7 +32,7 @@ NUMD2temp(GENmodel *inModel, CKTcircuit *ckt) double startTime; /* loop through all the models */ - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { methods = model->NUMD2methods; models = model->NUMD2models; options = model->NUMD2options; @@ -53,8 +53,8 @@ NUMD2temp(GENmodel *inModel, CKTcircuit *ckt) MatchingMobility = models->MODLmatchingMobility; OneCarrier = methods->METHoneCarrier; - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/numd2/nud2trun.c b/src/spicelib/devices/numd2/nud2trun.c index 4443861fd..7dd50bc85 100644 --- a/src/spicelib/devices/numd2/nud2trun.c +++ b/src/spicelib/devices/numd2/nud2trun.c @@ -26,13 +26,13 @@ NUMD2trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) deltaNorm[i] = ckt->CKTdeltaOld[i] / TNorm; } - for (; model != NULL; model = model->NUMD2nextModel) { + for (; model != NULL; model = NUMD2nextModel(model)) { OneCarrier = model->NUMD2methods->METHoneCarrier; model->NUMD2pInfo->order = ckt->CKTorder; model->NUMD2pInfo->delta = deltaNorm; model->NUMD2pInfo->lteCoeff = computeLTECoeff(model->NUMD2pInfo); - for (inst = model->NUMD2instances; inst != NULL; - inst = inst->NUMD2nextInstance) { + for (inst = NUMD2instances(model); inst != NULL; + inst = NUMD2nextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); deltaNew = TWOtrunc(inst->NUMD2pDevice, model->NUMD2pInfo, diff --git a/src/spicelib/devices/numos/nummacld.c b/src/spicelib/devices/numos/nummacld.c index 174d89f93..bdf115a20 100644 --- a/src/spicelib/devices/numos/nummacld.c +++ b/src/spicelib/devices/numos/nummacld.c @@ -27,7 +27,7 @@ NUMOSacLoad(GENmodel *inModel, CKTcircuit *ckt) struct mosAdmittances yAc; double startTime; - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { FieldDepMobility = model->NUMOSmodels->MODLfieldDepMobility; TransDepMobility = model->NUMOSmodels->MODLtransDepMobility; SurfaceMobility = model->NUMOSmodels->MODLsurfaceMobility; @@ -39,8 +39,8 @@ NUMOSacLoad(GENmodel *inModel, CKTcircuit *ckt) MobDeriv = model->NUMOSmethods->METHmobDeriv; TWOacDebug = model->NUMOSoutputs->OUTPacDebug; - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/numos/nummdump.c b/src/spicelib/devices/numos/nummdump.c index 0d96526dd..3fa18e3cc 100644 --- a/src/spicelib/devices/numos/nummdump.c +++ b/src/spicelib/devices/numos/nummdump.c @@ -56,10 +56,10 @@ NUMOSdump(GENmodel *inModel, CKTcircuit *ckt) return; } - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { output = model->NUMOSoutputs; - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { if (inst->NUMOSprintGiven) { if ((ckt->CKTmode & MODETRAN) && @@ -157,10 +157,10 @@ NUMOSacct(GENmodel *inModel, CKTcircuit *ckt, FILE *file) NG_IGNORE(ckt); - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { output = model->NUMOSoutputs; - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { if (output->OUTPstats) { TWOmemStats(file, inst->NUMOSpDevice); diff --git a/src/spicelib/devices/numos/nummload.c b/src/spicelib/devices/numos/nummload.c index 1502a226e..06b6d15e7 100644 --- a/src/spicelib/devices/numos/nummload.c +++ b/src/spicelib/devices/numos/nummload.c @@ -52,7 +52,7 @@ NUMOSload(GENmodel *inModel, CKTcircuit *ckt) char *initStateName; /* loop through all the models */ - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { FieldDepMobility = model->NUMOSmodels->MODLfieldDepMobility; TransDepMobility = model->NUMOSmodels->MODLtransDepMobility; SurfaceMobility = model->NUMOSmodels->MODLsurfaceMobility; @@ -91,8 +91,8 @@ NUMOSload(GENmodel *inModel, CKTcircuit *ckt) model->NUMOSpInfo->intCoeff, deltaNorm); } /* loop through all the instances of the model */ - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { pDevice = inst->NUMOSpDevice; @@ -594,7 +594,7 @@ int NUMOSinitSmSig(NUMOSinstance *inst) { struct mosAdmittances yAc; - double omega = inst->NUMOSmodPtr->NUMOSmethods->METHomega; + double omega = NUMOSmodPtr(inst)->NUMOSmethods->METHomega; AcAnalysisMethod = SOR_ONLY; (void) NUMOSadmittance(inst->NUMOSpDevice, omega, &yAc); diff --git a/src/spicelib/devices/numos/nummpzld.c b/src/spicelib/devices/numos/nummpzld.c index f5cd3c433..2a4fd183a 100644 --- a/src/spicelib/devices/numos/nummpzld.c +++ b/src/spicelib/devices/numos/nummpzld.c @@ -24,7 +24,7 @@ NUMOSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { FieldDepMobility = model->NUMOSmodels->MODLfieldDepMobility; TransDepMobility = model->NUMOSmodels->MODLtransDepMobility; SurfaceMobility = model->NUMOSmodels->MODLsurfaceMobility; @@ -36,8 +36,8 @@ NUMOSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) MobDeriv = model->NUMOSmethods->METHmobDeriv; TWOacDebug = model->NUMOSoutputs->OUTPacDebug; - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); /* Get Temp.-Dep. Global Parameters */ diff --git a/src/spicelib/devices/numos/nummset.c b/src/spicelib/devices/numos/nummset.c index c4c1d26c1..37f0efc31 100644 --- a/src/spicelib/devices/numos/nummset.c +++ b/src/spicelib/devices/numos/nummset.c @@ -48,7 +48,7 @@ NUMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) double startTime; /* loop through all the models */ - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { if (!model->NUMOSpInfo) { TSCALLOC(model->NUMOSpInfo, 1, TWOtranInfo); } @@ -160,8 +160,8 @@ NUMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) model->NUMOSdopTables = dopTableList; /* loop through all the instances of the model */ - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/numos/nummtemp.c b/src/spicelib/devices/numos/nummtemp.c index 7765d5fa2..14a1a2ead 100644 --- a/src/spicelib/devices/numos/nummtemp.c +++ b/src/spicelib/devices/numos/nummtemp.c @@ -33,7 +33,7 @@ NUMOStemp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the models */ - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { methods = model->NUMOSmethods; models = model->NUMOSmodels; options = model->NUMOSoptions; @@ -54,8 +54,8 @@ NUMOStemp(GENmodel *inModel, CKTcircuit *ckt) MatchingMobility = models->MODLmatchingMobility; OneCarrier = methods->METHoneCarrier; - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); diff --git a/src/spicelib/devices/numos/nummtrun.c b/src/spicelib/devices/numos/nummtrun.c index b44bd04f5..3cb3389f8 100644 --- a/src/spicelib/devices/numos/nummtrun.c +++ b/src/spicelib/devices/numos/nummtrun.c @@ -32,13 +32,13 @@ NUMOStrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) deltaNorm[i] = ckt->CKTdeltaOld[i] / TNorm; } - for (; model != NULL; model = model->NUMOSnextModel) { + for (; model != NULL; model = NUMOSnextModel(model)) { OneCarrier = model->NUMOSmethods->METHoneCarrier; model->NUMOSpInfo->order = ckt->CKTorder; model->NUMOSpInfo->delta = deltaNorm; model->NUMOSpInfo->lteCoeff = computeLTECoeff(model->NUMOSpInfo); - for (inst = model->NUMOSinstances; inst != NULL; - inst = inst->NUMOSnextInstance) { + for (inst = NUMOSinstances(model); inst != NULL; + inst = NUMOSnextInstance(inst)) { startTime = SPfrontEnd->IFseconds(); deltaNew = TWOtrunc(inst->NUMOSpDevice, model->NUMOSpInfo, diff --git a/src/spicelib/devices/res/resload.c b/src/spicelib/devices/res/resload.c index 20463235f..db4ac539f 100644 --- a/src/spicelib/devices/res/resload.c +++ b/src/spicelib/devices/res/resload.c @@ -18,12 +18,12 @@ RESload(GENmodel *inModel, CKTcircuit *ckt) RESmodel *model = (RESmodel *)inModel; /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { RESinstance *here; /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here = here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here = RESnextInstance(here)) { here->REScurrent = (*(ckt->CKTrhsOld+here->RESposNode) - *(ckt->CKTrhsOld+here->RESnegNode)) * here->RESconduct; @@ -49,12 +49,12 @@ RESacload(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { RESinstance *here; /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here = here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here = RESnextInstance(here)) { if (here->RESacresGiven) g = here->RESacConduct; diff --git a/src/spicelib/devices/res/resnoise.c b/src/spicelib/devices/res/resnoise.c index defdb1ceb..a27faf460 100644 --- a/src/spicelib/devices/res/resnoise.c +++ b/src/spicelib/devices/res/resnoise.c @@ -52,9 +52,9 @@ RESnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, }; - for (model = firstModel; model != NULL; model = model->RESnextModel) { - for (inst = model->RESinstances; inst != NULL; - inst = inst->RESnextInstance) { + for (model = firstModel; model != NULL; model = RESnextModel(model)) { + for (inst = RESinstances(model); inst != NULL; + inst = RESnextInstance(inst)) { if(!inst->RESnoisy) continue; /* Quiet resistors are skipped */ diff --git a/src/spicelib/devices/res/respzld.c b/src/spicelib/devices/res/respzld.c index d3a2c1518..2d8b803f7 100644 --- a/src/spicelib/devices/res/respzld.c +++ b/src/spicelib/devices/res/respzld.c @@ -27,11 +27,11 @@ RESpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here=here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here=RESnextInstance(here)) { if (here->RESacresGiven) g = here->RESacConduct; diff --git a/src/spicelib/devices/res/ressacl.c b/src/spicelib/devices/res/ressacl.c index 9c33df955..25d950607 100644 --- a/src/spicelib/devices/res/ressacl.c +++ b/src/spicelib/devices/res/ressacl.c @@ -25,11 +25,11 @@ RESsAcLoad(GENmodel *inModel, CKTcircuit *ckt) double ivalue; /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here=here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here=RESnextInstance(here)) { if(here->RESsenParmNo){ value = *(ckt->CKTrhsOld+here->RESposNode) - diff --git a/src/spicelib/devices/res/ressetup.c b/src/spicelib/devices/res/ressetup.c index 412467c9d..6064a412c 100644 --- a/src/spicelib/devices/res/ressetup.c +++ b/src/spicelib/devices/res/ressetup.c @@ -23,7 +23,7 @@ RESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state) NG_IGNORE(ckt); /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { /* Default Value Processing for Resistor Models */ if(!model->REStnomGiven) model->REStnom = ckt->CKTnomTemp; @@ -45,8 +45,8 @@ RESsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state) model->RESbv_max = 1e99; /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here=here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here=RESnextInstance(here)) { if(!here->RESwidthGiven) here->RESwidth = model->RESdefWidth; if(!here->RESlengthGiven) here->RESlength = model->RESdefLength; diff --git a/src/spicelib/devices/res/ressload.c b/src/spicelib/devices/res/ressload.c index 56976cee7..80f766d9d 100644 --- a/src/spicelib/devices/res/ressload.c +++ b/src/spicelib/devices/res/ressload.c @@ -23,11 +23,11 @@ RESsLoad(GENmodel *inModel, CKTcircuit *ckt) RESinstance *here; /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here=here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here=RESnextInstance(here)) { if(here->RESsenParmNo){ double value; diff --git a/src/spicelib/devices/res/ressoachk.c b/src/spicelib/devices/res/ressoachk.c index 846a7fc3d..93db1f099 100644 --- a/src/spicelib/devices/res/ressoachk.c +++ b/src/spicelib/devices/res/ressoachk.c @@ -28,9 +28,9 @@ RESsoaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->RESnextModel) { + for (; model; model = RESnextModel(model)) { - for (here = model->RESinstances; here; here = here->RESnextInstance) { + for (here = RESinstances(model); here; here = RESnextInstance(here)) { vr = fabs(ckt->CKTrhsOld [here->RESposNode] - ckt->CKTrhsOld [here->RESnegNode]); diff --git a/src/spicelib/devices/res/ressprt.c b/src/spicelib/devices/res/ressprt.c index cec815e44..54ee74912 100644 --- a/src/spicelib/devices/res/ressprt.c +++ b/src/spicelib/devices/res/ressprt.c @@ -24,13 +24,13 @@ RESsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("RESISTORS-----------------\n"); /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { printf("Model name:%s\n",model->RESmodName); /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here=here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here=RESnextInstance(here)) { printf(" Instance name:%s\n",here->RESname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/res/ressset.c b/src/spicelib/devices/res/ressset.c index f8b61a3d8..b29542b4d 100644 --- a/src/spicelib/devices/res/ressset.c +++ b/src/spicelib/devices/res/ressset.c @@ -23,11 +23,11 @@ RESsSetup(SENstruct *info, GENmodel *inModel) RESinstance *here; /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here=here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here=RESnextInstance(here)) { if(here->RESsenParmNo){ here->RESsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/res/restemp.c b/src/spicelib/devices/res/restemp.c index 5ee91b792..7fbdcd505 100644 --- a/src/spicelib/devices/res/restemp.c +++ b/src/spicelib/devices/res/restemp.c @@ -24,11 +24,11 @@ REStemp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the resistor models */ - for( ; model != NULL; model = model->RESnextModel ) { + for( ; model != NULL; model = RESnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->RESinstances; here != NULL ; - here=here->RESnextInstance) { + for (here = RESinstances(model); here != NULL ; + here=RESnextInstance(here)) { /* Default Value Processing for Resistor Instance */ @@ -53,7 +53,7 @@ REStemp(GENmodel *inModel, CKTcircuit *ckt) void RESupdate_conduct(RESinstance *here, bool spill_warnings) { - RESmodel *model = here->RESmodPtr; + RESmodel *model = RESmodPtr(here); double factor; double difference; double tc1, tc2, tce; diff --git a/src/spicelib/devices/soi3/soi3acld.c b/src/spicelib/devices/soi3/soi3acld.c index 1997798f9..b98e6b4f8 100644 --- a/src/spicelib/devices/soi3/soi3acld.c +++ b/src/spicelib/devices/soi3/soi3acld.c @@ -75,10 +75,10 @@ SOI3acLoad(GENmodel *inModel, CKTcircuit *ckt) omega = ckt->CKTomega; - for( ; model != NULL; model = model->SOI3nextModel) + for( ; model != NULL; model = SOI3nextModel(model)) { - for(here = model->SOI3instances; here!= NULL; - here = here->SOI3nextInstance) + for(here = SOI3instances(model); here!= NULL; + here = SOI3nextInstance(here)) { if (here->SOI3mode < 0) diff --git a/src/spicelib/devices/soi3/soi3conv.c b/src/spicelib/devices/soi3/soi3conv.c index 9c1753fb8..88fa9cbdc 100644 --- a/src/spicelib/devices/soi3/soi3conv.c +++ b/src/spicelib/devices/soi3/soi3conv.c @@ -57,9 +57,9 @@ SOI3convTest(GENmodel *inModel, CKTcircuit *ckt) /* debug stuff */ /* FILE *fp,*fopen(); */ - for( ; model != NULL; model = model->SOI3nextModel) { - for(here = model->SOI3instances; here!= NULL; - here = here->SOI3nextInstance) { + for( ; model != NULL; model = SOI3nextModel(model)) { + for(here = SOI3instances(model); here!= NULL; + here = SOI3nextInstance(here)) { vbs = model->SOI3type * ( *(ckt->CKTrhs+here->SOI3bNode) - diff --git a/src/spicelib/devices/soi3/soi3ic.c b/src/spicelib/devices/soi3/soi3ic.c index bad6a2f82..6013eba4c 100644 --- a/src/spicelib/devices/soi3/soi3ic.c +++ b/src/spicelib/devices/soi3/soi3ic.c @@ -37,8 +37,8 @@ SOI3getic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->SOI3nextModel) { - for(here = model->SOI3instances; here ; here = here->SOI3nextInstance) { + for( ; model ; model = SOI3nextModel(model)) { + for(here = SOI3instances(model); here ; here = SOI3nextInstance(here)) { if(!here->SOI3icVBSGiven) { here->SOI3icVBS = diff --git a/src/spicelib/devices/soi3/soi3load.c b/src/spicelib/devices/soi3/soi3load.c index 6e019f9b0..b3c103e8e 100644 --- a/src/spicelib/devices/soi3/soi3load.c +++ b/src/spicelib/devices/soi3/soi3load.c @@ -157,11 +157,11 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) double m; - for( ; model != NULL; model = model->SOI3nextModel ) { + for( ; model != NULL; model = SOI3nextModel(model)) { /* loop through all the instances of the model */ - for (here = model->SOI3instances; here != NULL ; - here=here->SOI3nextInstance) { + for (here = SOI3instances(model); here != NULL ; + here=SOI3nextInstance(here)) { vt = CONSTKoverQ * here->SOI3temp; Check=1; diff --git a/src/spicelib/devices/soi3/soi3nois.c b/src/spicelib/devices/soi3/soi3nois.c index 6f54bf596..3e0817501 100644 --- a/src/spicelib/devices/soi3/soi3nois.c +++ b/src/spicelib/devices/soi3/soi3nois.c @@ -69,8 +69,8 @@ SOI3noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->SOI3nextModel) { - for (inst=model->SOI3instances; inst != NULL; inst=inst->SOI3nextInstance) { + for (model=firstModel; model != NULL; model=SOI3nextModel(model)) { + for (inst=SOI3instances(model); inst != NULL; inst=SOI3nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/soi3/soi3set.c b/src/spicelib/devices/soi3/soi3set.c index fa526700d..11eade08a 100644 --- a/src/spicelib/devices/soi3/soi3set.c +++ b/src/spicelib/devices/soi3/soi3set.c @@ -53,7 +53,7 @@ SOI3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /****** the netlist to default values. ******/ /* loop through all the SOI3 device models */ - for( ; model != NULL; model = model->SOI3nextModel ) { + for( ; model != NULL; model = SOI3nextModel(model)) { if(!model->SOI3typeGiven) { model->SOI3type = NSOI3; @@ -288,8 +288,8 @@ SOI3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /****** in the netlist to default values. ******/ /* loop through all the instances of the model */ - for (here = model->SOI3instances; here != NULL ; - here=here->SOI3nextInstance) { + for (here = SOI3instances(model); here != NULL ; + here=SOI3nextInstance(here)) { if(!here->SOI3icVBSGiven) { @@ -669,10 +669,10 @@ SOI3unsetup(GENmodel *inModel, CKTcircuit *ckt) SOI3instance *here; for (model = (SOI3model *)inModel; model != NULL; - model = model->SOI3nextModel) + model = SOI3nextModel(model)) { - for (here = model->SOI3instances; here != NULL; - here=here->SOI3nextInstance) + for (here = SOI3instances(model); here != NULL; + here=SOI3nextInstance(here)) { if (here->SOI3tout4Node > 0) CKTdltNNum(ckt, here->SOI3tout4Node); diff --git a/src/spicelib/devices/soi3/soi3temp.c b/src/spicelib/devices/soi3/soi3temp.c index 47865911d..be5837dfa 100644 --- a/src/spicelib/devices/soi3/soi3temp.c +++ b/src/spicelib/devices/soi3/soi3temp.c @@ -64,7 +64,7 @@ SOI3temp(GENmodel *inModel, CKTcircuit *ckt) double psi_delta0; /* loop through all the transistor models */ - for( ; model != NULL; model = model->SOI3nextModel) + for( ; model != NULL; model = SOI3nextModel(model)) { /* perform model defaulting */ @@ -299,8 +299,8 @@ SOI3temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all instances of the model */ - for(here = model->SOI3instances; here!= NULL; - here = here->SOI3nextInstance) + for(here = SOI3instances(model); here!= NULL; + here = SOI3nextInstance(here)) { double czbd; /* zero voltage bulk-drain capacitance */ diff --git a/src/spicelib/devices/soi3/soi3trun.c b/src/spicelib/devices/soi3/soi3trun.c index 36d603cc9..22c3f0a2b 100644 --- a/src/spicelib/devices/soi3/soi3trun.c +++ b/src/spicelib/devices/soi3/soi3trun.c @@ -33,9 +33,9 @@ SOI3trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) SOI3model *model = (SOI3model *)inModel; SOI3instance *here; - for( ; model != NULL; model = model->SOI3nextModel) + for( ; model != NULL; model = SOI3nextModel(model)) { - for(here=model->SOI3instances;here!=NULL;here = here->SOI3nextInstance) + for(here=SOI3instances(model);here!=NULL;here = SOI3nextInstance(here)) { CKTterr(here->SOI3qgf,ckt,timeStep); CKTterr(here->SOI3qd,ckt,timeStep); diff --git a/src/spicelib/devices/sw/swacload.c b/src/spicelib/devices/sw/swacload.c index 025c307c5..5b6e71e82 100644 --- a/src/spicelib/devices/sw/swacload.c +++ b/src/spicelib/devices/sw/swacload.c @@ -25,11 +25,11 @@ SWacLoad(GENmodel *inModel, CKTcircuit *ckt) int current_state; /* loop through all the switch models */ - for( ; model != NULL; model = model->SWnextModel ) { + for( ; model != NULL; model = SWnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->SWinstances; here != NULL ; - here=here->SWnextInstance) { + for (here = SWinstances(model); here != NULL ; + here=SWnextInstance(here)) { /* In AC analysis, just propogate the state... */ diff --git a/src/spicelib/devices/sw/swload.c b/src/spicelib/devices/sw/swload.c index d551c2850..a492b4a77 100644 --- a/src/spicelib/devices/sw/swload.c +++ b/src/spicelib/devices/sw/swload.c @@ -31,11 +31,11 @@ SWload(GENmodel *inModel, CKTcircuit *ckt) // double current_region = -1; /* loop through all the switch models */ - for( ; model != NULL; model = model->SWnextModel ) { + for( ; model != NULL; model = SWnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->SWinstances; here != NULL ; - here=here->SWnextInstance) { + for (here = SWinstances(model); here != NULL ; + here=SWnextInstance(here)) { old_current_state = *(ckt->CKTstates[0] + here->SWstate); previous_state = *(ckt->CKTstates[1] + here->SWstate); diff --git a/src/spicelib/devices/sw/swnoise.c b/src/spicelib/devices/sw/swnoise.c index 1d6e79e5a..1e429a2e1 100644 --- a/src/spicelib/devices/sw/swnoise.c +++ b/src/spicelib/devices/sw/swnoise.c @@ -36,8 +36,8 @@ SWnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata *da int current_state; - for (model=firstModel; model != NULL; model=model->SWnextModel) { - for (inst=model->SWinstances; inst != NULL; inst=inst->SWnextInstance) { + for (model=firstModel; model != NULL; model=SWnextModel(model)) { + for (inst=SWinstances(model); inst != NULL; inst=SWnextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/sw/swpzload.c b/src/spicelib/devices/sw/swpzload.c index bdf0a7469..ddcd08dc0 100644 --- a/src/spicelib/devices/sw/swpzload.c +++ b/src/spicelib/devices/sw/swpzload.c @@ -29,11 +29,11 @@ SWpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(s); /* loop through all the switch models */ - for( ; model != NULL; model = model->SWnextModel ) { + for( ; model != NULL; model = SWnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->SWinstances; here != NULL ; - here=here->SWnextInstance) { + for (here = SWinstances(model); here != NULL ; + here=SWnextInstance(here)) { /* In AC analysis, just propogate the state... */ diff --git a/src/spicelib/devices/sw/swsetup.c b/src/spicelib/devices/sw/swsetup.c index 7ba4a4905..11eea0421 100644 --- a/src/spicelib/devices/sw/swsetup.c +++ b/src/spicelib/devices/sw/swsetup.c @@ -23,7 +23,7 @@ SWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) SWinstance *here; /* loop through all the current source models */ - for( ; model != NULL; model = model->SWnextModel ) { + for( ; model != NULL; model = SWnextModel(model)) { /* Default Value Processing for Switch Model */ if (!model->SWthreshGiven) { model->SWvThreshold = 0; @@ -41,8 +41,8 @@ SWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->SWinstances; here != NULL ; - here=here->SWnextInstance) { + for (here = SWinstances(model); here != NULL ; + here=SWnextInstance(here)) { here->SWstate = *states; *states += SW_NUM_STATES; diff --git a/src/spicelib/devices/sw/swtrunc.c b/src/spicelib/devices/sw/swtrunc.c index cf19501b0..9b40e3098 100644 --- a/src/spicelib/devices/sw/swtrunc.c +++ b/src/spicelib/devices/sw/swtrunc.c @@ -19,9 +19,9 @@ SWtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) SWinstance *here; double lastChange, maxChange, maxStep, ref; - for( ; model!= NULL; model = model->SWnextModel) { - for(here = model->SWinstances ; here != NULL ; - here = here->SWnextInstance) { + for( ; model!= NULL; model = SWnextModel(model)) { + for(here = SWinstances(model); here != NULL ; + here = SWnextInstance(here)) { lastChange = *(ckt->CKTstate0+(here->SWstate+1)) - *(ckt->CKTstate1+(here->SWstate+1)); if (*(ckt->CKTstate0+(here->SWstate))==0) { diff --git a/src/spicelib/devices/tra/traacct.c b/src/spicelib/devices/tra/traacct.c index 465e7c8b4..5198df4ac 100644 --- a/src/spicelib/devices/tra/traacct.c +++ b/src/spicelib/devices/tra/traacct.c @@ -25,11 +25,11 @@ TRAaccept(CKTcircuit *ckt, GENmodel *inModel) /* loop through all the transmission line models */ - for( ; model != NULL; model = model->TRAnextModel ) { + for( ; model != NULL; model = TRAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->TRAinstances; here != NULL ; - here=here->TRAnextInstance) { + for (here = TRAinstances(model); here != NULL ; + here=TRAnextInstance(here)) { if( (ckt->CKTtime - here->TRAtd) > *(here->TRAdelays+6)) { /* shift! */ diff --git a/src/spicelib/devices/tra/traacld.c b/src/spicelib/devices/tra/traacld.c index 44d429a8f..094b277f0 100644 --- a/src/spicelib/devices/tra/traacld.c +++ b/src/spicelib/devices/tra/traacld.c @@ -21,11 +21,11 @@ TRAacLoad(GENmodel *inModel, CKTcircuit *ckt) double imag; /* loop through all the transmission line models */ - for( ; model != NULL; model = model->TRAnextModel ) { + for( ; model != NULL; model = TRAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->TRAinstances; here != NULL ; - here=here->TRAnextInstance) { + for (here = TRAinstances(model); here != NULL ; + here=TRAnextInstance(here)) { real = cos(-ckt->CKTomega*here->TRAtd); imag = sin(-ckt->CKTomega*here->TRAtd); diff --git a/src/spicelib/devices/tra/traload.c b/src/spicelib/devices/tra/traload.c index e13615030..fcda3f01d 100644 --- a/src/spicelib/devices/tra/traload.c +++ b/src/spicelib/devices/tra/traload.c @@ -27,11 +27,11 @@ TRAload(GENmodel *inModel, CKTcircuit *ckt) int i; /* loop through all the transmission line models */ - for( ; model != NULL; model = model->TRAnextModel ) { + for( ; model != NULL; model = TRAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->TRAinstances; here != NULL ; - here=here->TRAnextInstance) { + for (here = TRAinstances(model); here != NULL ; + here=TRAnextInstance(here)) { *(here->TRApos1Pos1Ptr) += here->TRAconduct; *(here->TRApos1Int1Ptr) -= here->TRAconduct; diff --git a/src/spicelib/devices/tra/trasetup.c b/src/spicelib/devices/tra/trasetup.c index bdf83a243..8ad68e8ca 100644 --- a/src/spicelib/devices/tra/trasetup.c +++ b/src/spicelib/devices/tra/trasetup.c @@ -28,11 +28,11 @@ TRAsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) NG_IGNORE(state); /* loop through all the transmission line models */ - for( ; model != NULL; model = model->TRAnextModel ) { + for( ; model != NULL; model = TRAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->TRAinstances; here != NULL ; - here=here->TRAnextInstance) { + for (here = TRAinstances(model); here != NULL ; + here=TRAnextInstance(here)) { if(here->TRAbrEq1==0) { error = CKTmkVolt(ckt,&tmp,here->TRAname,"i1"); @@ -121,10 +121,10 @@ TRAunsetup(GENmodel *inModel, CKTcircuit *ckt) TRAinstance *here; for (model = (TRAmodel *)inModel; model != NULL; - model = model->TRAnextModel) + model = TRAnextModel(model)) { - for (here = model->TRAinstances; here != NULL; - here=here->TRAnextInstance) + for (here = TRAinstances(model); here != NULL; + here=TRAnextInstance(here)) { if (here->TRAintNode2 > 0) CKTdltNNum(ckt, here->TRAintNode2); diff --git a/src/spicelib/devices/tra/tratemp.c b/src/spicelib/devices/tra/tratemp.c index ed0885d14..5f202cfdc 100644 --- a/src/spicelib/devices/tra/tratemp.c +++ b/src/spicelib/devices/tra/tratemp.c @@ -26,11 +26,11 @@ TRAtemp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the transmission line models */ - for( ; model != NULL; model = model->TRAnextModel ) { + for( ; model != NULL; model = TRAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->TRAinstances; here != NULL ; - here=here->TRAnextInstance) { + for (here = TRAinstances(model); here != NULL ; + here=TRAnextInstance(here)) { if(!here->TRAtdGiven) { here->TRAtd = here->TRAnl/here->TRAf; diff --git a/src/spicelib/devices/tra/tratrunc.c b/src/spicelib/devices/tra/tratrunc.c index 291687e39..f750c220b 100644 --- a/src/spicelib/devices/tra/tratrunc.c +++ b/src/spicelib/devices/tra/tratrunc.c @@ -23,11 +23,11 @@ TRAtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) double tmp; /* loop through all the transmission line models */ - for( ; model != NULL; model = model->TRAnextModel ) { + for( ; model != NULL; model = TRAnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->TRAinstances; here != NULL ; - here=here->TRAnextInstance) { + for (here = TRAinstances(model); here != NULL ; + here=TRAnextInstance(here)) { v1 = ( *(ckt->CKTrhsOld + here->TRAposNode2) - *(ckt->CKTrhsOld + here->TRAnegNode2)) diff --git a/src/spicelib/devices/txl/txlacct.c b/src/spicelib/devices/txl/txlacct.c index 0e4367f73..608815d03 100644 --- a/src/spicelib/devices/txl/txlacct.c +++ b/src/spicelib/devices/txl/txlacct.c @@ -26,11 +26,11 @@ TXLaccept(CKTcircuit *ckt, GENmodel *inModel) TXLine *tx; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->TXLnextModel ) { + for( ; model != NULL; model = TXLnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->TXLinstances; here != NULL ; - here=here->TXLnextInstance) { + for (here = TXLinstances(model); here != NULL ; + here=TXLnextInstance(here)) { h = ckt->CKTdelta; hint = (int) (h * 1e12); @@ -59,9 +59,9 @@ TXLaccept(CKTcircuit *ckt, GENmodel *inModel) } } model = (TXLmodel *)inModel; - for( ; model != NULL; model = model->TXLnextModel ) { - for (here = model->TXLinstances; here != NULL ; - here=here->TXLnextInstance) { + for( ; model != NULL; model = TXLnextModel(model)) { + for (here = TXLinstances(model); here != NULL ; + here=TXLnextInstance(here)) { nd = here->txline->in_node; nd->dvtag = 0; nd = here->txline->out_node; diff --git a/src/spicelib/devices/txl/txlfbr.c b/src/spicelib/devices/txl/txlfbr.c index be6f423a6..46503a403 100644 --- a/src/spicelib/devices/txl/txlfbr.c +++ b/src/spicelib/devices/txl/txlfbr.c @@ -20,9 +20,9 @@ TXLfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name) int error; CKTnode *tmp; - for( ; model != NULL; model = model->TXLnextModel) { - for (here = model->TXLinstances; here != NULL; - here = here->TXLnextInstance) { + for( ; model != NULL; model = TXLnextModel(model)) { + for (here = TXLinstances(model); here != NULL; + here = TXLnextInstance(here)) { if(here->TXLname == name) { if(here->TXLbranch == 0) { error = CKTmkCur(ckt,&tmp,here->TXLname,"branch"); diff --git a/src/spicelib/devices/txl/txlload.c b/src/spicelib/devices/txl/txlload.c index a76bb0923..22a0d66df 100644 --- a/src/spicelib/devices/txl/txlload.c +++ b/src/spicelib/devices/txl/txlload.c @@ -61,9 +61,9 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt) gmin = 0.1 * ckt->CKTgmin; /* dc solution */ - for( ; model != NULL; model = model->TXLnextModel ) { - for (here = model->TXLinstances; here != NULL ; - here=here->TXLnextInstance) { + for( ; model != NULL; model = TXLnextModel(model)) { + for (here = TXLinstances(model); here != NULL ; + here=TXLnextInstance(here)) { tx = here->txline; @@ -108,9 +108,9 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt) } model = (TXLmodel *)inModel; - for( ; model != NULL; model = model->TXLnextModel ) { - for (here = model->TXLinstances; here != NULL ; - here=here->TXLnextInstance) { + for( ; model != NULL; model = TXLnextModel(model)) { + for (here = TXLinstances(model); here != NULL ; + here=TXLnextInstance(here)) { tx = here->txline; tx2 = here->txline2; @@ -132,7 +132,7 @@ TXLload(GENmodel *inModel, CKTcircuit *ckt) if (cond1) { if (here->TXLlengthgiven) g = model->R * here->TXLlength; - else g = model->R * here->TXLmodPtr->length; + else g = model->R * TXLmodPtr(here)->length; *(here->TXLposIbr1Ptr) += 1.0; *(here->TXLnegIbr2Ptr) += 1.0; *(here->TXLibr1Ibr1Ptr) += 1.0; diff --git a/src/spicelib/devices/txl/txlsetup.c b/src/spicelib/devices/txl/txlsetup.c index 0eea24240..bd2a5ef2a 100644 --- a/src/spicelib/devices/txl/txlsetup.c +++ b/src/spicelib/devices/txl/txlsetup.c @@ -85,7 +85,7 @@ TXLsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state) NG_IGNORE(state); /* loop through all the models */ - for( ; model != NULL; model = model->TXLnextModel ) { + for( ; model != NULL; model = TXLnextModel(model)) { if (!model->Rgiven) { SPfrontEnd->IFerrorf (ERR_FATAL, @@ -114,8 +114,8 @@ TXLsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state) } /* loop through all the instances of the model */ - for (here = model->TXLinstances; here != NULL ; - here=here->TXLnextInstance) { + for (here = TXLinstances(model); here != NULL ; + here=TXLnextInstance(here)) { /* macro to make elements with built in test for out of memory */ #define TSTALLOC(ptr,first,second) \ @@ -166,9 +166,9 @@ TXLunsetup(GENmodel *inModel, CKTcircuit *ckt) TXLinstance *here; for (model = (TXLmodel *) inModel; model != NULL; - model = model->TXLnextModel) { - for (here = model->TXLinstances; here != NULL; - here = here->TXLnextInstance) { + model = TXLnextModel(model)) { + for (here = TXLinstances(model); here != NULL; + here = TXLnextInstance(here)) { if (here->TXLibr2) { CKTdltNNum(ckt, here->TXLibr2); @@ -257,14 +257,14 @@ ReadTxL(TXLinstance *tx, CKTcircuit *ckt) t2->lsl = 0; l = 0.0; - R = tx->TXLmodPtr->R; - L = tx->TXLmodPtr->L; + R = TXLmodPtr(tx)->R; + L = TXLmodPtr(tx)->L; L = MAX(L, LL); - C = tx->TXLmodPtr->C; - G = tx->TXLmodPtr->G; + C = TXLmodPtr(tx)->C; + G = TXLmodPtr(tx)->G; if (tx->TXLlengthgiven == TRUE) l = tx->TXLlength; - else l = tx->TXLmodPtr->length; + else l = TXLmodPtr(tx)->length; if (l == 0.0) { diff --git a/src/spicelib/devices/urc/urcsetup.c b/src/spicelib/devices/urc/urcsetup.c index 1db4a012e..5959d2fae 100644 --- a/src/spicelib/devices/urc/urcsetup.c +++ b/src/spicelib/devices/urc/urcsetup.c @@ -61,7 +61,7 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) ctype = CKTtypelook("Capacitor"); dtype = CKTtypelook("Diode"); /* loop through all the URC models */ - for( ; model != NULL; model = model->URCnextModel ) { + for( ; model != NULL; model = URCnextModel(model)) { if(!model->URCkGiven) model->URCk = 1.5; if(!model->URCfmaxGiven) @@ -74,8 +74,8 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) /* may need to put in limits: k>=1.1, freq <=1e9, rperl >=.1 */ /* loop through all the instances of the model */ - for (here = model->URCinstances; here != NULL ; - here=here->URCnextInstance) + for (here = URCinstances(model); here != NULL ; + here=URCnextInstance(here)) { p = model->URCk; r0 = here->URClength * model->URCrPerL; @@ -275,9 +275,9 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt) /* Delete models, devices, and intermediate nodes; */ - for ( ; model; model = model->URCnextModel) { - for (here = model->URCinstances; here; - here = here->URCnextInstance) + for ( ; model; model = URCnextModel(model)) { + for (here = URCinstances(model); here; + here = URCnextInstance(here)) { if(model->URCisPerLGiven) { /* Diodes */ diff --git a/src/spicelib/devices/vbic/vbicacld.c b/src/spicelib/devices/vbic/vbicacld.c index fb4fab30c..e896777e0 100644 --- a/src/spicelib/devices/vbic/vbicacld.c +++ b/src/spicelib/devices/vbic/vbicacld.c @@ -33,11 +33,11 @@ VBICacLoad(GENmodel *inModel, CKTcircuit *ckt) XQbcp_Vbcp; /* loop through all the models */ - for( ; model != NULL; model = model->VBICnextModel) { + for( ; model != NULL; model = VBICnextModel(model)) { /* loop through all the instances of the model */ - for( here = model->VBICinstances; here!= NULL; - here = here->VBICnextInstance) { + for( here = VBICinstances(model); here!= NULL; + here = VBICnextInstance(here)) { Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei); Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex); diff --git a/src/spicelib/devices/vbic/vbicconv.c b/src/spicelib/devices/vbic/vbicconv.c index 0118caa40..f1def73fa 100644 --- a/src/spicelib/devices/vbic/vbicconv.c +++ b/src/spicelib/devices/vbic/vbicconv.c @@ -45,8 +45,8 @@ VBICconvTest(GENmodel *inModel, CKTcircuit *ckt) double Vbei, Vbex, Vbci, Vbcx, Vbep, Vrci, Vrbi, Vrbp, Vbcp; double Ibe, Ibex, Itzf, Itzr, Ibc, Ibep, Irci, Irbi, Irbp, Ibcp, Iccp; - for( ; model != NULL; model = model->VBICnextModel) { - for(here=model->VBICinstances;here!=NULL;here = here->VBICnextInstance) { + for( ; model != NULL; model = VBICnextModel(model)) { + for(here=VBICinstances(model);here!=NULL;here = VBICnextInstance(here)) { Vbei=model->VBICtype*( *(ckt->CKTrhsOld+here->VBICbaseBINode)- diff --git a/src/spicelib/devices/vbic/vbicgetic.c b/src/spicelib/devices/vbic/vbicgetic.c index 4d2db6dd1..54598720b 100644 --- a/src/spicelib/devices/vbic/vbicgetic.c +++ b/src/spicelib/devices/vbic/vbicgetic.c @@ -28,8 +28,8 @@ VBICgetic(GENmodel *inModel, CKTcircuit *ckt) * external nodes to get values */ - for( ; model ; model = model->VBICnextModel) { - for(here = model->VBICinstances; here ; here = here->VBICnextInstance) { + for( ; model ; model = VBICnextModel(model)) { + for(here = VBICinstances(model); here ; here = VBICnextInstance(here)) { if(!here->VBICicVBEGiven) { here->VBICicVBE = diff --git a/src/spicelib/devices/vbic/vbicload.c b/src/spicelib/devices/vbic/vbicload.c index 1bf534eb0..82793ecaa 100644 --- a/src/spicelib/devices/vbic/vbicload.c +++ b/src/spicelib/devices/vbic/vbicload.c @@ -85,11 +85,11 @@ VBICload(GENmodel *inModel, CKTcircuit *ckt) double gqbeo, cqbeo, gqbco, cqbco, gbcx, cbcx; /* loop through all the models */ - for( ; model != NULL; model = model->VBICnextModel ) { + for( ; model != NULL; model = VBICnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VBICinstances; here != NULL ; - here=here->VBICnextInstance) { + for (here = VBICinstances(model); here != NULL ; + here=VBICnextInstance(here)) { vt = here->VBICtemp * CONSTKoverQ; diff --git a/src/spicelib/devices/vbic/vbicnoise.c b/src/spicelib/devices/vbic/vbicnoise.c index 04383cab3..42516da59 100644 --- a/src/spicelib/devices/vbic/vbicnoise.c +++ b/src/spicelib/devices/vbic/vbicnoise.c @@ -58,9 +58,9 @@ VBICnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Ndata * "" /* total transistor noise */ }; - for (model=firstModel; model != NULL; model=model->VBICnextModel) { - for (inst=model->VBICinstances; inst != NULL; - inst=inst->VBICnextInstance) { + for (model=firstModel; model != NULL; model=VBICnextModel(model)) { + for (inst=VBICinstances(model); inst != NULL; + inst=VBICnextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/vbic/vbicpzld.c b/src/spicelib/devices/vbic/vbicpzld.c index a70387a0f..18c59410a 100644 --- a/src/spicelib/devices/vbic/vbicpzld.c +++ b/src/spicelib/devices/vbic/vbicpzld.c @@ -33,11 +33,11 @@ VBICpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) XQbcp_Vbcp; /* loop through all the models */ - for( ; model != NULL; model = model->VBICnextModel) { + for( ; model != NULL; model = VBICnextModel(model)) { /* loop through all the instances of the model */ - for( here = model->VBICinstances; here!= NULL; - here = here->VBICnextInstance) { + for( here = VBICinstances(model); here!= NULL; + here = VBICnextInstance(here)) { Ibe_Vbei = *(ckt->CKTstate0 + here->VBICibe_Vbei); Ibex_Vbex = *(ckt->CKTstate0 + here->VBICibex_Vbex); diff --git a/src/spicelib/devices/vbic/vbicsetup.c b/src/spicelib/devices/vbic/vbicsetup.c index 7c483a8aa..47907538b 100644 --- a/src/spicelib/devices/vbic/vbicsetup.c +++ b/src/spicelib/devices/vbic/vbicsetup.c @@ -33,7 +33,7 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) CKTnode *tmp; /* loop through all the transistor models */ - for( ; model != NULL; model = model->VBICnextModel ) { + for( ; model != NULL; model = VBICnextModel(model)) { if(model->VBICtype != NPN && model->VBICtype != PNP) { model->VBICtype = NPN; @@ -380,8 +380,8 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } /* loop through all the instances of the model */ - for (here = model->VBICinstances; here != NULL ; - here=here->VBICnextInstance) { + for (here = VBICinstances(model); here != NULL ; + here=VBICnextInstance(here)) { CKTnode *tmpNode; IFuid tmpName; @@ -553,10 +553,10 @@ VBICunsetup( VBICinstance *here; for (model = (VBICmodel *)inModel; model != NULL; - model = model->VBICnextModel) + model = VBICnextModel(model)) { - for (here = model->VBICinstances; here != NULL; - here=here->VBICnextInstance) + for (here = VBICinstances(model); here != NULL; + here=VBICnextInstance(here)) { if (here->VBICbaseBINode > 0) CKTdltNNum(ckt, here->VBICbaseBINode); diff --git a/src/spicelib/devices/vbic/vbicsoachk.c b/src/spicelib/devices/vbic/vbicsoachk.c index f534e5aff..34d6755ac 100644 --- a/src/spicelib/devices/vbic/vbicsoachk.c +++ b/src/spicelib/devices/vbic/vbicsoachk.c @@ -30,9 +30,9 @@ VBICsoaCheck(CKTcircuit *ckt, GENmodel *inModel) maxwarns = ckt->CKTsoaMaxWarns; - for (; model; model = model->VBICnextModel) { + for (; model; model = VBICnextModel(model)) { - for (here = model->VBICinstances; here; here=here->VBICnextInstance) { + for (here = VBICinstances(model); here; here=VBICnextInstance(here)) { vbe = fabs(ckt->CKTrhsOld [here->VBICbaseNode] - ckt->CKTrhsOld [here->VBICemitNode]); diff --git a/src/spicelib/devices/vbic/vbictemp.c b/src/spicelib/devices/vbic/vbictemp.c index c97114273..333733e26 100644 --- a/src/spicelib/devices/vbic/vbictemp.c +++ b/src/spicelib/devices/vbic/vbictemp.c @@ -30,7 +30,7 @@ VBICtemp(GENmodel *inModel, CKTcircuit *ckt) double vt; /* loop through all the bipolar models */ - for( ; model != NULL; model = model->VBICnextModel ) { + for( ; model != NULL; model = VBICnextModel(model)) { if(!model->VBICtnomGiven) model->VBICtnom = ckt->CKTnomTemp - CONSTCtoK; @@ -69,8 +69,8 @@ VBICtemp(GENmodel *inModel, CKTcircuit *ckt) } /* loop through all the instances of the model */ - for (here = model->VBICinstances; here != NULL ; - here=here->VBICnextInstance) { + for (here = VBICinstances(model); here != NULL ; + here=VBICnextInstance(here)) { if(!here->VBICtempGiven) here->VBICtemp = ckt->CKTtemp; diff --git a/src/spicelib/devices/vbic/vbictrunc.c b/src/spicelib/devices/vbic/vbictrunc.c index ecda4b98b..eb8603edf 100644 --- a/src/spicelib/devices/vbic/vbictrunc.c +++ b/src/spicelib/devices/vbic/vbictrunc.c @@ -23,9 +23,9 @@ VBICtrunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) VBICmodel *model = (VBICmodel*)inModel; VBICinstance *here; - for( ; model != NULL; model = model->VBICnextModel) { - for(here=model->VBICinstances;here!=NULL; - here = here->VBICnextInstance){ + for( ; model != NULL; model = VBICnextModel(model)) { + for(here=VBICinstances(model);here!=NULL; + here = VBICnextInstance(here)){ CKTterr(here->VBICqbe,ckt,timeStep); CKTterr(here->VBICqbex,ckt,timeStep); diff --git a/src/spicelib/devices/vccs/vccsload.c b/src/spicelib/devices/vccs/vccsload.c index 341b9ed78..81c98e77b 100644 --- a/src/spicelib/devices/vccs/vccsload.c +++ b/src/spicelib/devices/vccs/vccsload.c @@ -25,11 +25,11 @@ VCCSload(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the source models */ - for( ; model != NULL; model = model->VCCSnextModel ) { + for( ; model != NULL; model = VCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCCSinstances; here != NULL ; - here=here->VCCSnextInstance) { + for (here = VCCSinstances(model); here != NULL ; + here=VCCSnextInstance(here)) { *(here->VCCSposContPosPtr) += here->VCCScoeff ; *(here->VCCSposContNegPtr) -= here->VCCScoeff ; diff --git a/src/spicelib/devices/vccs/vccspzld.c b/src/spicelib/devices/vccs/vccspzld.c index 0bb2b75d6..da07c62c4 100644 --- a/src/spicelib/devices/vccs/vccspzld.c +++ b/src/spicelib/devices/vccs/vccspzld.c @@ -27,11 +27,11 @@ VCCSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); /* loop through all the source models */ - for( ; model != NULL; model = model->VCCSnextModel ) { + for( ; model != NULL; model = VCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCCSinstances; here != NULL ; - here=here->VCCSnextInstance) { + for (here = VCCSinstances(model); here != NULL ; + here=VCCSnextInstance(here)) { *(here->VCCSposContPosPtr) += here->VCCScoeff ; *(here->VCCSposContNegPtr) -= here->VCCScoeff ; diff --git a/src/spicelib/devices/vccs/vccssacl.c b/src/spicelib/devices/vccs/vccssacl.c index 3889fbb82..89087eb99 100644 --- a/src/spicelib/devices/vccs/vccssacl.c +++ b/src/spicelib/devices/vccs/vccssacl.c @@ -27,11 +27,11 @@ VCCSsAcLoad(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the source models */ - for( ; model != NULL; model = model->VCCSnextModel ) { + for( ; model != NULL; model = VCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCCSinstances; here != NULL ; - here=here->VCCSnextInstance) { + for (here = VCCSinstances(model); here != NULL ; + here=VCCSnextInstance(here)) { if (here->VCCSsenParmNo){ vc = *(ckt->CKTrhsOld + here->VCCScontPosNode) diff --git a/src/spicelib/devices/vccs/vccsset.c b/src/spicelib/devices/vccs/vccsset.c index 374b2e926..e956708ca 100644 --- a/src/spicelib/devices/vccs/vccsset.c +++ b/src/spicelib/devices/vccs/vccsset.c @@ -28,11 +28,11 @@ VCCSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) NG_IGNORE(ckt); /* loop through all the current source models */ - for( ; model != NULL; model = model->VCCSnextModel ) { + for( ; model != NULL; model = VCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCCSinstances; here != NULL ; - here=here->VCCSnextInstance) { + for (here = VCCSinstances(model); here != NULL ; + here=VCCSnextInstance(here)) { /* macro to make elements with built in test for out of memory */ #define TSTALLOC(ptr,first,second) \ diff --git a/src/spicelib/devices/vccs/vccssld.c b/src/spicelib/devices/vccs/vccssld.c index c177628ed..9236ac810 100644 --- a/src/spicelib/devices/vccs/vccssld.c +++ b/src/spicelib/devices/vccs/vccssld.c @@ -25,11 +25,11 @@ VCCSsLoad(GENmodel *inModel, CKTcircuit *ckt) double vc; /* loop through all the source models */ - for( ; model != NULL; model = model->VCCSnextModel ) { + for( ; model != NULL; model = VCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCCSinstances; here != NULL ; - here=here->VCCSnextInstance) { + for (here = VCCSinstances(model); here != NULL ; + here=VCCSnextInstance(here)) { if(here->VCCSsenParmNo){ vc = *(ckt->CKTrhsOld + here->VCCScontPosNode) diff --git a/src/spicelib/devices/vccs/vccssprt.c b/src/spicelib/devices/vccs/vccssprt.c index eeab21cfa..9d44b92ed 100644 --- a/src/spicelib/devices/vccs/vccssprt.c +++ b/src/spicelib/devices/vccs/vccssprt.c @@ -25,13 +25,13 @@ VCCSsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("VOLTAGE CONTROLLED CURRENT SOURCES-----------------\n"); /* loop through all the source models */ - for( ; model != NULL; model = model->VCCSnextModel ) { + for( ; model != NULL; model = VCCSnextModel(model)) { printf("Model name:%s\n",model->VCCSmodName); /* loop through all the instances of the model */ - for (here = model->VCCSinstances; here != NULL ; - here=here->VCCSnextInstance) { + for (here = VCCSinstances(model); here != NULL ; + here=VCCSnextInstance(here)) { printf(" Instance name:%s\n",here->VCCSname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/vccs/vccssset.c b/src/spicelib/devices/vccs/vccssset.c index 84c261bc0..b83f1731c 100644 --- a/src/spicelib/devices/vccs/vccssset.c +++ b/src/spicelib/devices/vccs/vccssset.c @@ -24,11 +24,11 @@ VCCSsSetup(SENstruct *info, GENmodel *inModel) VCCSinstance *here; /* loop through all the current source models */ - for( ; model != NULL; model = model->VCCSnextModel ) { + for( ; model != NULL; model = VCCSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCCSinstances; here != NULL ; - here=here->VCCSnextInstance) { + for (here = VCCSinstances(model); here != NULL ; + here=VCCSnextInstance(here)) { if(here->VCCSsenParmNo){ here->VCCSsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/vcvs/vcvsfbr.c b/src/spicelib/devices/vcvs/vcvsfbr.c index d26275129..e2ebd588a 100644 --- a/src/spicelib/devices/vcvs/vcvsfbr.c +++ b/src/spicelib/devices/vcvs/vcvsfbr.c @@ -21,9 +21,9 @@ VCVSfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name) int error; CKTnode *tmp; - for( ; model != NULL; model = model->VCVSnextModel) { - for (here = model->VCVSinstances; here != NULL; - here = here->VCVSnextInstance) { + for( ; model != NULL; model = VCVSnextModel(model)) { + for (here = VCVSinstances(model); here != NULL; + here = VCVSnextInstance(here)) { if(here->VCVSname == name) { if(here->VCVSbranch == 0) { error = CKTmkCur(ckt,&tmp,here->VCVSname,"branch"); diff --git a/src/spicelib/devices/vcvs/vcvsload.c b/src/spicelib/devices/vcvs/vcvsload.c index f321caf1c..13ba3ac74 100644 --- a/src/spicelib/devices/vcvs/vcvsload.c +++ b/src/spicelib/devices/vcvs/vcvsload.c @@ -25,11 +25,11 @@ VCVSload(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VCVSnextModel ) { + for( ; model != NULL; model = VCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCVSinstances; here != NULL ; - here=here->VCVSnextInstance) { + for (here = VCVSinstances(model); here != NULL ; + here=VCVSnextInstance(here)) { *(here->VCVSposIbrPtr) += 1.0 ; *(here->VCVSnegIbrPtr) -= 1.0 ; diff --git a/src/spicelib/devices/vcvs/vcvspzld.c b/src/spicelib/devices/vcvs/vcvspzld.c index f9e5556a3..3b8044505 100644 --- a/src/spicelib/devices/vcvs/vcvspzld.c +++ b/src/spicelib/devices/vcvs/vcvspzld.c @@ -27,11 +27,11 @@ VCVSpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(ckt); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VCVSnextModel ) { + for( ; model != NULL; model = VCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCVSinstances; here != NULL ; - here=here->VCVSnextInstance) { + for (here = VCVSinstances(model); here != NULL ; + here=VCVSnextInstance(here)) { *(here->VCVSposIbrPtr) += 1.0 ; *(here->VCVSnegIbrPtr) -= 1.0 ; diff --git a/src/spicelib/devices/vcvs/vcvssacl.c b/src/spicelib/devices/vcvs/vcvssacl.c index 614925d1a..c41210507 100644 --- a/src/spicelib/devices/vcvs/vcvssacl.c +++ b/src/spicelib/devices/vcvs/vcvssacl.c @@ -25,11 +25,11 @@ VCVSsAcLoad(GENmodel *inModel, CKTcircuit *ckt) double ivc; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VCVSnextModel ) { + for( ; model != NULL; model = VCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCVSinstances; here != NULL ; - here=here->VCVSnextInstance) { + for (here = VCVSinstances(model); here != NULL ; + here=VCVSnextInstance(here)) { if(here->VCVSsenParmNo){ diff --git a/src/spicelib/devices/vcvs/vcvsset.c b/src/spicelib/devices/vcvs/vcvsset.c index 981f8af79..d3196b4a4 100644 --- a/src/spicelib/devices/vcvs/vcvsset.c +++ b/src/spicelib/devices/vcvs/vcvsset.c @@ -26,11 +26,11 @@ VCVSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) NG_IGNORE(states); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VCVSnextModel ) { + for( ; model != NULL; model = VCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCVSinstances; here != NULL ; - here=here->VCVSnextInstance) { + for (here = VCVSinstances(model); here != NULL ; + here=VCVSnextInstance(here)) { if(here->VCVSposNode == here->VCVSnegNode) { SPfrontEnd->IFerrorf (ERR_FATAL, @@ -68,10 +68,10 @@ VCVSunsetup(GENmodel *inModel, CKTcircuit *ckt) VCVSinstance *here; for (model = (VCVSmodel *)inModel; model != NULL; - model = model->VCVSnextModel) + model = VCVSnextModel(model)) { - for (here = model->VCVSinstances; here != NULL; - here=here->VCVSnextInstance) + for (here = VCVSinstances(model); here != NULL; + here=VCVSnextInstance(here)) { if (here->VCVSbranch > 0) CKTdltNNum(ckt, here->VCVSbranch); diff --git a/src/spicelib/devices/vcvs/vcvssld.c b/src/spicelib/devices/vcvs/vcvssld.c index 4541aafc1..97015c92c 100644 --- a/src/spicelib/devices/vcvs/vcvssld.c +++ b/src/spicelib/devices/vcvs/vcvssld.c @@ -24,11 +24,11 @@ VCVSsLoad(GENmodel *inModel, CKTcircuit *ckt) double vc; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VCVSnextModel ) { + for( ; model != NULL; model = VCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCVSinstances; here != NULL ; - here=here->VCVSnextInstance) { + for (here = VCVSinstances(model); here != NULL ; + here=VCVSnextInstance(here)) { if(here->VCVSsenParmNo){ diff --git a/src/spicelib/devices/vcvs/vcvssprt.c b/src/spicelib/devices/vcvs/vcvssprt.c index 81789c5de..3776bed33 100644 --- a/src/spicelib/devices/vcvs/vcvssprt.c +++ b/src/spicelib/devices/vcvs/vcvssprt.c @@ -24,13 +24,13 @@ VCVSsPrint(GENmodel *inModel, CKTcircuit *ckt) printf("VOLTAGE CONTROLLED VOLTAGE SOURCES-----------------\n"); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VCVSnextModel ) { + for( ; model != NULL; model = VCVSnextModel(model)) { printf("Model name:%s\n",model->VCVSmodName); /* loop through all the instances of the model */ - for (here = model->VCVSinstances; here != NULL ; - here=here->VCVSnextInstance) { + for (here = VCVSinstances(model); here != NULL ; + here=VCVSnextInstance(here)) { printf(" Instance name:%s\n",here->VCVSname); printf(" Positive, negative nodes: %s, %s\n", diff --git a/src/spicelib/devices/vcvs/vcvssset.c b/src/spicelib/devices/vcvs/vcvssset.c index 0d5d1f645..26f07e785 100644 --- a/src/spicelib/devices/vcvs/vcvssset.c +++ b/src/spicelib/devices/vcvs/vcvssset.c @@ -24,11 +24,11 @@ VCVSsSetup(SENstruct *info, GENmodel *inModel) VCVSinstance *here; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VCVSnextModel ) { + for( ; model != NULL; model = VCVSnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VCVSinstances; here != NULL ; - here=here->VCVSnextInstance) { + for (here = VCVSinstances(model); here != NULL ; + here=VCVSnextInstance(here)) { if(here->VCVSsenParmNo){ here->VCVSsenParmNo = ++(info->SENparms); diff --git a/src/spicelib/devices/vsrc/vsrcacct.c b/src/spicelib/devices/vsrc/vsrcacct.c index d1aacacc6..daa6ab78a 100644 --- a/src/spicelib/devices/vsrc/vsrcacct.c +++ b/src/spicelib/devices/vsrc/vsrcacct.c @@ -30,11 +30,11 @@ VSRCaccept(CKTcircuit *ckt, GENmodel *inModel) int error; /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VSRCnextModel ) { + for( ; model != NULL; model = VSRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VSRCinstances; here != NULL ; - here=here->VSRCnextInstance) { + for (here = VSRCinstances(model); here != NULL ; + here=VSRCnextInstance(here)) { if(!(ckt->CKTmode & (MODETRAN | MODETRANOP))) { /* not transient, so shouldn't be here */ diff --git a/src/spicelib/devices/vsrc/vsrcacld.c b/src/spicelib/devices/vsrc/vsrcacld.c index c7ae3dfe3..8ea4e345b 100644 --- a/src/spicelib/devices/vsrc/vsrcacld.c +++ b/src/spicelib/devices/vsrc/vsrcacld.c @@ -16,11 +16,11 @@ VSRCacLoad(GENmodel *inModel, CKTcircuit *ckt) VSRCmodel *model = (VSRCmodel *) inModel; VSRCinstance *here; - for( ; model != NULL; model = model->VSRCnextModel ) { + for( ; model != NULL; model = VSRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VSRCinstances; here != NULL ; - here=here->VSRCnextInstance) { + for (here = VSRCinstances(model); here != NULL ; + here=VSRCnextInstance(here)) { double acReal, acImag; diff --git a/src/spicelib/devices/vsrc/vsrcfbr.c b/src/spicelib/devices/vsrc/vsrcfbr.c index 05f9d356a..fed1075e6 100644 --- a/src/spicelib/devices/vsrc/vsrcfbr.c +++ b/src/spicelib/devices/vsrc/vsrcfbr.c @@ -20,9 +20,9 @@ VSRCfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name) int error; CKTnode *tmp; - for( ; model != NULL; model = model->VSRCnextModel) { - for (here = model->VSRCinstances; here != NULL; - here = here->VSRCnextInstance) { + for( ; model != NULL; model = VSRCnextModel(model)) { + for (here = VSRCinstances(model); here != NULL; + here = VSRCnextInstance(here)) { if(here->VSRCname == name) { if(here->VSRCbranch == 0) { error = CKTmkCur(ckt,&tmp,here->VSRCname,"branch"); diff --git a/src/spicelib/devices/vsrc/vsrcload.c b/src/spicelib/devices/vsrc/vsrcload.c index 7f3097a7a..72bed3deb 100644 --- a/src/spicelib/devices/vsrc/vsrcload.c +++ b/src/spicelib/devices/vsrc/vsrcload.c @@ -34,11 +34,11 @@ VSRCload(GENmodel *inModel, CKTcircuit *ckt) double value = 0.0; /* loop through all the source models */ - for( ; model != NULL; model = model->VSRCnextModel ) { + for( ; model != NULL; model = VSRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VSRCinstances; here != NULL ; - here=here->VSRCnextInstance) { + for (here = VSRCinstances(model); here != NULL ; + here=VSRCnextInstance(here)) { *(here->VSRCposIbrPtr) += 1.0 ; *(here->VSRCnegIbrPtr) -= 1.0 ; diff --git a/src/spicelib/devices/vsrc/vsrcpzld.c b/src/spicelib/devices/vsrc/vsrcpzld.c index 76d5fac2e..753f76f1c 100644 --- a/src/spicelib/devices/vsrc/vsrcpzld.c +++ b/src/spicelib/devices/vsrc/vsrcpzld.c @@ -20,11 +20,11 @@ VSRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(s); NG_IGNORE(ckt); - for( ; model != NULL; model = model->VSRCnextModel ) { + for( ; model != NULL; model = VSRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VSRCinstances; here != NULL ; - here=here->VSRCnextInstance) { + for (here = VSRCinstances(model); here != NULL ; + here=VSRCnextInstance(here)) { if (!(here->VSRCacGiven)) { /*a dc source*/ diff --git a/src/spicelib/devices/vsrc/vsrcpzs.c b/src/spicelib/devices/vsrc/vsrcpzs.c index 0729559a7..aac092467 100644 --- a/src/spicelib/devices/vsrc/vsrcpzs.c +++ b/src/spicelib/devices/vsrc/vsrcpzs.c @@ -24,11 +24,11 @@ VSRCpzSetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, NG_IGNORE(state); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VSRCnextModel ) { + for( ; model != NULL; model = VSRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VSRCinstances; here != NULL ; - here = here->VSRCnextInstance) { + for (here = VSRCinstances(model); here != NULL ; + here = VSRCnextInstance(here)) { if (here->VSRCbranch == 0) { error = CKTmkCur(ckt,&tmp,here->VSRCname,"branch"); diff --git a/src/spicelib/devices/vsrc/vsrcset.c b/src/spicelib/devices/vsrc/vsrcset.c index 32d8de3b8..7511acc3c 100644 --- a/src/spicelib/devices/vsrc/vsrcset.c +++ b/src/spicelib/devices/vsrc/vsrcset.c @@ -25,11 +25,11 @@ VSRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) NG_IGNORE(state); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VSRCnextModel ) { + for( ; model != NULL; model = VSRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VSRCinstances; here != NULL ; - here=here->VSRCnextInstance) { + for (here = VSRCinstances(model); here != NULL ; + here=VSRCnextInstance(here)) { if(here->VSRCposNode == here->VSRCnegNode) { SPfrontEnd->IFerrorf (ERR_FATAL, @@ -65,10 +65,10 @@ VSRCunsetup(GENmodel *inModel, CKTcircuit *ckt) VSRCinstance *here; for (model = (VSRCmodel *)inModel; model != NULL; - model = model->VSRCnextModel) + model = VSRCnextModel(model)) { - for (here = model->VSRCinstances; here != NULL; - here=here->VSRCnextInstance) + for (here = VSRCinstances(model); here != NULL; + here=VSRCnextInstance(here)) { if (here->VSRCbranch > 0) CKTdltNNum(ckt, here->VSRCbranch); diff --git a/src/spicelib/devices/vsrc/vsrctemp.c b/src/spicelib/devices/vsrc/vsrctemp.c index ccc125a90..0a468e34f 100644 --- a/src/spicelib/devices/vsrc/vsrctemp.c +++ b/src/spicelib/devices/vsrc/vsrctemp.c @@ -23,11 +23,11 @@ VSRCtemp(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); /* loop through all the voltage source models */ - for( ; model != NULL; model = model->VSRCnextModel ) { + for( ; model != NULL; model = VSRCnextModel(model)) { /* loop through all the instances of the model */ - for (here = model->VSRCinstances; here != NULL ; - here=here->VSRCnextInstance) { + for (here = VSRCinstances(model); here != NULL ; + here=VSRCnextInstance(here)) { if(here->VSRCacGiven && !here->VSRCacMGiven) { here->VSRCacMag = 1; diff --git a/src/xspice/cm/cmmeters.c b/src/xspice/cm/cmmeters.c index 8f398b341..37e2f1372 100644 --- a/src/xspice/cm/cmmeters.c +++ b/src/xspice/cm/cmmeters.c @@ -109,10 +109,10 @@ double cm_netlist_get_c(void) /* Scan through all capacitor instances and add in values */ /* of any capacitors connected to cmeter input */ - for(cap_model = cap_head; cap_model; cap_model = cap_model->CAPnextModel) { - for(cap_inst = cap_model->CAPinstances; + for(cap_model = cap_head; cap_model; cap_model = CAPnextModel(cap_model)) { + for(cap_inst = CAPinstances(cap_model); cap_inst; - cap_inst = cap_inst->CAPnextInstance) { + cap_inst = CAPnextInstance(cap_inst)) { if((cmeter_node == cap_inst->CAPposNode) || (cmeter_node == cap_inst->CAPnegNode)) { c += cap_inst->CAPcapac; @@ -136,10 +136,10 @@ double cm_netlist_get_c(void) /* Scan through all voltage source instances and add in values */ /* of any capacitors connected to cmeter input through voltage source */ - for(vsrc_model = vsrc_head; vsrc_model; vsrc_model = vsrc_model->VSRCnextModel) { - for(vsrc_inst = vsrc_model->VSRCinstances; + for(vsrc_model = vsrc_head; vsrc_model; vsrc_model = VSRCnextModel(vsrc_model)) { + for(vsrc_inst = VSRCinstances(vsrc_model); vsrc_inst; - vsrc_inst = vsrc_inst->VSRCnextInstance) { + vsrc_inst = VSRCnextInstance(vsrc_inst)) { /* Skip to next if not DC source with value = 0.0 */ if((vsrc_inst->VSRCfunctionType != 0) || @@ -160,10 +160,10 @@ double cm_netlist_get_c(void) /* Scan through all capacitor instances and add in values */ /* of any capacitors connected to the voltage source node */ - for(cap_model = cap_head; cap_model; cap_model = cap_model->CAPnextModel) { - for(cap_inst = cap_model->CAPinstances; + for(cap_model = cap_head; cap_model; cap_model = CAPnextModel(cap_model)) { + for(cap_inst = CAPinstances(cap_model); cap_inst; - cap_inst = cap_inst->CAPnextInstance) { + cap_inst = CAPnextInstance(cap_inst)) { if((vsrc_node == cap_inst->CAPposNode) || (vsrc_node == cap_inst->CAPnegNode)) { c += cap_inst->CAPcapac; @@ -240,10 +240,10 @@ double cm_netlist_get_l(void) /* Scan through all inductor instances and add in values */ /* of any inductors connected to lmeter input */ - for(ind_model = ind_head; ind_model; ind_model = ind_model->INDnextModel) { - for(ind_inst = ind_model->INDinstances; + for(ind_model = ind_head; ind_model; ind_model = INDnextModel(ind_model)) { + for(ind_inst = INDinstances(ind_model); ind_inst; - ind_inst = ind_inst->INDnextInstance) { + ind_inst = INDnextInstance(ind_inst)) { if((lmeter_node == ind_inst->INDposNode) || (lmeter_node == ind_inst->INDnegNode)) { l = 1.0 / ( (1.0 / l) + (1.0 / ind_inst->INDinduct) ); @@ -267,10 +267,10 @@ double cm_netlist_get_l(void) /* Scan through all voltage source instances and add in values */ /* of any inductors connected to lmeter input through voltage source */ - for(vsrc_model = vsrc_head; vsrc_model; vsrc_model = vsrc_model->VSRCnextModel) { - for(vsrc_inst = vsrc_model->VSRCinstances; + for(vsrc_model = vsrc_head; vsrc_model; vsrc_model = VSRCnextModel(vsrc_model)) { + for(vsrc_inst = VSRCinstances(vsrc_model); vsrc_inst; - vsrc_inst = vsrc_inst->VSRCnextInstance) { + vsrc_inst = VSRCnextInstance(vsrc_inst)) { /* Skip to next if not DC source with value = 0.0 */ if((vsrc_inst->VSRCfunctionType != 0) || @@ -291,10 +291,10 @@ double cm_netlist_get_l(void) /* Scan through all inductor instances and add in values */ /* of any inductors connected to the voltage source node */ - for(ind_model = ind_head; ind_model; ind_model = ind_model->INDnextModel) { - for(ind_inst = ind_model->INDinstances; + for(ind_model = ind_head; ind_model; ind_model = INDnextModel(ind_model)) { + for(ind_inst = INDinstances(ind_model); ind_inst; - ind_inst = ind_inst->INDnextInstance) { + ind_inst = INDnextInstance(ind_inst)) { if((vsrc_node == ind_inst->INDposNode) || (vsrc_node == ind_inst->INDnegNode)) { l = 1.0 / ( (1.0 / l) + (1.0 / ind_inst->INDinduct) ); diff --git a/src/xspice/evt/evtload.c b/src/xspice/evt/evtload.c index b48b229a9..64b7d85e6 100644 --- a/src/xspice/evt/evtload.c +++ b/src/xspice/evt/evtload.c @@ -232,7 +232,7 @@ int EVTload( /* Call the code model */ /* ******************* */ - mod_type = inst->MIFmodPtr->MIFmodType; + mod_type = MIFmodPtr(inst)->MIFmodType; DEVices[mod_type]->DEVpublic.cm_func (&cm_data); diff --git a/src/xspice/mif/mifask.c b/src/xspice/mif/mifask.c index 21dfb400b..f91c63b7b 100644 --- a/src/xspice/mif/mifask.c +++ b/src/xspice/mif/mifask.c @@ -92,7 +92,7 @@ int MIFask( inst = (MIFinstance *) inInst; /* Arrange for access to MIF specific data in the model */ - model = inst->MIFmodPtr; + model = MIFmodPtr(inst); /* Get model type */ diff --git a/src/xspice/mif/mifconvt.c b/src/xspice/mif/mifconvt.c index 3077d83af..2f9e02083 100644 --- a/src/xspice/mif/mifconvt.c +++ b/src/xspice/mif/mifconvt.c @@ -104,10 +104,10 @@ int MIFconvTest( model = (MIFmodel *) inModel; /* loop through all models of this type */ - for( ; model != NULL; model = model->MIFnextModel) { + for( ; model != NULL; model = MIFnextModel(model)) { /* Loop through all instances of this model */ - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { /* Loop through all items registered for convergence */ for(i = 0; i < here->num_conv; i++) { diff --git a/src/xspice/mif/mifdelete.c b/src/xspice/mif/mifdelete.c index 890672fae..515c7efad 100644 --- a/src/xspice/mif/mifdelete.c +++ b/src/xspice/mif/mifdelete.c @@ -159,7 +159,7 @@ MIFdelete(GENinstance *gen_inst) FIXME Finally one has to free the memory in the same module where allocated. */ #if defined(_MSC_VER) || defined(__MINGW32__) - if (!DEVices[here->MIFmodPtr->MIFmodType]->DEVpublic.inst_var[i].is_array) + if (!DEVices[MIFmodPtr(here)->MIFmodType]->DEVpublic.inst_var[i].is_array) #endif FREE(here->inst_var[i]->element); } diff --git a/src/xspice/mif/mifload.c b/src/xspice/mif/mifload.c index 3ceebe0d9..febc67342 100644 --- a/src/xspice/mif/mifload.c +++ b/src/xspice/mif/mifload.c @@ -219,7 +219,7 @@ MIFload( /* ***************************************************************** */ /* loop through all models of this type */ /* ***************************************************************** */ - for( ; model != NULL; model = model->MIFnextModel) { + for( ; model != NULL; model = MIFnextModel(model)) { /* If not an analog or hybrid model, continue to next */ if(! model->analog) @@ -228,7 +228,7 @@ MIFload( /* ***************************************************************** */ /* loop through all instances of this model */ /* ***************************************************************** */ - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { /* If not an analog or hybrid instance, continue to next */ if(! here->analog) continue; diff --git a/src/xspice/mif/mifsetup.c b/src/xspice/mif/mifsetup.c index 4a943f220..d1be070f5 100644 --- a/src/xspice/mif/mifsetup.c +++ b/src/xspice/mif/mifsetup.c @@ -134,7 +134,7 @@ MIFsetup( /* loop through all models of this type */ - for( ; model != NULL; model = model->MIFnextModel) { + for( ; model != NULL; model = MIFnextModel(model)) { /* For each parameter not given explicitly on the .model */ @@ -157,7 +157,7 @@ MIFsetup( /* Since several instances may share this model, we have to create an array */ /* big enough for the instance with the biggest connection array */ max_size = 0; - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { size = here->conn[param_info->conn_ref]->size; if(size > max_size) max_size = size; @@ -204,7 +204,7 @@ MIFsetup( /* For each instance, initialize stuff used by cm_... functions */ - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { here->num_state = 0; here->state = NULL; @@ -220,7 +220,7 @@ MIFsetup( /* For each instance, allocate runtime structs for output connections/ports */ /* and grab a place in the state vector for all input connections/ports */ - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { /* Skip these expensive allocations if the instance is not analog */ if(! here->analog) continue; @@ -267,7 +267,7 @@ MIFsetup( /* Loop through all instances of this model and for each port of each connection */ /* create current equations, matrix entries, and matrix pointers as necessary. */ - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { /* Skip these expensive allocations if the instance is not analog */ if(! here->analog) continue; @@ -455,9 +455,9 @@ MIFunsetup(GENmodel *inModel,CKTcircuit *ckt) for (model = (MIFmodel *)inModel; model != NULL; - model = model->MIFnextModel) + model = MIFnextModel(model)) { - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { /* Skip these expensive allocations if the instance is not analog */ if(! here->analog) continue; diff --git a/src/xspice/mif/miftrunc.c b/src/xspice/mif/miftrunc.c index 99ed55379..c843a35d6 100644 --- a/src/xspice/mif/miftrunc.c +++ b/src/xspice/mif/miftrunc.c @@ -92,10 +92,10 @@ MIFtrunc( /* loop through all models of this type */ - for( ; model != NULL; model = model->MIFnextModel) { + for( ; model != NULL; model = MIFnextModel(model)) { /* Loop through all instances of this model */ - for(here = model->MIFinstances; here != NULL; here = here->MIFnextInstance) { + for(here = MIFinstances(model); here != NULL; here = MIFnextInstance(here)) { /* Loop through all integration states on the instance */ for(i = 0; i < here->num_intgr; i++) {