Skip to content

Vendor extensions#126

Open
yousifBilal wants to merge 6 commits into
dalance:masterfrom
yousifBilal:vendor-extensions
Open

Vendor extensions#126
yousifBilal wants to merge 6 commits into
dalance:masterfrom
yousifBilal:vendor-extensions

Conversation

@yousifBilal

Copy link
Copy Markdown

Hello,

One of the pain points that I face with using standard compliant parsing, is that many vendor tools allow syntax that is not part of the standard. I have implemented the grammar extensions with feature gates, since probably people will either use parsing with the extensions or without. Additionally, If people are only interested in standard grammar, they don't see the extension grammar nodes.

Since this pull request is somewhat large, You can review it by going through each commit; they are self-contained:

Commit 82c792d: Add vendor extension: nested begins in GenerateBlock

As the title indicates, relaxes rules regarding generate blocks. Example:

module my_top;
        for (genvar i = 0; i < 7; i++) begin begin: something
        begin: another
        begin
            logic c;
        end
        end
        end
        end
endmodule

Introducing feature flags breaks the build script of sv-parser-syntaxtree, so I had to move the AnyNode and RefNode enums to pre build time. This requires adding variants manually to these enums whenever a new node is added.

Commit 3c577c3: Fix relax empty queue syntax

The empty queue is accepted as '{}. You can see examples in sv-tests

Commit 1e7f5dc: Allow consecutive unary operators

All formal verification tools allow consecutive unary operators like

    property property_1;
        (a == b |-> !|c);
    endproperty

Commit 591f3f9: Allow brace without apostrophes for arrays

Some tools allow associate arrays without leading apostrophe like:

module my_module;
logic [2:0] _security_state_dict [string] = {
    "VAR_1" : 3'b000,
    "VAR_12": 3'b000
  };
endmodule

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant