Skip to content

Specify statements #115

Open
Open

Description

@lilasrahis

I have some Specify statements in my Verilog code. It seems that Pyverilog cannot parse such statements?

Activity

  1. kwmartin commented on Jun 24, 2025

    @kwmartin

    It seems at least not correctly, see the following ast code

          SBlock: None (at 9)
            SpcfyStmnt: full (at 10)
              SrcSgnls: negedge (at 10)
                Sgnl: CP (at 10)
                  Identifier: CP (at 10)
              DstSgnls:  (at 10)
                Identifier: QP (at 10)
                Identifier: CP (at 10)
                PthSpcfy: pluscolon (at 10)
                  'pluscolon' (at %s) % self.lineno
              DelaySpcs:  (at 10)
                DelaySpc: (Times 22.0 1.0) (at 10)
                  Times:  (at 10)
                    FloatConst: 22.0 (at 10)
                    FloatConst: 1.0 (at 10)
              Constant: full (at 10)
    
    

    note: 'pluscolon' (at %s) % self.lineno
    It does parse a lot of verilog, but doesn't seem to be maintained much, and I've found a number of places where it fails (with the fixes not obvious and potentially breaking at updates). I've also tried PyParsing's verilog example, which does a pretty good job of accepting the verilog code; it is not clear (to me) how to go from what it recognizes to an AST table. It seems (again to me) that a good parser for verilog in Python does not exist. I believe there are some good verilog parser in C/C++ (iverilog, yosys) and maybe tcl (xchem), but nothing that doesn't require a lot of work in Python? Ideally, it's just my lack of information, but if anyone knows of a good verilog parser, it would be good to know?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions