Repository navigation
[dv] Run a first directed test in CHERIoT mode - #2596
Open
henrikpedersen-oss wants to merge 3 commits into
Open
henrikpedersen-oss wants to merge 3 commits into
henrikpedersen-oss wants to merge 3 commits into
Conversation
The testbench tied cheriot_enable_i off, so no test ran in CHERIoT mode. +cheriot_enable=1 now holds it On from reset, in CHERIoT builds only. cheriot_cap_basic derives a 16-byte capability from mtdc, checks its address, bounds and tag, and stores and loads through it. It checks itself, as the cosim does not model CHERIoT yet. Signed-off-by: Henrik M Pedersen <henrik.pedersen@lowrisc.org>
henrikpedersen-oss
force-pushed
the
upstream-cheriot-basic
branch
from
November 25, 2026 15:01
42ce7f9 to
23c19a4
Compare
The merge with master kept master's tie-off of cheriot_enable_i next to the new connection, so the testbench no longer elaborated (xmelab CUVPOM). Drive cheriot_enable_i, cheriot_enable_shadow_i and cheriot_enable_cmp_i from the same plusarg, so the lockstep pair agrees. Signed-off-by: Henrik M Pedersen <henrik.pedersen@lowrisc.org> AI-assisted (Claude Code) — reviewed and approved by author Co-Authored-By: Claude <claude@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The UVM testbench ties
cheriot_enable_ioff, so no test runs in CHERIoT mode, although the defaultopentitanconfiguration is built withBaseIsaRV32IorCHERIoT. This PR adds a way to turn it on and one small test that uses it.+cheriot_enable=1holdscheriot_enable_iOn from reset, as the one-way switch requires. Without the plusarg nothing changes. With it, a build that isn't CHERIoT stops with an error.cheriot_cap_basicreads the root memory capability frommtdc, which holds it after reset (doc/03_reference/cheriot.rst). It moves the address to a buffer, sets 16-byte bounds, checks address, base, length and tag, stores and loads through the capability and an offset copy of it, and checks thatCClearTagclears only the tag. In CHERIoT mode every load and store needs a capability, so the test has its own short start-up and writes pass or fail through a capability derived frommtdc. The CHERIoT instructions are written with.insn, as the toolchain does not know them.+disable_cosim=1, as the Zcmp tests do, because the cosim does not model CHERIoT yet (a CHERIoT-Sail cosim is planned as a separate PR; the test can then also run with cosim).rtl_paramsrestricts it to CHERIoT builds.+disable_spurious_dside_responses=1keeps injected bus errors away from its loads and stores.Tested with Xcelium on top of be1d803,
IBEX_CONFIG=opentitan:cheriot_cap_basicpassed on 5 seeds, and the trace shows the CHERIoT instructions executing. It also fails when it should: with the expected length changed to 17 it reportsTEST_FAIL, and without+cheriot_enable=1its first CHERIoT instruction traps as illegal.