-
Notifications
You must be signed in to change notification settings - Fork 899
syn: Fix combinational mapper; extend tests #10495
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
Changes from all commits
4e7267d
67d6bb8
7da01e5
abc7d28
dba6a8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -539,7 +539,13 @@ class Parser | |||||||||||||||||||||||||||
| error("unknown cell keyword: " + keyword); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| (void) id; | ||||||||||||||||||||||||||||
| const uint32_t expected_slots = std::max(width, 1u); | ||||||||||||||||||||||||||||
| if (g->tableSize() != id + expected_slots) { | ||||||||||||||||||||||||||||
| error("'" + keyword + "' declared output width " + std::to_string(width) | ||||||||||||||||||||||||||||
| + " but produced " + std::to_string(g->tableSize() - id) + " slot" | ||||||||||||||||||||||||||||
| + (g->tableSize() - id == 1 ? "" : "s")); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+542
to
+547
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The calculation g->tableSize() - id is repeated multiple times in this block. Storing this value in a local variable (e.g., actual_slots) would improve code readability and maintainability by making the validation logic more explicit and avoiding redundant calculations.
Suggested change
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| expectNewline(); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - sorry about that