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

[RACL] Parse mappings and auto-connect RACL #25749

Merged
merged 12 commits into from
Jan 24, 2025

Conversation

Razer6
Copy link
Member

@Razer6 Razer6 commented Dec 25, 2024

This PR adds support for parsing the RACL config. In the first place, a *-connection is implemented, mapping all registers to a single RACL policy. The RACL policies are distributed to subscribing IPs. A selection vector in the form of a parameter selects the right policy from the policy vector.

RACL is applied to PWM first.

@Razer6 Razer6 force-pushed the racl-connections branch 9 times, most recently from 6b1e47c to 2f84455 Compare December 28, 2024 19:14
@Razer6 Razer6 marked this pull request as ready for review December 29, 2024 16:13
@Razer6 Razer6 requested a review from msfschaffner as a code owner December 29, 2024 16:13
@Razer6 Razer6 removed the request for review from msfschaffner December 29, 2024 16:14
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

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

A partial review so far, sorry (just the first two commits)

util/raclgen/lib.py Outdated Show resolved Hide resolved
util/raclgen/lib.py Outdated Show resolved Hide resolved
util/raclgen/lib.py Outdated Show resolved Hide resolved
util/raclgen/lib.py Outdated Show resolved Hide resolved
util/raclgen/lib.py Outdated Show resolved Hide resolved
util/topgen.py Outdated Show resolved Hide resolved
util/topgen.py Outdated Show resolved Hide resolved
util/topgen/intermodule.py Outdated Show resolved Hide resolved
util/topgen/merge.py Outdated Show resolved Hide resolved
hw/ip/pwm/rtl/pwm_reg_top.sv Outdated Show resolved Hide resolved
hw/ip/pwm/lint/pwm.vbl Outdated Show resolved Hide resolved
hw/ip/pwm/rtl/pwm.sv Outdated Show resolved Hide resolved
hw/ip/pwm/data/pwm.hjson Outdated Show resolved Hide resolved
@Razer6 Razer6 force-pushed the racl-connections branch 7 times, most recently from f73b4bf to 26c496d Compare January 1, 2025 12:14
if instance.get('racl_mappings') is not None:
raise ValueError("Cannot specify both 'racl_mapping' and 'racl_mappings'")
del instance['racl_mapping']
instance['racl_mappings'] = {None: racl_mapping}
Copy link
Contributor

Choose a reason for hiding this comment

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

A dictionary with "None" as a key can be confusing. Is there a better name for this, like "default" or some such.

Copy link
Member Author

Choose a reason for hiding this comment

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

It can but this would add an assumption on how a TLUL interface can be named / or not. I think this one was done in the same way as for the base address. I am happy to change that in a follow up PR.

Copy link
Contributor

@matutem matutem Jan 23, 2025

Choose a reason for hiding this comment

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

I hope you consider adding a default racl object in the top config, and when an IP doesn't assign one we give it the default. This has no name clash issues. Okay in a subsequent PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

We agreed on core being the default.

@Razer6 Razer6 force-pushed the racl-connections branch 5 times, most recently from d0c41f5 to af93c02 Compare January 23, 2025 08:17
Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

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

I've just worked through this again and I'm pretty convinced! I know that there are a couple of pending items from @matutem, but I'm very happy when we're ready with them.

@matutem matutem self-requested a review January 23, 2025 17:07
Razer6 added 12 commits January 23, 2025 19:00
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Copy link
Contributor

@matutem matutem left a comment

Choose a reason for hiding this comment

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

LGTM, but there are items that can be addressed in subsequent PRs.

@vogelpi
Copy link
Contributor

vogelpi commented Jan 23, 2025

CHANGE AUTHORIZED: hw/ip/i2c/data/i2c.hjson
CHANGE AUTHORIZED: hw/ip/i2c/rtl/i2c.sv
CHANGE AUTHORIZED: hw/ip/i2c/rtl/i2c_reg_top.sv
CHANGE AUTHORIZED: hw/ip/pwm/data/pwm.hjson
CHANGE AUTHORIZED: hw/ip/pwm/rtl/pwm.sv
CHANGE AUTHORIZED: hw/ip/pwm/rtl/pwm_reg_top.sv
CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_adapter_reg_racl.sv
CHANGE AUTHORIZED: hw/ip/uart/data/uart.hjson
CHANGE AUTHORIZED: hw/ip/uart/rtl/uart.sv
CHANGE AUTHORIZED: hw/ip/uart/rtl/uart_reg_top.sv
CHANGE AUTHORIZED: hw/top_earlgrey/rtl/autogen/top_earlgrey.sv

This PR changes hardware blocks used in Earlgrey as well as Earlgrey but the functionality doesn't change as RACL is still disabled in Earlgrey, i.e., these changes have no functional impact.

@matutem
Copy link
Contributor

matutem commented Jan 23, 2025

CHANGE AUTHORIZED: hw/ip/i2c/data/i2c.hjson
CHANGE AUTHORIZED: hw/ip/i2c/rtl/i2c.sv
CHANGE AUTHORIZED: hw/ip/i2c/rtl/i2c_reg_top.sv
CHANGE AUTHORIZED: hw/ip/pwm/data/pwm.hjson
CHANGE AUTHORIZED: hw/ip/pwm/rtl/pwm.sv
CHANGE AUTHORIZED: hw/ip/pwm/rtl/pwm_reg_top.sv
CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_adapter_reg_racl.sv
CHANGE AUTHORIZED: hw/ip/uart/data/uart.hjson
CHANGE AUTHORIZED: hw/ip/uart/rtl/uart.sv
CHANGE AUTHORIZED: hw/ip/uart/rtl/uart_reg_top.sv
CHANGE AUTHORIZED: hw/top_earlgrey/rtl/autogen/top_earlgrey.sv

@vogelpi vogelpi merged commit c71c4ff into lowRISC:master Jan 24, 2025
38 checks passed
@Razer6 Razer6 deleted the racl-connections branch January 24, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants