Re: Verilog-A(MS) & gnucap
Leandro Marsó <[email protected]> Thu, 27 Jan 2011 19:25:13 -0300
| Newsgroups | gmane.comp.gnu.gnucap.general |
|---|---|
| Message-ID | <[email protected]> |
2010/10/26 <[email protected]>: > Hello Andrey, > > plese - take a look at > http://git.gnucapplus.org/gitweb/ > > 1) gnucap-mot-adms.git > http://git.gnucapplus.org/gitweb/?p=gnucap-mot-adms.git;a=summary > > This is port of NGSpice mot-adms (made by Laurent Lemaitre) to gnucap > > gnucap can use (-a switch, .attach .load commands) plugins, including > models and can understand Spice, BSIM and NGspice models. This tool > uses NGspice interface and allows to compile Verilog-A models into C > code, which then shall be compiled into *.so and then attached and > used in gnucap. Hi Genna and all, regarding the gnucap-mot-adms model compilator, I'm trying to compile (following the model_add.howto) this simple model: `define P(txt) (*txt*) `include "discipline.h" `include "constants.h" module vamp (in, out) ; input in ; output out ; voltage out , in ; parameter real GAIN_V=10.0 from [0:inf] ; `P(info="Gain (times)"); analog begin begin V(out) <+ GAIN_V * V(in) ; end end //analog endmodule // But found this error at the point of doing make -f Makefile.gnucap: vampguesstopology.c: In function 'vampguesstopology': vampguesstopology.c:37: error: 'vampinstance' has no member named 'PTR_J_out_in_required' make: *** [vampguesstopology.o] Error 1 Seems like something is missing other than adding/modifing the wraper.h and the gnspiceVersion.xml. Just in case, I attach the modifications I did on them at the end of the mail. I wonder if adms is intended to do what I am trying to do, instead of device types (like transistors, resistors, sources, etc), because I don't know which device type letter should I choose for an amplifier, or any other circuit. Ok, sorry for the long mail, thank you. Regards, Leandro. <!-- This is what I added to ngspiceVersion.xml --> <admst:when test="[name='vamp']"> <admst:if test="[nilled(variable[name='I'])]"> <admst:value-of select="analog"/> <admst:value-of select="."/> <admst:new datatype="variable" arguments="%p,I,%p"> <admst:push into="module/variable" select="." onduplicate="ignore"/> <admst:value-to select="sizetype" value="scalar"/> <admst:value-to select="type" value="integer"/> <admst:value-to select="input" value="yes"/> <admst:value-to select="output" value="yes"/> <admst:value-to select="parametertype" value="model"/> <admst:value-to select="scope" value="global_model"/> <admst:new datatype="number" arguments="1"> <admst:value-to select="scalingunit" value="1"/> <admst:value-of select="."/> <admst:value-of select="../module"/> <admst:new datatype="expression" arguments="%p,%p"> <admst:value-of select="."/> <admst:value-to select="../../default" value="%p"/> </admst:new> </admst:new> </admst:new> </admst:if> </admst:when> /* This is the wrap.h file I modified for my vam.va */ extern "C" { #include "vampdefs.h" } #define info vampinfo #define INSTANCE vampinstance #define MODEL vampmodel #define SPICE_LETTER "I" #define DEVICE_TYPE "ngspice_vamp" #define MIN_NET_NODES 2 #define MAX_NET_NODES 2 #define INTERNAL_NODES 0 #define MODEL_TYPE "Ivamp|I" #define UNCONNECTED_NODES uGROUND static std::string port_names[] = {"in", "out"}; static std::string state_names[] = {};