VLSI SAPD Documentation

Presentation AGDS CIF DTR OPENCHAMS SPICE Links & Contact


SPICE Format

Presentation

The Spice format was developped at the University of California, Berkeley. This parser/driver consists in a subset of SPICE3 netlist format. (see http://en.wikipedia.org/wiki/SPICE for more informations).

Author

Damien Dupuis: damien.dupuis(at)lip6(.)fr

Stand alone database structure

The database consists in several objects:

Using the parser

Simply load an Spice netlist file using the static function SPICE::Circuit::readFromFile().

Using the driver

Using the driver is very simple, user has to create a SPICE::Circuit object and simply add others Spice objects like SPICE::Subckt or SPICE::Instance to it. Includes, libraries and parameters can also be added to SPICE::Circuit. Finally use the SPICE::Circuit::writeToFile() method to dump the database to file.

Examples

As said is the global presentation, VLSI SAPD project provides C++ libraries and Python modules for each supported format. In this section we present simple code examples to parse and drive a SPICE file using C++ or Python. The SPICE file considered describes a simple Miller OTA: OTA_miller.spi

* Single-ended two-stage amplifier
.PARAM CC_VALUE=2.8794pF
.PARAM L_VALUE=0.340e-6
.SUBCKT currentMirrorPMOS d1 d2 s1 s2 param: l_val=0.0 w_val=0.0 nf_val=1 aeq_val=100e-6 temp_val=27
MP3 d1 d1 s1 s1 psvt l=l_val wf={w_val/nf_val} nf=nf_val aeq=aeq_val tempsimu=temp_val
MP4 d2 d1 s2 s2 psvt l=l_val wf={w_val/nf_val} nf=nf_val aeq=aeq_val tempsimu=temp_val
.ENDS currentMirrorPMOS
.SUBCKT diffPairNMOS d1 d2 g1 g2 s b param: l_val=0.0 w_val=0.0 nf_val=1 aeq_val=100e-6 temp_val=27
MN1 d1 g1 s b nsvt l=l_val wf={w_val/nf_val} nf=nf_val aeq=aeq_val tempsimu=temp_val
MN2 d2 g2 s b nsvt l=l_val wf={w_val/nf_val} nf=nf_val aeq=aeq_val tempsimu=temp_val
.ENDS diffPairNMOS
XCM 1 2 vdd vdd currentMirrorPMOS l_val=L_VALUE w_val=3.889618e-06 nf_val=2
XDP 1 2 vim vip 3 vss diffPairNMOS l_val=L_VALUE w_val=7.683346e-07 nf_val=4
MP6 vout 2 vdd vdd psvt l_val=L_VALUE w_val=3.558995e-05 nf_val=20
MN5 3 4 vss vss nsvt l_val=L_VALUE w_val=2.536703e-06 nf_val=4
MN7 vout 4 vss vss nsvt l_val=L_VALUE w_val=1.069083e-05 nf_val=16
MN8 4 4 vss vss nsvt l_val=L_VALUE w_val=2.536703e-06 nf_val=4
CC1 vout 2 CC_VALUE
.END

All source codes are available in the examples directory.

C++

Parser

The following code (parseSpice.cpp) is an example of how to parse a SPICE file using C++ library.

#include <cstdlib>
#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;
#include "vlsisapd/spice/Circuit.h"
#include "vlsisapd/spice/SpiceException.h"
#include "vlsisapd/spice/Sources.h"
#include "vlsisapd/spice/Subckt.h"
#include "vlsisapd/spice/Instances.h"
int main(int argc, char * argv[]) {
string file = "";
if (argc == 1)
file = "./OTA.cir";
else if (argc == 2)
file = argv[1];
else {
cerr << "Usage: parseSpice [filename]" << endl;
exit(1);
}
SPICE::Circuit* circuit = NULL;
try {
circuit = SPICE::Circuit::readFromFile(file);
} catch (SPICE::SpiceException& e) {
cerr << e.what() << endl;
exit(48);
}
// if (!circuit) cerr << "circuit is NULL !!" << endl;
// TITLE
cerr << "+ " << circuit->getTitle() << endl;
// INCLUDES
vector<string> includes = circuit->getIncludes();
if (includes.size()) {
cerr << "| + includes" << endl;
for (size_t i = 0 ; i < includes.size() ; i++)
cerr << "| | " << includes[i] << endl;
}
// LIBRARIES
vector<pair<string, string> > libs = circuit->getLibraries();
if (libs.size()) {
cerr << "| + libraries" << endl;
for (size_t i = 0 ; i < libs.size() ; i++)
cerr << "| | " << libs[i].first << " " << libs[i].second << endl;
}
// PARAMETERS
map<string, string> params = circuit->getParameters();
if (params.size()) {
cerr << "| + parameters" << endl;
for (map<string, string>::const_iterator it = params.begin() ; it != params.end() ; ++it)
cerr << "| | " << (*it).first << " = " << (*it).second << endl;
}
// OPTIONS
map<string, string> opts = circuit->getOptions();
if (opts.size()) {
cerr << "| + options" << endl;
for (map<string, string>::const_iterator it = opts.begin() ; it != opts.end() ; ++it)
cerr << "| | " << (*it).first << " = " << (*it).second << endl;
}
// SOURCES
vector<SPICE::Source*> sources = circuit->getSources();
if (sources.size()) {
cerr << "| + sources" << endl;
for (size_t i = 0 ; i < sources.size() ; i++) {
SPICE::Source* s = sources[i];
cerr << "| | " << s->getName() << " " << s->getPositive() << " " << s->getNegative() << " " << s->getValue() << endl;
}
}
// SUBCKTS
vector<SPICE::Subckt*> subs = circuit->getSubckts();
if (subs.size()) {
cerr << "| + subckts" << endl;
for (size_t i = 0 ; i < subs.size() ; i++) {
SPICE::Subckt* sub = subs[i];
cerr << "| | + " << sub->getName();
for (size_t j = 0 ; j < sub->getInterfaces().size() ; j++)
cerr << " " << sub->getInterfaces()[j];
if (sub->getParameters().size()) {
cerr << " param:";
for (map<string, string>::const_iterator it = sub->getParameters().begin() ; it != sub->getParameters().end() ; ++it)
cerr << " " << (*it).first << "=" << (*it).second;
}
cerr << endl;
for (size_t j = 0 ; j < sub->getInstances().size() ; j++) {
SPICE::Instance* inst = sub->getInstances()[j];
cerr << "| | | + " << inst->getName();
if (dynamic_cast<SPICE::Mosfet*>(inst)) {
SPICE::Mosfet* mos = static_cast<SPICE::Mosfet*>(inst);
cerr << " " << mos->getDrain() << " " << mos->getGrid() << " " << mos->getSource() << " " << mos->getBulk() << " " << mos->getModel();
int k = 0;
for (map<string, string>::const_iterator it =mos->getParameters().begin() ; it != mos->getParameters().end(); ++it, k++) {
if (k%6 == 0)
cerr << endl << "| | | | +";
cerr << " " << (*it).first << "=" << (*it).second;
}
} else if (dynamic_cast<SPICE::Resistor*>(inst)) {
SPICE::Resistor* res = static_cast<SPICE::Resistor*>(inst);
cerr << " " << res->getFirst() << " " << res->getSecond() << " " << res->getValue();
} else if (dynamic_cast<SPICE::Capacitor*>(inst)) {
SPICE::Capacitor* capa = static_cast<SPICE::Capacitor*>(inst);
cerr << " " << capa->getPositive() << " " << capa->getNegative() << " " << capa->getValue();
} else {
for (size_t k = 0 ; k < inst->getConnectors().size() ; k++)
cerr << " " << inst->getConnectors()[k];
cerr << " " << inst->getModel();
int l = 0;
for (map<string, string>::const_iterator it = inst->getParameters().begin() ; it != inst->getParameters().end() ; ++it, l++) {
if (l%6 == 0)
cerr << endl << "| | | | +";
cerr << " " << (*it).first << "=" << (*it).second;
}
}
cerr << endl;
}
}
}
// INSTANCES
vector<SPICE::Instance*> insts = circuit->getInstances();
if (insts.size()) {
cerr << "| + instances" << endl;
for (size_t i = 0 ; i < insts.size() ; i++) {
SPICE::Instance* inst = insts[i];
cerr << "| | + " << inst->getName();
if (dynamic_cast<SPICE::Mosfet*>(inst)) {
SPICE::Mosfet* mos = static_cast<SPICE::Mosfet*>(inst);
cerr << " " << mos->getDrain() << " " << mos->getGrid() << " " << mos->getSource() << " " << mos->getBulk() << " " << mos->getModel();
int j = 0;
for (map<string, string>::const_iterator it =mos->getParameters().begin() ; it != mos->getParameters().end(); ++it, j++) {
if (j%6 == 0)
cerr << endl << "| | | | +";
cerr << " " << (*it).first << "=" << (*it).second;
}
} else if (dynamic_cast<SPICE::Resistor*>(inst)) {
SPICE::Resistor* res = static_cast<SPICE::Resistor*>(inst);
cerr << " " << res->getFirst() << " " << res->getSecond() << " " << res->getValue();
} else if (dynamic_cast<SPICE::Capacitor*>(inst)) {
SPICE::Capacitor* capa = static_cast<SPICE::Capacitor*>(inst);
cerr << " " << capa->getPositive() << " " << capa->getNegative() << " " << capa->getValue();
} else {
for (size_t k = 0 ; k < inst->getConnectors().size() ; k++)
cerr << " " << inst->getConnectors()[k];
cerr << " " << inst->getModel();
int l = 0;
for (map<string, string>::const_iterator it = inst->getParameters().begin() ; it != inst->getParameters().end() ; ++it, l++) {
if (l%6 == 0)
cerr << endl << "| | | +";
cerr << " " << (*it).first << "=" << (*it).second;
}
}
cerr << endl;
}
}
return 0;
}

Driver

This C++ code (driveSpice.cpp) generates an myOTA.spi file equivalent to the included one.

#include <string>
using namespace std;
#include "vlsisapd/spice/Circuit.h"
#include "vlsisapd/spice/Subckt.h"
#include "vlsisapd/spice/Instances.h"
int main(int argc, char * argv[]) {
SPICE::Circuit* circuit = new SPICE::Circuit();
circuit->setTitle("* Single-ended two-stage amplifier");
// PARAMS
circuit->addParameter("CC_VALUE", "2.8794pF");
circuit->addParameter("L_VALUE" , "0.340e-6");
// SUBCKTS
// CurrentMirror
SPICE::Subckt* CM = circuit->addSubckt("currentMirrorPMOS");
CM->addInterface("d1");
CM->addInterface("d2");
CM->addInterface("s1");
CM->addInterface("s2");
CM->addParameter("l_val" , "0.0" );
CM->addParameter("w_val" , "0.0" );
CM->addParameter("nf_val" , "1" );
CM->addParameter("aeq_val" , "100e-6");
CM->addParameter("temp_val", "27" );
SPICE::Instance* cmP3 = new SPICE::Mosfet("P3", "d1", "d1", "s1", "s1", "psvt");
cmP3->addParameter("l" , "l_val" );
cmP3->addParameter("wf" , "{w_val/nf_val}");
cmP3->addParameter("nf" , "nf_val" );
cmP3->addParameter("aeq" , "aeq_val" );
cmP3->addParameter("tempsimu", "temp_val" );
CM->addInstance(cmP3);
SPICE::Instance* cmP4 = new SPICE::Mosfet("P4", "d2", "d1", "s2", "s2", "psvt");
cmP4->addParameter("l" , "l_val" );
cmP4->addParameter("wf" , "{w_val/nf_val}");
cmP4->addParameter("nf" , "nf_val" );
cmP4->addParameter("aeq" , "aeq_val" );
cmP4->addParameter("tempsimu", "temp_val" );
CM->addInstance(cmP4);
// DifferentialPair
SPICE::Subckt* DP = circuit->addSubckt("diffPairNMOS");
DP->addInterface("d1");
DP->addInterface("d2");
DP->addInterface("g1");
DP->addInterface("g2");
DP->addInterface("s");
DP->addInterface("b");
DP->addParameter("l_val" , "0.0" );
DP->addParameter("w_val" , "0.0" );
DP->addParameter("nf_val" , "1" );
DP->addParameter("aeq_val" , "100e-6");
DP->addParameter("temp_val", "27" );
SPICE::Instance* dpN1 = new SPICE::Mosfet("N1", "d1", "g1", "s", "b", "nsvt");
dpN1->addParameter("l" , "l_val" );
dpN1->addParameter("wf" , "{w_val/nf_val}");
dpN1->addParameter("nf" , "nf_val" );
dpN1->addParameter("aeq" , "aeq_val" );
dpN1->addParameter("tempsimu", "temp_val" );
DP->addInstance(dpN1);
SPICE::Instance* dpN2 = new SPICE::Mosfet("N2", "d2", "g2", "s", "b", "nsvt");
dpN2->addParameter("l" , "l_val" );
dpN2->addParameter("wf" , "{w_val/nf_val}");
dpN2->addParameter("nf" , "nf_val" );
dpN2->addParameter("aeq" , "aeq_val" );
dpN2->addParameter("tempsimu", "temp_val" );
DP->addInstance(dpN2);
//INSTANCES
SPICE::Instance* iCM = new SPICE::Instance("CM", "currentMirrorPMOS");
iCM->addConnector("1");
iCM->addConnector("2");
iCM->addConnector("vdd");
iCM->addConnector("vdd");
iCM->addParameter("l_val" , "L_VALUE" );
iCM->addParameter("w_val" , "3.889618e-06");
iCM->addParameter("nf_val", "2" );
circuit->addInstance(iCM);
SPICE::Instance* iDP = new SPICE::Instance("DP", "diffPairNMOS");
iDP->addConnector("1");
iDP->addConnector("2");
iDP->addConnector("vim");
iDP->addConnector("vip");
iDP->addConnector("3");
iDP->addConnector("vss");
iDP->addParameter("l_val" , "L_VALUE" );
iDP->addParameter("w_val" , "7.683346e-07");
iDP->addParameter("nf_val", "4" );
circuit->addInstance(iDP);
SPICE::Instance* iP6 = new SPICE::Mosfet("P6", "vout", "2", "vdd", "vdd", "psvt");
iP6->addParameter("l_val" , "L_VALUE" );
iP6->addParameter("w_val" , "3.558995e-05");
iP6->addParameter("nf_val", "20" );
circuit->addInstance(iP6);
SPICE::Instance* iN5 = new SPICE::Mosfet("N5", "3", "4", "vss", "vss", "nsvt");
iN5->addParameter("l_val" , "L_VALUE" );
iN5->addParameter("w_val" , "2.536703e-06");
iN5->addParameter("nf_val", "4" );
circuit->addInstance(iN5);
SPICE::Instance* iN7 = new SPICE::Mosfet("N7", "vout", "4", "vss", "vss", "nsvt");
iN7->addParameter("l_val" , "L_VALUE" );
iN7->addParameter("w_val" , "1.069083e-05");
iN7->addParameter("nf_val", "16" );
circuit->addInstance(iN7);
SPICE::Instance* iN8 = new SPICE::Mosfet("N8", "4", "4", "vss", "vss", "nsvt");
iN8->addParameter("l_val" , "L_VALUE" );
iN8->addParameter("w_val" , "2.536703e-06");
iN8->addParameter("nf_val", "4" );
circuit->addInstance(iN8);
circuit->addInstance(new SPICE::Capacitor("C1", "vout", "2", "CC_VALUE"));
circuit->writeToFile("./myOTA.spi");
return 0;
}
Note
In order to compile these codes, a CMakeLists.txt file is provided. User must set the $VLSISAPD_TOP variable before running these commands in the directory containing the CMakeLists.txt file:
%> mkdir build; cd build
%> cmake ..
%> make

Python

Parser

The following python script (parseSpice.py) is an example of how to parse a SPICE file using python module.

1 import sys
2 
3 from SPICE import *
4 
5 def printContents(circuit):
6  print "+", circuit.title
7 
8  if len(circuit.getIncludes()):
9  print "| + includes"
10  for include in circuit.getIncludes():
11  print "| |", include
12 
13  if len(circuit.getLibraries()):
14  print "| + libraries"
15  for (lib, typ) in circuit.getLibraries():
16  print "| |", lib, typ
17 
18  if len(circuit.getParameters()):
19  print "| + parameters"
20  for (name, value) in circuit.getParameters().items():
21  print "| | %s=%s"%(name, value)
22 
23  if len(circuit.getOptions()):
24  print "| + options"
25  for (name, value) in circuit.getOptions().items():
26  print "| | %s=%s"%(name, value)
27 
28  if len(circuit.getSources()):
29  print "| + sources"
30  for source in circuit.getSources():
31  print "| |", source.getName(), source.getPositive(), source.getNegative(), source.getValue()
32 
33  if len(circuit.getSubckts()):
34  print "| + subckts"
35  for sub in circuit.getSubckts():
36  print "| | +", sub.getName(),
37  for interf in sub.getInterfaces():
38  print interf,
39  if len(sub.getParameters()):
40  print "param:",
41  for (name, value) in sub.getParameters().items():
42  print "%s=%s"%(name,value),
43  print
44  for inst in sub.getInstances():
45  print "| | | +", inst.getName(),
46  if isinstance(inst, Mosfet):
47  print inst.getDrain(), inst.getGrid(), inst.getSource(), inst.getBulk(), inst.getModel(),
48  i = 0
49  for (name, value) in inst.getParameters().items():
50  if i%6 == 0:
51  print
52  print "| | | | +",
53  print "%s=%s"%(name, value),
54  i += 1
55  elif isinstance(inst, Resistor):
56  print inst.getFirst(), inst.getSecond(), inst.getValue(),
57  elif isinstance(inst, Capacitor):
58  print inst.getPositive(), inst.getNegative(), inst.getValue(),
59  else:
60  for conn in inst.getConnectors():
61  print conn,
62  print inst.getModel(),
63  i = 0
64  for (name, value) in inst.getParameters().items():
65  if i%6 == 0:
66  print
67  print "| | | | +",
68  print "%s=%s"%(name, value),
69  i += 1
70  print
71 
72  if len(circuit.getInstances()):
73  print "| + instances"
74  for inst in circuit.getInstances():
75  print "| | | +", inst.getName(),
76  if isinstance(inst, Mosfet):
77  print inst.getDrain(), inst.getGrid(), inst.getSource(), inst.getBulk(), inst.getModel(),
78  i = 0
79  for (name, value) in inst.getParameters().items():
80  if i%6 == 0:
81  print
82  print "| | | | +",
83  print "%s=%s"%(name, value),
84  i += 1
85  elif isinstance(inst, Resistor):
86  print inst.getFirst(), inst.getSecond(), inst.getValue(),
87  elif isinstance(inst, Capacitor):
88  print inst.getPositive(), inst.getNegative(), inst.getValue(),
89  else:
90  for conn in inst.getConnectors():
91  print conn,
92  print inst.getModel(),
93  i = 0
94  for (name, value) in inst.getParameters().items():
95  if i%6 == 0:
96  print
97  print "| | | | +",
98  print "%s=%s"%(name, value),
99  i += 1
100  print
101 
102 def usage():
103  print "usage:", sys.argv[0], "[filename]"
104  sys.exit(48)
105 
106 def main():
107  if len(sys.argv) == 1:
108  filename = "./OTA_miller.spi"
109  elif len(sys.argv) == 2:
110  filename = sys.argv[1]
111  else:
112  usage()
113 
114  circuit = Circuit.readFromFile(filename)
115  printContents(circuit)
116 
117 
118 if __name__ == "__main__":
119  main()
120 

Driver

This python script (driveSpice.py) generates an myOTA.spi file equivalent to the included one.

1 from SPICE import *
2 
3 circuit = Circuit()
4 
5 circuit.title = '* Single-ended two-stage amplifier'
6 
7 # PARAMS
8 circuit.addParameter("CC_VALUE", "2.8794pF");
9 circuit.addParameter("L_VALUE" , "0.340e-6");
10 
11 # SUBCKTS
12 # CurrentMirror
13 CM = circuit.addSubckt("currentMirrorPMOS");
14 CM.addInterface("d1");
15 CM.addInterface("d2");
16 CM.addInterface("s1");
17 CM.addInterface("s2");
18 CM.addParameter("l_val" , "0.0" );
19 CM.addParameter("w_val" , "0.0" );
20 CM.addParameter("nf_val" , "1" );
21 CM.addParameter("aeq_val" , "100e-6");
22 CM.addParameter("temp_val", "27" );
23 
24 cmP3 = Mosfet("P3", "d1", "d1", "s1", "s1", "psvt");
25 cmP3.addParameter("l" , "l_val" );
26 cmP3.addParameter("wf" , "{w_val/nf_val}");
27 cmP3.addParameter("nf" , "nf_val" );
28 cmP3.addParameter("aeq" , "aeq_val" );
29 cmP3.addParameter("tempsimu", "temp_val" );
30 CM.addInstance(cmP3);
31 
32 cmP4 = Mosfet("P4", "d2", "d1", "s2", "s2", "psvt");
33 cmP4.addParameter("l" , "l_val" );
34 cmP4.addParameter("wf" , "{w_val/nf_val}");
35 cmP4.addParameter("nf" , "nf_val" );
36 cmP4.addParameter("aeq" , "aeq_val" );
37 cmP4.addParameter("tempsimu", "temp_val" );
38 CM.addInstance(cmP4);
39 
40 # DifferentialPair
41 DP = circuit.addSubckt("diffPairNMOS");
42 DP.addInterface("d1");
43 DP.addInterface("d2");
44 DP.addInterface("g1");
45 DP.addInterface("g2");
46 DP.addInterface("s");
47 DP.addInterface("b");
48 DP.addParameter("l_val" , "0.0" );
49 DP.addParameter("w_val" , "0.0" );
50 DP.addParameter("nf_val" , "1" );
51 DP.addParameter("aeq_val" , "100e-6");
52 DP.addParameter("temp_val", "27" );
53 
54 dpN1 = Mosfet("N1", "d1", "g1", "s", "b", "nsvt");
55 dpN1.addParameter("l" , "l_val" );
56 dpN1.addParameter("wf" , "{w_val/nf_val}");
57 dpN1.addParameter("nf" , "nf_val" );
58 dpN1.addParameter("aeq" , "aeq_val" );
59 dpN1.addParameter("tempsimu", "temp_val" );
60 DP.addInstance(dpN1);
61 
62 dpN2 = Mosfet("N2", "d2", "g2", "s", "b", "nsvt");
63 dpN2.addParameter("l" , "l_val" );
64 dpN2.addParameter("wf" , "{w_val/nf_val}");
65 dpN2.addParameter("nf" , "nf_val" );
66 dpN2.addParameter("aeq" , "aeq_val" );
67 dpN2.addParameter("tempsimu", "temp_val" );
68 DP.addInstance(dpN2);
69 
70 # INSTANCES
71 iCM = Instance("CM", "currentMirrorPMOS");
72 iCM.addConnector("1");
73 iCM.addConnector("2");
74 iCM.addConnector("vdd");
75 iCM.addConnector("vdd");
76 iCM.addParameter("l_val" , "L_VALUE" );
77 iCM.addParameter("w_val" , "3.889618e-06");
78 iCM.addParameter("nf_val", "2" );
79 circuit.addInstance(iCM);
80 
81 iDP = Instance("DP", "diffPairNMOS");
82 iDP.addConnector("1");
83 iDP.addConnector("2");
84 iDP.addConnector("vim");
85 iDP.addConnector("vip");
86 iDP.addConnector("3");
87 iDP.addConnector("vss");
88 iDP.addParameter("l_val" , "L_VALUE" );
89 iDP.addParameter("w_val" , "7.683346e-07");
90 iDP.addParameter("nf_val", "4" );
91 circuit.addInstance(iDP);
92 
93 iP6 = Mosfet("P6", "vout", "2", "vdd", "vdd", "psvt");
94 iP6.addParameter("l_val" , "L_VALUE" );
95 iP6.addParameter("w_val" , "3.558995e-05");
96 iP6.addParameter("nf_val", "20" );
97 circuit.addInstance(iP6);
98 
99 iN5 = Mosfet("N5", "3", "4", "vss", "vss", "nsvt");
100 iN5.addParameter("l_val" , "L_VALUE" );
101 iN5.addParameter("w_val" , "2.536703e-06");
102 iN5.addParameter("nf_val", "4" );
103 circuit.addInstance(iN5);
104 
105 iN7 = Mosfet("N7", "vout", "4", "vss", "vss", "nsvt");
106 iN7.addParameter("l_val" , "L_VALUE" );
107 iN7.addParameter("w_val" , "1.069083e-05");
108 iN7.addParameter("nf_val", "16" );
109 circuit.addInstance(iN7);
110 
111 iN8 = Mosfet("N8", "4", "4", "vss", "vss", "nsvt");
112 iN8.addParameter("l_val" , "L_VALUE" );
113 iN8.addParameter("w_val" , "2.536703e-06");
114 iN8.addParameter("nf_val", "4" );
115 circuit.addInstance(iN8);
116 
117 capa = Capacitor("C1", "vout", "2", "CC_VALUE")
118 circuit.addInstance(capa);
119 
120 circuit.writeToFile("./myOTA.spi");
Note
In order to run these two scripts (parseSpice.py & driveSpice.py), user must ensure that $PYTHONPATH variable points to the directory containing SPICE.so module.


Generated by doxygen 1.8.5 on Sat Aug 18 2018 Return to top of page
VLSI SAPD Documentation Copyright © 2010 - 2011 UPMC All rights reserved