Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Module for doing some Parsing in Python

Reply
Thread Tools

Module for doing some Parsing in Python

 
 
Boris Boutillier
Guest
Posts: n/a
 
      12-02-2003
Hi all,

I'm looking for parsing a Verilog file in my python module,
is there already such a tool in python (a module in progress) to
help instead of doing a duplicate job.
And do you know of some generic parsing module in python, in which you
give some kind of grammar and callbacks ?

Thanks for the help

Boris
 
Reply With Quote
 
 
 
 
Skip Montanaro
Guest
Posts: n/a
 
      12-02-2003

Boris> I'm looking for parsing a Verilog file in my python module, is
Boris> there already such a tool in python (a module in progress) to
Boris> help instead of doing a duplicate job. And do you know of some
Boris> generic parsing module in python, in which you give some kind of
Boris> grammar and callbacks ?

Check out the SPARK toolkit:

http://pages.cpsc.ucalgary.ca/~aycock/spark/

Skip

 
Reply With Quote
 
 
 
 
Corey Coughlin
Guest
Posts: n/a
 
      12-03-2003
I actually wrote a gate level verilog parsing module as part of a
generic netlist manipulating/translating package for work a while
back. It allowed me to do fun stuff like translate verilog to spice
and vice versa, construct netlists from python scripts, and so on.
Although it was one of my earlier python projects, so it was awfully
C-like, not particularly pythonic. I recently wrote up a new version
that was a lot more pythonic, but I haven't added verilog input or
output routines yet, just spice. And my boss might not like me
sending out that code. But in general, verilog gate level stuff isn't
too tricky to parse, buses make things kind of tricky, and there are a
lot of different variations (mine was only really reliable with
Synopsys output). And behavioral level code would be a real nightmare
to parse, I'm sure. It's a shame no one has come up with a nice BNF
to python parser package yet, although I'm pretty sure the BNF for
verilog is pages and pages (well, OK, 12 pages in my verilog book), so
doing a full parser would be a real pain regardless. Anyway, good
luck to you, if you do come up with something good, be sure to keep us
posted!





"Boris Boutillier" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
> Hi all,
>
> I'm looking for parsing a Verilog file in my python module,
> is there already such a tool in python (a module in progress) to
> help instead of doing a duplicate job.
> And do you know of some generic parsing module in python, in which you
> give some kind of grammar and callbacks ?
>
> Thanks for the help
>
> Boris

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to check if some object is included in some module? Jarmo Pertman Ruby 5 08-02-2010 05:26 PM
How to get all variables of some module in that module Alex Gusarov Python 3 10-21-2008 04:03 PM
Re: module docstring, documentation,anything? please note is the module type/object NOT some module Maric Michaud Python 0 06-24-2006 12:42 PM
how can a module tell if its caller is using some other module russ.jones2@boeing.com Perl Misc 4 02-15-2006 10:45 PM
REXML -- Parsing doctypes (and some some bugs) Daniel Harple Ruby 0 12-23-2005 06:44 PM



Advertisments