[sw,dv] Add SW-DV logging#600
Open
martin-velay wants to merge 4 commits into
Open
Conversation
Signed-off-by: martin-velay <mvelay@lowrisc.org>
Signed-off-by: martin-velay <mvelay@lowrisc.org>
The upstream script assumes a 32-bit struct layout (5×uint32, 20 B, LONG header). Mocha's rv64 log_fields_t uses 8-byte const char * pointer fields, giving a 32-byte struct and an 8-byte QUAD section-address header. Add a patch that detects the ELF class at runtime and selects the correct header format, entry size, and unpack string accordingly. Wire the script into build_sw_collateral_for_sim.py so each CMake install step produces the .logs.txt and .rodata.txt files that sw_logger_if needs at simulation start. Signed-off-by: martin-velay <mvelay@lowrisc.org>
Each call site places a log_fields_t entry in a new .logs.fields ELF section; extract_sw_logs.py produces the database consumed by sw_logger_if to decode printf-style messages at simulation start, with no UART overhead. Add mocha_system_dv_log() to the HAL for CHERI-safe access to the log write port (0x2002_0008). Add the .logs.fields section to the linker script after .rodata so string constants are resolved before log entries are laid out. Add dv_log.h/c implementing the DV_LOG_INFO/WARNING/ERROR/ FATAL macros and the runtime dv_log_write() function. Add dv_log_smoketest to verify the end-to-end path. Signed-off-by: martin-velay <mvelay@lowrisc.org>
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.
Related to this issue: #261