Module for doing some Parsing in Python

Discussion in 'Python' started by Boris Boutillier, Dec 2, 2003.

  1. 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
     
    Boris Boutillier, Dec 2, 2003
    #1
    1. Advertising

  2. 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
     
    Skip Montanaro, Dec 2, 2003
    #2
    1. Advertising

  3. 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" <> wrote in message news:<>...
    > 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
     
    Corey Coughlin, Dec 3, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Maric Michaud
    Replies:
    0
    Views:
    7,204
    Maric Michaud
    Jun 24, 2006
  2. Alex Gusarov
    Replies:
    3
    Views:
    279
    Alex Gusarov
    Oct 21, 2008
  3. Daniel Harple
    Replies:
    0
    Views:
    124
    Daniel Harple
    Dec 23, 2005
  4. Chris McMahon
    Replies:
    0
    Views:
    83
    Chris McMahon
    Mar 26, 2006
  5. Jarmo Pertman
    Replies:
    5
    Views:
    152
    Jarmo Pertman
    Aug 2, 2010
Loading...

Share This Page