473,395 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Module for doing some Parsing in Python

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
Jul 18 '05 #1
2 5045

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

Jul 18 '05 #2
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! :D

"Boris Boutillier" <bo**************@arteris.net> wrote in message news:<pa****************************@arteris.net>. ..
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

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: F. GEIGER | last post by:
py2exe and datetime -> No module named datetime I've begun to use the stdlib module datetime instead of my home brewn classes. Since then a py2exe app doesn't run anymore: Traceback (most...
4
by: Jerry Sievers | last post by:
Dear Pythonists; Curious if there exists in Python package(s) for use as lexer/parser for implementation of language grammars? Already using cmd.py from the standard distro for it's basic...
8
by: Bo Peng | last post by:
Dear list, I am writing a Python extension module that needs a way to expose pieces of a big C array to python. Currently, I am using NumPy like the following: PyObject* res =...
7
by: Guy Robinson | last post by:
Hello, I have a directory of python scripts that all (should) contain a number of attributes and methods of the same name. I need to import each module, test for these items and unload the...
37
by: jwaixs | last post by:
arg... I've lost 1.5 hours of my precious time to try letting re work correcty. There's really not a single good re tutorial or documentation I could found! There are only reference, and if you...
10
by: Ben Finney | last post by:
Howdy all, Question: I have Python modules named without '.py' as the extension, and I'd like to be able to import them. How can I do that? Background: On Unix, I write programs intended to...
1
by: Tim Arnold | last post by:
Hi, I need to do some scripting that interacts with CVS. I've been just doing system calls and parsing the output to figure out what's going on, but it would be nice to deal with CVS directly. ...
13
by: Phillip B Oldham | last post by:
Is there a standard library for parsing emails that can cope with the different way email clients quote?
1
by: cnb | last post by:
>>a = parsing.unserialize("C:/users/saftarn/desktop/twok.txt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python25\Progs\NetflixRecSys\parsing.py", line 91, in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.