Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verilog: introduce the Verilog indexer #397

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Verilog: introduce the Verilog indexer #397

merged 1 commit into from
Sep 23, 2024

Conversation

kroening
Copy link
Member

@kroening kroening commented Mar 5, 2024

This adds a recusive decent parser for quicky indexing large quantities of Verilog, tolerating parsing errors, for the purpose of creating overview data very quickly. A new executable, vlindex, is added to output it.

@kroening kroening force-pushed the verilog_indexer branch 3 times, most recently from d25aa62 to 3e86eac Compare April 4, 2024 23:09
@kroening kroening force-pushed the verilog_indexer branch 3 times, most recently from de89a04 to 7eb881c Compare April 17, 2024 15:19
@kroening kroening marked this pull request as ready for review April 17, 2024 15:21
@kroening kroening force-pushed the verilog_indexer branch 2 times, most recently from cd027f2 to 74f74d2 Compare April 22, 2024 00:12
Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving subject to making CI pass plus a few comments below. Tests would really be appreciated.

Comment on lines +1 to +17
module main(input x, input y);

reg result;

always @(x, y)
case(x)
0: result = 0;
1:
case(y)
1: result = 1;
0: result = 0;
endcase
endcase

always assert p1: result == (x && y);

endmodule
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what way is this test exercising the new indexer?

Comment on lines 20 to 21
virtual int doit();
virtual void help();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use override instead?

src/vlindex/vlindex_parse_options.h Outdated Show resolved Hide resolved
Comment on lines +522 to +524
// possibly a macro that wasn't found
std::cout << "LPAREN: " << verilog_parser.get_file() << ':'
<< verilog_parser.get_line_no() << ' ' << token.text << "\n";
rParenExpression();
}
else
{
// something else
std::cout << "ELSE: " << verilog_parser.get_file() << ':'
<< verilog_parser.get_line_no() << ' ' << token.text << "\n";
next_token();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug leftovers?

src/vlindex/verilog_indexer.cpp Outdated Show resolved Hide resolved
src/vlindex/verilog_indexer.cpp Outdated Show resolved Hide resolved
@kroening kroening force-pushed the verilog_indexer branch 7 times, most recently from 7bb5761 to c287968 Compare September 12, 2024 20:23
@kroening kroening force-pushed the verilog_indexer branch 2 times, most recently from 3a5d3d7 to cc04e64 Compare September 23, 2024 13:39
@kroening
Copy link
Member Author

Now with tests in CI.

This adds a recusive decent parser for quicky indexing large quantities of
Verilog, tolerating parsing errors, for the purpose of creating overview
data very quickly.  A new executable, vlindex, is added to output it.
@kroening kroening merged commit 5ef7e9c into main Sep 23, 2024
8 checks passed
@kroening kroening deleted the verilog_indexer branch September 23, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants