Hi Everyone,
Jonathan David pinged me on this one (re. Re: [Gnucap-devel] Verilog -
was: Re: Use of M as suffix for Mega, Date: Thu, 24 Aug 2006 17:11:18
-0700 (PDT)). It's probably not a good idea for me to contribute the
actual code I wrote a while back to do netlist translation, but I'm quite
willing to start from scratch to create something formally GPL'd.
The way I originally structured things was as command-line, Java-based
tool to keep things platform independent. I coded up a JavaCC-based
parser to convert Spectre-syntax and SPICE-syntax into an XML-intermediate
format, then used Java's built-in XSLT parser to transform the resulting
XML into whatever textual output was needed, including Verilog-AMS.
For a GPL'd set of tools, I think the approach I'll take is to create a
simple lex/yacc-based parser to read SPICE format from STDIN and write XML
to STDOUT. Then anyone can use xsltproc to create/modify/enhance their
own output format, or possibly re-use the parser code to write directly to
a BSD/MySQL database or equivalent for other funky stuff.
Probable usage examples:
spice2xml < netlist.cir > netlist.xml
spice2xml -i netlist.cir -o netlist.xml
spice2xml -i netlist.cir > netlist.xml
spice2xml < netlist.cir -o netlist.xml
cat netlist.cir | spice2xml > netlist.xml
...then all you would have to do is:
xsltproc spice2vams.xsl netlist.xml > netlist.vams