Skip to content

feat(MMU): add ptehelper support#6115

Open
fuhuakai wants to merge 3 commits into
kunminghu-v3from
dev-mmu-newptehelper
Open

feat(MMU): add ptehelper support#6115
fuhuakai wants to merge 3 commits into
kunminghu-v3from
dev-mmu-newptehelper

Conversation

@fuhuakai

Copy link
Copy Markdown

Add ptehelper as a DPI-C backed ideal translation path for MMU
simulation studies. The feature can bypass selected hardware
translation structures and use a software page-table walk model to
evaluate the MMU translation performance upper bound.

softTLB replaces the L1 TLB storage with TLBFakeFA. The fake storage
returns a registered helper result on the cycle after a valid request
when translation is enabled, and it does not take the normal TLB miss
and refill path.

softPTW replaces the normal L2TLB implementation at the L2TLBWrapper
boundary with FakePTW. From the L1 TLB side this bypasses the L2TLB,
page-table cache, and PTW miss path, while still returning the normal
L2TLBIO response format.

Add PTEHelper, PteHelperResult, and shared response builders so the
softTLB and softPTW paths use the same PPN, permission, PBMT, NAPOT,
and stage-fault construction. The helper covers Sv39, Sv48, Sv39x4,
Sv48x4, PBMTE-gated PBMT checks, and two-stage translation results.

The softPTW path also avoids instantiating the normal PTW-to-L2 buffer
module in the reset tree when the normal L2TLB path is disabled.

The feature is controlled by the existing softTLB and softPTW fields in
core parameters. Both flags stay disabled by default.

Without enabling softtlb/softptw, it will not affect any of the original hardware logic.

Validated with rvh-test using softTLB and softPTW modes. Both modes
pass all rvh-test cases, including PBMT tests.

@github-actions github-actions Bot added module: backend Decode, Rename, Issue, Dispatch, Rob, Alu, Csr, fudian, yunsuan module: memory Memblock, DCache, TLB, Prefetcher, coupledL2, huancun module: tool non-RTL tools like difftest, gsim, XSpdb, Makefiles, scripts, CI/CD, etc. module: top XSTop, XSTile, XSParameters, configs note: submodule bump (PR) For maintainer: this bumps submodule, merge carefully labels Jun 21, 2026
@fuhuakai fuhuakai changed the title Dev mmu newptehelper feat(MMU): add ptehelper support Jun 21, 2026
@fuhuakai fuhuakai force-pushed the dev-mmu-newptehelper branch from c05f99e to 6afd69f Compare June 21, 2026 08:42
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

Emu - Performance Summary

Metadata

- SHA Run ID
Base 6ae5922 27927664847
Current 510d9ce 27934734350

IPC Report

Testcase Current Base Diff
GemsFDTD_49458 1.409746 1.409746 0.00%
astar_rivers_8728 2.372170 2.372170 0.00%
bwaves_30350 1.041790 1.041790 0.00%
bzip2_liberty_739 7.377151 7.377151 0.00%
cactusADM_61235 4.172546 4.172546 0.00%
calculix_53456 5.398508 5.398508 0.00%
dealII_13061 4.131362 4.131362 0.00%
gamess_gradient_36450 4.977463 4.977463 0.00%
gcc_s04_2772 2.196413 2.196413 0.00%
gobmk_nngs_453 0.759231 0.759231 0.00%
gromacs_2907 2.056058 2.056058 0.00%
h264ref_foreman.main_10053 4.345778 4.345778 0.00%
hmmer_nph3_33214 5.817051 5.817051 0.00%
lbm_31064 2.562678 2.562678 0.00%
legacy-astar 2.146882 2.146882 0.00%
legacy-gcc 1.529400 1.529400 0.00%
legacy-gromacs 3.055066 3.055066 0.00%
legacy-lbm 2.653707 2.653707 0.00%
legacy-mcf 1.184062 1.184062 0.00%
legacy-milc 1.865202 1.865202 0.00%
legacy-namd 3.698539 3.698539 0.00%
legacy-wrf 2.736658 2.736658 0.00%
legacy-xalancbmk 3.996149 3.996149 0.00%
leslie3d_37552 2.086055 2.086055 0.00%
libquantum_81539 5.215192 5.215192 0.00%
mcf_6388 0.479663 0.479663 0.00%
milc_7124 2.685394 2.685394 0.00%
namd_75757 3.390937 3.390937 0.00%
omnetpp_14042 0.882012 0.882012 0.00%
perlbench_splitmail_3995 4.272481 4.272481 0.00%
povray_8362 2.790397 2.790397 0.00%
sjeng_64284 2.163443 2.163443 0.00%
soplex_ref_10774 4.285583 4.285583 0.00%
sphinx3_141036 3.929923 3.929923 0.00%
tonto_69015 4.221856 4.221856 0.00%
wrf_112496 2.429316 2.429316 0.00%
xalancbmk_9874 3.236085 3.236085 0.00%
zeusmp_45598 3.357401 3.357401 0.00%
GEOMEAN 2.653599709870023 2.653599709870023 0.00%

fuhuakai added 3 commits June 22, 2026 14:45
Update the difftest submodule to the ptehelper DPI model used by the
MMU simulation helper.

The bumped difftest commit provides the PTEHelper Verilog wrapper, the
pte_helper C++ walk model, PBMT and NAPOT fault handling, and TLB
checker diagnostic output needed by the matching RTL change.

This commit only updates the submodule gitlink. The actual RTL support
is added in the next commit.
Add ptehelper as a DPI-C backed ideal translation path for MMU
simulation studies. The feature can bypass selected hardware
translation structures and use a software page-table walk model to
evaluate the MMU translation performance upper bound.

softTLB replaces the L1 TLB storage with TLBFakeFA. The fake storage
returns a registered helper result on the cycle after a valid request
when translation is enabled, and it does not take the normal TLB miss
and refill path.

softPTW replaces the normal L2TLB implementation at the L2TLBWrapper
boundary with FakePTW. From the L1 TLB side this bypasses the L2TLB,
page-table cache, and PTW miss path, while still returning the normal
L2TLBIO response format.

Add PTEHelper, PteHelperResult, and shared response builders so the
softTLB and softPTW paths use the same PPN, permission, PBMT, NAPOT,
and stage-fault construction. The helper covers Sv39, Sv48, Sv39x4,
Sv48x4, PBMTE-gated PBMT checks, and two-stage translation results.

The softPTW path also avoids instantiating the normal PTW-to-L2 buffer
module in the reset tree when the normal L2TLB path is disabled.

The feature is controlled by the existing softTLB and softPTW fields in
core parameters. Both flags stay disabled by default.

Validated with rvh-test using softTLB and softPTW modes. Both modes
pass all rvh-test cases, including PBMT tests.
Rename the misspelled EnbaleTlbDebug parameter and its users to EnableTlbDebug. This keeps the debug switch name readable without changing the generated logic.
@fuhuakai fuhuakai force-pushed the dev-mmu-newptehelper branch from 6afd69f to 510d9ce Compare June 22, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: backend Decode, Rename, Issue, Dispatch, Rob, Alu, Csr, fudian, yunsuan module: memory Memblock, DCache, TLB, Prefetcher, coupledL2, huancun module: tool non-RTL tools like difftest, gsim, XSpdb, Makefiles, scripts, CI/CD, etc. module: top XSTop, XSTile, XSParameters, configs note: submodule bump (PR) For maintainer: this bumps submodule, merge carefully

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant