-
Notifications
You must be signed in to change notification settings - Fork 804
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
[hw,alert_hander,rtl] Add support for uniquification #25800
Conversation
b93e55c
to
5fa77ab
Compare
d03a852
to
02c1acc
Compare
@@ -195,6 +195,10 @@ def _filename_without_tpl_suffix(self, filepath: Path) -> str: | |||
""" Get the name of the file without a '.tpl' suffix. """ | |||
assert filepath.suffix == '.tpl' | |||
filename = filepath.stem | |||
# Do not render the module_instance_name into bazel BUILD file templates |
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.
I'm interested to know what went wrong with this :-) But don't we want to move this commit to come before the change to using module_instance_name
?
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.
The idea of the logic in this function is to unquify the filenames if it is a *.tpl
file. So alert_handler_foo.sv.tpl
becomes <module_instance_name>_foo.sv
. Note, this only works if the file is correctly prefixed with default module name. In this case it is alert_handler
. Otherwise, it would overwrite parts of the original file name or everything (due to to the indexing here filename[len(self.ip_template.name):]
).
We have templated BUILD
files, i.e., BUILD.tpl
. Due to the uniquification (and the wrong prefix), BUILD.tpl
is rendered to <module_instance_name>
. To fix this, I exclude BUILD template files from the file uniquification at all.
But don't we want to move this commit to come before the change to using
module_instance_name
?
It does not matter. The OpenTitan code bases does not have a uniquified alert_handler
that sets the module_instance_name
.
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.
Ahah, I see. Thanks for the explanation.
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 looks very sensible to me. And thank you for breaking it into small(ish) commits: it made the review much easier!
CHANGE AUTHORIZED: hw/top_earlgrey/ip_autogen/alert_handler/data/alert_handler.hjson Although this looks like a lot of changes, it's essentially just making some names overridable. No risk to the design: the default values for the names are the ones we have been using. |
02c1acc
to
b941cf3
Compare
Your analysis is probably correct (i.e. fewer commits to carry conflict resolution steps through), but no preference here. There will be some minor conflicts in the fusesoc core files, and one of us would have to deal with it either way. |
@a-will Is your PR ready? Happy to merge yours first and I rebase |
I believe so. I'm just letting it finish off the CI FPGA tests, and then we could click the merge button. |
That sounds good to me! |
The rename is done to ease the uniquification of the alert handler. From alert_handler_pkg, alert_handler will be the module instance name. Signed-off-by: Robert Schilling <[email protected]>
Files are only renamed. Templates don't use the module_instance_name yet. Signed-off-by: Robert Schilling <[email protected]>
Signed-off-by: Robert Schilling <[email protected]>
Signed-off-by: Robert Schilling <[email protected]>
Signed-off-by: Robert Schilling <[email protected]>
Signed-off-by: Robert Schilling <[email protected]>
b941cf3
to
e325fe8
Compare
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.
Thanks for nicely splitting the changes into digestible commits @Razer6 . LGTM!
hw/top_darjeeling/ip_autogen/alert_handler/dv/cov/alert_handler_cov.core
Show resolved
Hide resolved
CHANGE AUTHORIZED: hw/top_earlgrey/ip_autogen/alert_handler/data/alert_handler.hjson The only Earlgrey RTL changes resulting from this PR are related to renaming the alert_pkg to alert_handler_pkg. This is fine. |
This PR adds support for uniquification of the alert handler in case there are multiple in the design. The PR is split into multiple to make the review easier.
alert_pkg
toalert_handler_pkg
. The rename is done to ease the uniquification of the alert handler. Fromalert_handler_pkg
,alert_handler
will be the module instance name.module_instance_name
to thetpldesc
filemodule_instance_name
within the templates and uniquify the alert_handlermodule_instance_name
into Bazel BUILD file templates.This only modifies the templates. Rendering the alert_handler (without uniquification) does not yield any RTL or core file diff, which is a good sign.