Skip to content

[cheriot,rtl] Add TRVK filter to Ibex sources - #2455

Open
thommythomaso wants to merge 2 commits into
lowRISC:masterfrom
thommythomaso:tbenz/cheriot-ibex
Open

[cheriot,rtl] Add TRVK filter to Ibex sources#2455
thommythomaso wants to merge 2 commits into
lowRISC:masterfrom
thommythomaso:tbenz/cheriot-ibex

Conversation

@thommythomaso

Copy link
Copy Markdown
Contributor

No description provided.

@thommythomaso thommythomaso self-assigned this Jun 30, 2026
thommythomaso added a commit to thommythomaso/opentitan-tbenz-pub that referenced this pull request Jun 30, 2026
This commit updates the vendored ibex to `thommythomaso/ibex-tbenz-pub`.
This has to be updated to point to `lowrisc/ibex` as soon as lowRISC/ibex#2455
and lowRISC/ibex#2456 are merged.

Signed-off-by: Thomas Benz <tbenz@lowrisc.org>
thommythomaso added a commit to thommythomaso/opentitan-tbenz-pub that referenced this pull request Jun 30, 2026
This commit updates the vendored ibex to `thommythomaso/ibex-tbenz-pub`.
This has to be updated to point to `lowrisc/ibex` as soon as lowRISC/ibex#2455
and lowRISC/ibex#2456 are merged.

Signed-off-by: Thomas Benz <tbenz@lowrisc.org>
Comment thread ibex_top.core
@thommythomaso
thommythomaso marked this pull request as ready for review July 27, 2026 09:23
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@thommythomaso

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document. By submitting this pull request comment, I am hereby confirming my acceptance of the terms of the CLA Document and my agreement to be legally bound by its terms.

The `stream_fork` and `stream_join` modules are used in some CHERIoT memory IPs.

Signed-off-by: Thomas Benz <tbenz@lowrisc.org>
Signed-off-by: Thomas Benz <tbenz@lowrisc.org>

@marnovandermaas marnovandermaas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've left a few comments on this, mainly to make the code more clear. Do we have any tests for this load filter? We should include at least a smoke test before merging this.

Comment thread rtl/ibex_cheriot_pkg.sv
parameter int unsigned CPERMS_W = 6;


// Obtain 32-bit representation of top

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

33-bit

Comment thread rtl/ibex_cheriot_pkg.sv
// Obtain 32-bit representation of top
function automatic logic[32:0] get_bound33(logic [TOP_W-1:0] top, logic [1:0] cor,
logic [EXP_W-1:0] exponent, logic [31:0] addr);
logic [32:0] t1, t2, mask, cor_val;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

t1 and t2 should have more descriptive names.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but we should align ourself with the nomenclature used in the core. @SamuelRiedel, will you rename these signals?

Comment thread rtl/ibex_cheriot_pkg.sv
function automatic logic [2:0] update_temp_fields(logic [TOP_W-1:0] top, logic [BOT_W-1:0] base,
logic [BOT_W-1:0] addrmi);
logic top_hi, addr_hi;
logic [2:0] res3;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should probably be called something like "correction_bits"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would keep this aligned with the name originally used by the reference implementation of Microsoft. The plan is to merge the current ibex_cheriot_pkg.sv with the one that will be introduced with the core.

Comment thread rtl/ibex_trvk.sv
.oup_ready_i(1'b1)
);

// Forward OBI payload between host and device

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You use host and device terminology here but downstream and upstream terminology for the signals. Does it make sense to align these?

Comment thread rtl/ibex_trvk.sv
assign upstream_rdata_intg_o = downstream_rsp_out.intg;
assign upstream_err_o = downstream_rsp_out.err;

// Forward host to device CHERIoT tag w/o changes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nit, probably best to spell out "without" here.

Comment thread rtl/ibex_trvk.sv
// We have loaded valid capability pointer, now we see valid metadata, not a sealing cap,
// and are pointing into the revocation bitmap
assign revbm_req_required = !is_sealing_cap && // Not sealing cap
ptr_store_valid_q && // The base pointer stored is valid

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This one really confused me, it would be much clearer if this signal was named "cap_load_valid_q"

Comment thread rtl/ibex_trvk.sv
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

module ibex_trvk #(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would prefer to rename this. One idea I had is "ibex_cap_load_filter".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would keep this aligned with the nomenclature introduced by Microsoft.

Comment thread rtl/ibex_trvk.sv
///////////////////

// Pointer buffer is filled iff tag valid & 64-bit aligned
assign ptr_store_enable = downstream_rsp_out.tag && !align_out && align_out_valid &&

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would prefer to rename this "ptr_load_enable". I was very confused by this code thinking that this was about storing a pointer not loading one.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also we should probably rename "ptr" to "cap".

Comment thread rtl/ibex_trvk.sv
assign revbm_req_required = !is_sealing_cap && // Not sealing cap
ptr_store_valid_q && // The base pointer stored is valid
downstream_rsp_out.tag && // We are looking at a capability
downstream_rsp_out_valid && // The stored response is valid

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe the comment should say "The latched load response is valid"

Comment thread rtl/ibex_trvk.sv
downstream_rsp_out.tag && // We are looking at a capability
downstream_rsp_out_valid && // The stored response is valid
align_out && // We are on the second word of the cap
align_out_valid && // The alignment store is valid

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe this comment should say "The latched alignment bits are valid"

@thommythomaso

Copy link
Copy Markdown
Contributor Author

I've left a few comments on this, mainly to make the code more clear. Do we have any tests for this load filter? We should include at least a smoke test before merging this.

I have a smoke test in OpenTitan of the entire CHERIoT subsystem. I would suggest to not add a dedicated test for just the filter here, especially as we are planning to merge the core soon which then will use and verify the filter.

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