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

[hw,tlul_adapter_sram,rtl] Add support for RACL protected SRAM Adapter #26015

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

Razer6
Copy link
Member

@Razer6 Razer6 commented Jan 25, 2025

This PR adds a RACL protected SRAM adapter. This works by acting like a shim around the existing TLUL SRAM adapter. In case of a RACL error, the error is responded via the TLUL loopback adapter. Currently, only a single RACL policy is supported, but this will be extended in the future.

This RACL protected SRAM adapter will be used in SPI host and device as well as in the SRAM Control.

The same approach is implemented for the Reg adapter. This circumvents dealing with any flop latencies in the adapter explicitly, since RACL is check for the TLUL request goes into the TLUL adapter.

Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
@Razer6 Razer6 force-pushed the racl-sram-error branch 2 times, most recently from 5468cd1 to b781d24 Compare January 26, 2025 09:54
@Razer6 Razer6 force-pushed the racl-sram-error branch 2 times, most recently from dd47e92 to 0585dfb Compare January 26, 2025 17:03
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
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.

This looks sensible to me. A couple of minor questions before it lands.

hw/ip/tlul/adapter_reg_racl.core Show resolved Hide resolved
hw/ip/tlul/rtl/tlul_adapter_reg_racl.sv Show resolved Hide resolved
assign rd_req = tl_i.a_opcode == tlul_pkg::Get;
assign racl_read_allowed = (|(racl_policies_i[RaclPolicySelVec].read_perm & racl_role_vec));
assign racl_write_allowed = (|(racl_policies_i[RaclPolicySelVec].write_perm & racl_role_vec));
assign racl_error_o = (rd_req & ~racl_read_allowed) | (~rd_req & ~racl_write_allowed);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a big deal, but would this be slightly shorter and clearer?

    assign racl_error_o       = !(rd_req ? racl_read_allowed : racl_write_allowed);

(I realise that this is already in the register adapter, so it would definitely be a follow-up PR if so)

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's make a follow-up PR on that to unblock the others since CI is green at the moment.

@rswarbrick
Copy link
Contributor

CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_adapter_reg_racl.sv
CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_adapter_sram_racl.sv
CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_request_loopback.sv

The protected files are all new for the RACL feature, so editing them (to make the feature work) doesn't really present any risk to existing designs.

1 similar comment
@vogelpi
Copy link
Contributor

vogelpi commented Jan 27, 2025

CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_adapter_reg_racl.sv
CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_adapter_sram_racl.sv
CHANGE AUTHORIZED: hw/ip/tlul/rtl/tlul_request_loopback.sv

The protected files are all new for the RACL feature, so editing them (to make the feature work) doesn't really present any risk to existing designs.

@rswarbrick rswarbrick merged commit 7704c7a into lowRISC:master Jan 27, 2025
38 checks passed
@Razer6 Razer6 deleted the racl-sram-error branch January 27, 2025 17:36
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.

3 participants