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
> [email protected]
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user
>


_______________________________________________
geda-user mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user

Reply via email to