[Phase 3] Slice 1: XLEN helper abstraction kickoff#21
Draft
renshi-code wants to merge 8 commits into
Draft
Conversation
1cb642d to
c4da61d
Compare
f193c60 to
04425d6
Compare
- Updated function declarations and definitions across multiple files to use trailing return types for better clarity and consistency. - Enhanced the handling of UART register decoding in MmioRouter with new functions for byte and word access. - Improved the page walk logic in MemorySubsystem to simplify fault detection. - Consolidated repetitive code in CPU stages (EX, MEM, WB) by using auto for type inference. - Added logging for unhandled MMIO operations in MmioRouter. - Cleaned up the instruction decoding logic in Module to enhance maintainability.
- Improved code readability by adding missing braces for single-line if statements across various stages (e.g., StageCommit, StageEX, StageIF). - Standardized the use of `0u` and `0U` for unsigned integer literals for consistency. - Changed variable declarations to use `const` where applicable to enhance code safety and clarity. - Updated function signatures to use `const` where methods do not modify class state (e.g., `get_mstatus`, `read_csr`). - Enhanced memory access logic in `MemorySubsystem` to ensure better handling of page faults and address translation. - Cleaned up the handling of pending exceptions and interrupts in the commit and execution stages. - Improved the handling of floating-point operations and memory accesses in the memory stage. - Ensured consistent formatting and spacing throughout the code for better maintainability.
- Introduced `VirtioUtil.hpp` with utility functions for Virtio MMIO device queue operations, including byte/word conversions and memory operations. - Refactored `Console.cpp` and `Disk.cpp` to utilize the new utility functions, removing redundant code. - Updated `XLen.hpp` to change `PrivilegeLevel` from `Word` to `uint8_t` for better memory efficiency. - Enhanced `build-linux-image.sh` script formatting for improved readability. - Modified `Machine.cpp` to improve image loading error handling and ensure proper memory allocation. - Updated various source files to replace direct array indexing with `.at()` for safer access. - Adjusted exception handling to use `~Word(0)` instead of `~0U` for consistency across the codebase. Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
- Added Mmu.cpp for the implementation of the Memory Management Unit (MMU) supporting SV32 virtual memory translation. - Implemented address translation, page table walking, and permission validation in the MMU. - Introduced TileLinkBus.cpp to handle TileLink-style bus communication, including request handling and response management. - Removed outdated commit and execution stages (StageCommit.cpp, StageEX.cpp, StageID.cpp, StageIF.cpp, StageMEM.cpp, StageWB.cpp) to streamline the pipeline architecture. - Added trace_symbols.txt for debugging and tracing purposes.
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.
Summary
Define.hpp(xlen_t,uxlen_t, shift/sign-extension helpers)Validation
cmake --build --preset ninja-clang-releasectest --test-dir build/ninja-clang-release --output-on-failure -L gateTracking