gnucap-devel
[Top][All Lists]
Advanced

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

[Gnucap-devel] netlist translation via XML/XSLT


From: Andrew Plumb
Subject: [Gnucap-devel] netlist translation via XML/XSLT
Date: Wed, 6 Sep 2006 14:02:48 -0400 (EDT)
User-agent: SquirrelMail/1.4.8

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

...where spice2vams.xsl is the XSL transform that converts the output of
spice2xml into a Verilog-AMS equivalent.

For documentation purposes (e.g. scripted generation of design summaries),
it would be useful to also have an equivalent vams2xml.  Experience has
proven it makes a lot more sense (and saves a lot of time) to re-use the
simulator's own parser so everything stays in sync, so that would be a
lower priority on my part, not being familiar with that parser and all.

I'll be doing my development work on my (Intel-based) MacBook Pro and
check that it compiles on one of my Fedora-based machine.  That should
help keep me out of any trouble w.r.t. work conflict of interest, since
Mac isn't a supported platform. ;-)

Later!

Andrew.

-- 

E-mail:    address@hidden
Photos:    http://www.flickr.com/photos/aplumb/

Victory!  The bits shall ring out, the message of my domain...





reply via email to

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