This repository was archived by the owner on Feb 6, 2026. It is now read-only.
Conversation
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Rajnesh Kanwal <rkanwal@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
Updated the test053 to remove the arbitrary check for the number of seconds passed. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
This is currently only used to override the diag entry label which should really be a diag attribute. I'm also not sure how we can override the attributes for the various modes. Will revisit this if it's actually needed. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
to improve readability and reduce verbosity. Future renames of section attributes will touch only the macros. Added "cpu" to the names of the .jumpstart sections. This allows us to distinguish between sections for various MMUs. At this point we only have the CPU MMU. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
meson setup doesn't like "True"/"False" strings that python puts out. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Override diag attributes to reduce the size of the diag as much as possible. Use the elf_start/end_address diag attribute to enforce the LRAM bounds check.
Signed-off-by: Jerin Joy <joy@rivosinc.com>
If the ELF is moved into the --diag_build_dir after the meson compile step the meson test step will have to relink the ELF. The relinking is happening for spike runs but not for qemu runs because the diag ELF dependency is correctly handled by the meson test call for spike. The right thing to do is to copy the ELF and not move it after meson compile so that meson test can just use that ELF. The ELF dependency issue for the meson test qemu call will be fixed in the next commit. Signed-off-by: Jerin Joy <joy@rivosinc.com>
For the spike target the diag_exe dependency was correctly enforced because we're using it directly. For oswis and qemu the dependency wasn't enforced because we're using diag_exe.full_path(). This was causing issues with build_diag.py flow where we would (incorrectly) move the ELF to the diag_build_dir after the compile step instead of copying it. build_diag.py is fixed to copy instead of move but it's better to enforce this dependency. Signed-off-by: Jerin Joy <joy@rivosinc.com>
to improve readability. Signed-off-by: Jerin Joy <joy@rivosinc.com>
The newer version of reuse drops the '='. Reference: https://rivosinc.atlassian.net/browse/IT-7582 Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
This allows s-mode access to the `stimecmp` register which is required for s-mode to operate the timer. Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
Added ifdefs to gate references in a higher mode to a lower mode that isn't enabled in the build. Renamed smode data area to privileged data area. This is shared by both mmode and smode. We're going to allow builds without smode regions but we still need this data area for mmode. Include this privileged data area along with the mmode area. Signed-off-by: Jerin Joy <joy@rivosinc.com>
This was used to test the code in the mmode section being larger than the number of pages allocated for it. This is not needed anymore because generate_diag_sources.py will add a guard linker section after every linker section that isn't followed by another section. When a section is overrun and runs into the guard section the linker will fail the build. This test required num_pages_for_jumpstart_mmode_text to have more pages than were actually required just to so that it could build. We can now reduce num_pages_for_jumpstart_mmode_text. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Let the build scripts that use the class decide. Signed-off-by: Jerin Joy <joy@rivosinc.com>
The commit ef04a4fb moved data.privileged.S to fw-sbi smode_sources, but since the public release only supports fw-none, we need to keep it in mmode_sources where it's needed for hart_status_tracker and hart_sync_point symbols.
… line Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
These functions check compile/run success. Replace checks in DiagFactory to use these functions. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Add canonical address validation to ensure 64-bit virtual addresses are valid for the current translation mode (Sv39, Sv48, Sv57, etc.). Validates that unused upper bits are properly sign-extended from the most significant used bit. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
The cores were all using the same memory location. Fixes SIVAL-336. Also removed the explicit addresses so that we can run this on silicon. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Problem: When scripts using DiagFactory were interrupted with Ctrl+C, Spike processes continued running in the background. Solution: - Track all spawned process groups in a global registry - Install SIGINT handler that immediately kills all registered processes - Make cleanup idempotent and thread-safe - Add atexit handler as backup Result: Single Ctrl+C now terminates all subprocesses across all threads. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Don't report fail when we haven't run diags in environments that have no run targets. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Update memalign_from_memory to use the same search strategy as malloc_from_memory, starting from last_allocated instead of always starting from head. This prevents ping-ponging between the same two buffer addresses when repeatedly allocating and freeing. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Introduce chunk_iterator_t to encapsulate the two-pass search strategy used by both malloc_from_memory and memalign_from_memory, eliminating code duplication. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Without this we are clobbering gp register. Fortunately none of the tests use gp as of now so this issue never came up. It was fixed in mtvec but not in stvec and vstvec. Signed-off-by: Rajnesh Kanwal <rkanwal@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Rajnesh Kanwal <rkanwal@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
- All diagnostics now automatically get unexpected exception reporting. - Add default_smode_exception_handler() for comprehensive exception reporting - Register handlers for all exceptions except ECALLs (used for mode switching) Added defines for the sstatus field positions. Increased the number of smode text pages for the public build. Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
4989263 to
fa26a97
Compare
fa26a97 to
5b129b8
Compare
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
Signed-off-by: Jerin Joy <joy@rivosinc.com>
54f884f to
a70dd32
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR introduces virtualization support, major build system refactoring, heap improvements, and extensive code cleanup for public release.
Key Changes
Virtualization Support
run_function_in_vumode()andrun_function_in_mmode_from_smode()APIsBuild System
DiagFactorywith YAML-based multi-diagnostic build/run--targetwith--environmentconfigurationHeap & Memory
memalign()in the APIM-Mode & Infrastructure
Testing & Documentation
Code Quality