[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Try to add component



Just to expand on my answer a little bit...

The way the netlister works is this:

The top level does a bunch of preparation, like writing header info,
etc.  Then it calls spice-sdb:write-netlist, where the real action
occurs.

write-netlist runs through the list of components it has found.  The
list is a list of refdeses.  For each refdes, it tries to get the
"device" attribute of the component.  If it finds the device
attribute, and recognizes it, it calls the appropriate processing
function which writes out the correct line of SPICE code (i.e. SPICE
card).

If write-netlist doesn't find a "device" attribute it recognizes, then
it calls write-default-component.  This function makes a guess as to
what the component is, based upon the refdes.  That is, if the refdes
is D, then it assumes the component is a diode.  If the refdes is R,
it assumes you have a resistor.  Based upon this guess, it calls the
appropriate function which writes out the SPICE card.

In your case, you did not have a "device" attribute on your component,
and the write-default-component function did not recognize your A
refdes.  Therefore, it just exited with an error.

Therefore, add some code to write-netlist to recognize your "device"
option, and everything will be good.

Stuart




On Wed, 17 Jun 2009, Stuart Brorson wrote:

> You need to add two lines of code in the dispatcher which recognizes
> your new device (called library), and calls the appropriate function.
> That is, in spice-sdb:write-netlist add two lines like:
>
>           ( (string=? device "library")
>               (spice-sdb:write-library package port))
>
> HTH,
>
> Stuart
>
>
>
>
> On Wed, 17 Jun 2009, A.Burinskiy wrote:
>
>> Hi, I'm trying to make library include symbol, somewhat similar to
>> spice-include-1.sym. I created symbol:
>>
>> v 20090328 2
>> B 0 400 1900 300 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
>> T 100 300 9 10 0 1 0 0 1
>> device=library
>> T 100 500 9 10 1 1 0 0 1
>> refdes=A?
>> T 600 500 9 10 1 0 0 0 1
>> SPICE LIBR
>> T 500 200 8 10 1 1 0 0 1
>> file=?
>> T 100 200 9 10 1 0 0 0 1
>> File:
>> T 0 -5 8 10 1 0 0 0 1
>> Corner=Typ
>>
>> And add a strings into gnet-spice-sdb.scm:
>> ;;----------------------------------------------------------
>> ;; Include a file using an .LIB directive
>> ;;----------------------------------------------------------
>> (define spice-sdb:write-library
>>   (lambda (package port)
>>     (debug-spew (string-append "Found SPICE .LIB box.  Refdes = " package "\n"))
>>     (let ((value (gnetlist:get-package-attribute package "value"))
>> 	  (file (gnetlist:get-package-attribute package "file"))
>> 	  )   ;; end of local assignments
>>       (debug-spew (string-append "   value = " value "\n"))
>>       (debug-spew (string-append "   file = " file "\n"))
>>       (display (string-append ".LIB " value "\n") port)
>>       (debug-spew "placing .lib directive string into netlist.\n"))
>>
>>    )
>> )
>>
>> When I run gnetlist -v -g spice-gdb ....., i've got:
>>
>> Now process the items in model file list -- stick appropriate references to models in output SPICE file.
>> Handling spice model file modelcard.pmos
>> Done processing items in model file list.
>> Make second pass through design and write out a SPICE card for each component found.
>> --- checking package = A5
>>     device = library
>> Found unknown component.  Refdes = A5
>>
>> What I'm doing wrong.
>>
>> Thanks,
>> AB.
>>
>>
>>
>> _______________________________________________
>> geda-user mailing list
>> geda-user@xxxxxxxxxxxxxx
>> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
>>
>
>
> _______________________________________________
> geda-user mailing list
> geda-user@xxxxxxxxxxxxxx
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
>


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user