help-gnucap
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [Help-gnucap] Verilog-A(MS) & gnucap


From: gserdyuk
Subject: Re[2]: [Help-gnucap] Verilog-A(MS) & gnucap
Date: Wed, 9 Feb 2011 16:56:35 +0200

Hello Leandro,


from what I saw in available sources, likely "input" and "output" are not
implemented.

What I saw - you can use "inout" and define nodes, not ports.

so - pls try:

 module vamp (in, out) ;
 inout in, out ;
 electrical in, out ;

...
 V(out) <+ GAIN_V * V(in) ;
...

regards
Gena


Friday, January 28, 2011, 12:25:13 AM, you wrote:

LM> 2010/10/26  <address@hidden>:
>> 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.
LM> Hi Genna and all,
LM> regarding the gnucap-mot-adms model compilator, I'm trying to compile
LM> (following the model_add.howto) this simple model:

LM> `define P(txt) (*txt*)
LM> `include "discipline.h"
LM> `include "constants.h"

LM> module vamp (in, out) ;
LM> input in ;
LM> output out ;
LM> voltage out , in ;
LM> parameter real GAIN_V=10.0 from [0:inf] ;
LM>                 `P(info="Gain (times)");
LM> analog begin
LM> begin
LM> V(out) <+ GAIN_V * V(in) ;
LM> end
LM> end //analog
LM> endmodule

LM> //
LM> But found this error at the point of doing make -f Makefile.gnucap:

LM> vampguesstopology.c: In function 'vampguesstopology':
LM> vampguesstopology.c:37: error: 'vampinstance' has no member named
LM> 'PTR_J_out_in_required'
LM> make: *** [vampguesstopology.o] Error 1

LM> Seems like something is missing other than adding/modifing the
LM> wraper.h and the gnspiceVersion.xml. Just in case, I attach the
LM> modifications I did on them at the end of the mail. I wonder if adms
LM> is intended to do what I am trying to do, instead of device types
LM> (like transistors, resistors, sources, etc), because I don't know
LM> which  device type letter should I choose for an amplifier, or any
LM> other circuit.

LM> Ok, sorry for the long mail, thank you.
LM> Regards,
LM> Leandro.


LM> <!-- This is what I added to ngspiceVersion.xml -->

LM>      <admst:when test="[name='vamp']">
LM>         <admst:if test="[nilled(variable[name='I'])]">
LM>           <admst:value-of select="analog"/>
LM>           <admst:value-of select="."/>
LM>           <admst:new datatype="variable" arguments="%p,I,%p">
LM>             <admst:push into="module/variable" select="." 
onduplicate="ignore"/>
LM>             <admst:value-to select="sizetype" value="scalar"/>
LM>             <admst:value-to select="type" value="integer"/>
LM>             <admst:value-to select="input" value="yes"/>
LM>             <admst:value-to select="output" value="yes"/>
LM>             <admst:value-to select="parametertype" value="model"/>
LM>             <admst:value-to select="scope" value="global_model"/>
LM>             <admst:new datatype="number" arguments="1">
LM>               <admst:value-to select="scalingunit" value="1"/>
LM>               <admst:value-of select="."/>
LM>               <admst:value-of select="../module"/>
LM>               <admst:new datatype="expression" arguments="%p,%p">
LM>                 <admst:value-of select="."/>
LM>                 <admst:value-to select="../../default" value="%p"/>
LM>               </admst:new>
LM>             </admst:new>
LM>           </admst:new>
LM>         </admst:if>
LM>       </admst:when>



LM> /* This is the wrap.h file I modified for my vam.va
LM> */
LM>     extern "C" {
LM>   #include "vampdefs.h"
LM> }

LM> #define info     vampinfo
LM> #define INSTANCE vampinstance
LM> #define MODEL    vampmodel

LM> #define SPICE_LETTER "I"
LM> #define DEVICE_TYPE "ngspice_vamp"
LM> #define MIN_NET_NODES 2
LM> #define MAX_NET_NODES 2
LM> #define INTERNAL_NODES 0
LM> #define MODEL_TYPE "Ivamp|I"
LM> #define UNCONNECTED_NODES uGROUND

LM> static std::string port_names[] = {"in", "out"};
LM> static std::string state_names[] = {};

LM> _______________________________________________
LM> Help-gnucap mailing list
LM> address@hidden
LM> http://lists.gnu.org/mailman/listinfo/help-gnucap



-- 
Best regards,
 Gserdyuk                            mailto:address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]