-
Notifications
You must be signed in to change notification settings - Fork 1k
SDC expansion with OpenSTA #5237
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
Draft
widlarizer
wants to merge
14
commits into
main
Choose a base branch
from
emil/sdc_expand
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+920
−264
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ba4f9f5
publish: add pass for renaming private cell types to public
widlarizer b735f2f
box_derive: add -apply
widlarizer 4706c82
box_derive: rename -apply to -apply_derived_type
widlarizer 72c2081
chtype: replace publish pass with chtype -publish_icells
widlarizer f1596f1
icell_liberty: start
widlarizer 7a56417
ff: split out type-only information
widlarizer 897a625
icell_liberty: flops
widlarizer f84337d
icell_liberty: flop harder
widlarizer 5b03710
sdc_expand, opensta: start
widlarizer de28ab0
opensta: quiet net width mismatch warning
widlarizer a6b3113
opensta: quiet blackbox warning
widlarizer 7f9520f
sdc_expand: log header
widlarizer 0ea16ec
sdc_expand: cleanup
widlarizer 3d72dd1
rtlil: undeprecate builtin_ff_cell_types
widlarizer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,9 @@ struct BoxDerivePass : Pass { | |
| log(" replaces the internal Yosys naming scheme in which the names of derived\n"); | ||
| log(" modules start with '$paramod$')\n"); | ||
| log("\n"); | ||
| log(" -apply_derived_type\n"); | ||
| log(" use the derived modules\n"); | ||
| log("\n"); | ||
| } | ||
| void execute(std::vector<std::string> args, RTLIL::Design *d) override | ||
| { | ||
|
|
@@ -59,11 +62,14 @@ struct BoxDerivePass : Pass { | |
| size_t argidx; | ||
| IdString naming_attr; | ||
| IdString base_name; | ||
| bool apply_mode = false; | ||
| for (argidx = 1; argidx < args.size(); argidx++) { | ||
| if (args[argidx] == "-naming_attr" && argidx + 1 < args.size()) | ||
| naming_attr = RTLIL::escape_id(args[++argidx]); | ||
| else if (args[argidx] == "-base" && argidx + 1 < args.size()) | ||
| base_name = RTLIL::escape_id(args[++argidx]); | ||
| else if (args[argidx] == "-apply") | ||
|
Collaborator
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. this does not match the documented |
||
| apply_mode = true; | ||
| else | ||
| break; | ||
| } | ||
|
|
@@ -90,24 +96,29 @@ struct BoxDerivePass : Pass { | |
|
|
||
| auto index = std::make_pair(base->name, cell->parameters); | ||
|
|
||
| if (cell->parameters.empty() || done.count(index)) | ||
| if (cell->parameters.empty()) | ||
| continue; | ||
|
|
||
| IdString derived_type = base->derive(d, cell->parameters); | ||
| Module *derived = d->module(derived_type); | ||
| log_assert(derived && "Failed to derive module\n"); | ||
| log_debug("derived %s\n", derived_type); | ||
| if (!done.count(index)) { | ||
| IdString derived_type = base->derive(d, cell->parameters); | ||
| Module *derived = d->module(derived_type); | ||
| log_assert(derived && "Failed to derive module\n"); | ||
| log("derived %s\n", derived_type); | ||
|
|
||
| if (!naming_attr.empty() && derived->has_attribute(naming_attr)) { | ||
| IdString new_name = RTLIL::escape_id(derived->get_string_attribute(naming_attr)); | ||
| if (!new_name.isPublic()) | ||
| log_error("Derived module %s cannot be renamed to private name %s.\n", | ||
| log_id(derived), log_id(new_name)); | ||
| derived->attributes.erase(naming_attr); | ||
| d->rename(derived, new_name); | ||
| } | ||
|
|
||
| if (!naming_attr.empty() && derived->has_attribute(naming_attr)) { | ||
| IdString new_name = RTLIL::escape_id(derived->get_string_attribute(naming_attr)); | ||
| if (!new_name.isPublic()) | ||
| log_error("Derived module %s cannot be renamed to private name %s.\n", | ||
| log_id(derived), log_id(new_name)); | ||
| derived->attributes.erase(naming_attr); | ||
| d->rename(derived, new_name); | ||
| done[index] = derived; | ||
| } | ||
|
|
||
| done[index] = derived; | ||
| if (apply_mode) | ||
| cell->type = done[index]->name; | ||
| } | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
May I ask why this is being un-deprecated?
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.
This is left over from having changed the function entirely for some reason but apparently I no longer needed it afterwards
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.
Wait, no, I do need this undeprecated. I need a function that takes the name. In
icell_libertyI call this on type IdStrings for cells I don't have instantiated in any design, andCell::is_builtin_fflooks at the type member so it's not static