Open
Conversation
7ef0a9e to
5bcbfbf
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for TLB (Translation Lookaside Buffer) management in the microarchitecture by implementing new ECALL functions and updating memory layout to include a shadow TLB region.
Key changes:
- Implements new ECALL functions for TLB writes, dirty page marking, and updates PUTCHAR parameter usage
- Introduces shadow TLB memory region (AR_SHADOW_TLB_START/LENGTH) in addition to existing shadow UArch region
- Renames constants from PMA_CMIO_* to AR_CMIO_* and TREE_* to HASH_TREE_* for consistency
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/UArchStep.sol | Implements UARCH_ECALL_FN_WRITE_TLB, UARCH_ECALL_FN_MARK_DIRTY_PAGE ecalls; fixes PUTCHAR argument register; adds insn/pc parameters to fence/ecall/ebreak functions |
| src/EmulatorCompat.sol | Adds writeTlbECALL function with TLB slot computation and writeRegion support; refactors halt flag handling; renames putChar to putCharECALL |
| src/AccessLogs.sol | Adds writeRegion overload accepting bytes parameter; removes unused readRegion/readLeaf functions |
| templates/AccessLogs.sol.template | Implements writeRegion for bytes data; updates memory layout to include shadow TLB region in accessWord function |
| src/EmulatorConstants.sol | Adds AR_SHADOW_TLB_, UARCH_CYCLE_MAX, TLB_, new ECALL constants; renames PMA_CMIO_* to AR_CMIO_* and TREE_* to HASH_TREE_* |
| templates/EmulatorConstants.sol.template | Adds TLB_SLOT_LENGTH, TLB_SET_SIZE, TLB_SET_LENGTH constants |
| src/SendCmioResponse.sol | Updates references from PMA_CMIO_* to AR_CMIO_* and TREE_* to HASH_TREE_* |
| test/UArchInterpret.t.sol | Updates test buffer size calculation to include AR_SHADOW_TLB_LENGTH; fixes halt flag and cycle assertion parameter order |
| helper_scripts/generate_*.sh | Updates code generation scripts to reflect constant renamings |
| helper_scripts/generate_EmulatorConstants.lua | Adds generation of new constants from Lua cartesi module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GCdePaula
reviewed
Nov 15, 2025
Contributor
GCdePaula
left a comment
There was a problem hiding this comment.
I've left some comments!
e19a6fe to
e182594
Compare
e182594 to
796f439
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 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.
Uh oh!
There was an error while loading. Please reload this page.