Skip to content

feat: interpreter update#83

Open
mpernambuco wants to merge 2 commits intomainfrom
interpreter-update
Open

feat: interpreter update#83
mpernambuco wants to merge 2 commits intomainfrom
interpreter-update

Conversation

@mpernambuco
Copy link
Contributor

@mpernambuco mpernambuco commented Nov 9, 2025

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@GCdePaula GCdePaula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some comments!

@mpernambuco mpernambuco force-pushed the interpreter-update branch 2 times, most recently from e19a6fe to e182594 Compare November 15, 2025 23:40
@edubart edubart added the enhancement New feature or request label Nov 25, 2025
@edubart edubart moved this from Todo to Waiting Review in Machine Unit Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Waiting Review

Development

Successfully merging this pull request may close these issues.

3 participants