-
Notifications
You must be signed in to change notification settings - Fork 803
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
[topgen] Generate files for all address spaces #25894
Conversation
fb78b14
to
062ed30
Compare
a7dae8e
to
6bcfc4a
Compare
This PR reworks #23122 a bit and adds comments that explain what the functions are trying to do and where there are limitations. |
6bcfc4a
to
aaa22be
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.
That looks good. Thanks for improving my works. A quick question, right now some definitions are rendered in all address space. I guess that should only be rendered in the appropriate address space.
1116d0d
to
7c16f7a
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.
I think there still some output definitions that need to be dropped by adapting the IP detection in the template files.
sw/host/opentitanlib/src/chip/autogen/top_darjeeling_soc_dbg.rs
Outdated
Show resolved
Hide resolved
sw/host/opentitanlib/src/chip/autogen/top_darjeeling_soc_dbg.rs
Outdated
Show resolved
Hide resolved
sw/host/opentitanlib/src/chip/autogen/top_darjeeling_soc_dbg.rs
Outdated
Show resolved
Hide resolved
sw/host/opentitanlib/src/chip/autogen/top_darjeeling_soc_mbx.rs
Outdated
Show resolved
Hide resolved
Those were not actually focus areas of this PR (which targets just the base addresses, interrupts, and alerts), but I could look at handling them here too. Edit: ...done. Just a simple application of the same patterns in this PR. A helper function might be in order, but I'll wait for the pass with multiple instances in a design before I bother. |
7c16f7a
to
e4692ec
Compare
Individually generate C and Rust collateral for all address spaces Fix up alert and irq domains to enable generating collateral where the alerts and irqs don't necessarily generate from devices in the same address space as the CPU. Darjeeling has bus bridges that make servicing those interrupts possible (indirect reachability to the IP). The autogenerated tests will surely be bonkers, but that is to be fixed up later. Co-authored-by: Robert Schilling <[email protected]> Signed-off-by: Alexander Williams <[email protected]>
e4692ec
to
31a1a0a
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 Alex for removing the unneeded definitions. This looks good to me!
FYI I think there was some kind of merge skew here with Rust linting: $ bazel run //quality:rustfmt_fix
Target //quality:rustfmt_fix up-to-date:
bazel-bin/quality/rustfmt_fix.bash
Error writing files: failed to resolve mod `top_darjeeling_soc_dbg`: opentitan/hw/top_darjeeling/sw/autogen/chip/top_darjeeling_soc_dbg.rs does not exist I think the last time this went through CI was before 0791e55 was merged |
Can we revert and try again? It looks like the |
I'll give it a try. Thanks @jwnrt for flagging. |
This is a follow up of 955bab6 merged with lowRISC#25894. Signed-off-by: Pirmin Vogel <[email protected]>
rsformat_dir / f"{topname}.rs", | ||
helper=rs_helper) | ||
# Generate Rust host-side files | ||
rsformat_dir = src_tree_top / 'sw/host/opentitanlib/src/chip/autogen' |
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.
Note that this change of rsformat_dir
inside the address space loop also affects the generation of the following device-side files which is wrong. I've now filed #25953 to fix this and to unblock CI again.
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.
Nice catch! I didn't pay close enough attention to the rust outputs, apparently. That code could be cleaned up a little more...
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.
Don't worry, it's working now :-)
This is a follow up of 955bab6 merged with #25894. Signed-off-by: Pirmin Vogel <[email protected]>
Individually generate C and Rust collateral for all address spaces
Fix up alert and irq domains to enable generating collateral where the
alerts and irqs don't necessarily generate from devices in the same
address space as the CPU. Darjeeling has bus bridges that make servicing
those interrupts possible (indirect reachability to the IP).
The autogenerated tests will surely be bonkers, but that is to be fixed
up later.