Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mmu unify - task1 #1724

Closed
wants to merge 79 commits into from
Closed
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
6aa0980
create mmu_unify folder
AngelaGonzalezMarino Nov 20, 2023
7b6d59f
first version of unified TLB
AngelaGonzalezMarino Nov 21, 2023
5a4a714
update data types related to unified mmu
AngelaGonzalezMarino Nov 21, 2023
2634865
undo last commit
AngelaGonzalezMarino Nov 21, 2023
7f180fc
modify data structures for mmu
AngelaGonzalezMarino Nov 21, 2023
1d2b65f
created first version of common shared tlb
AngelaGonzalezMarino Nov 22, 2023
3973054
cva6_tlb unified : dv-riscv-mmu-sv32-test.sh passes correctly
AngelaGonzalezMarino Nov 24, 2023
34a72cc
unify shared TLB - dv-riscv-mmu-sv32-test.sh passes correctly
AngelaGonzalezMarino Nov 24, 2023
65bf15b
unified PTW - dv-riscv-mmu-sv32-test.sh passes correctly
AngelaGonzalezMarino Nov 28, 2023
d8f7705
unified mmu top level - dv-riscv-mmu-sv32-test.sh passes correctly
AngelaGonzalezMarino Nov 29, 2023
7639846
fix errors in mmu
AngelaGonzalezMarino Nov 29, 2023
71a73c7
modify load_store_unit to instantiate unified mmu also for sv39
AngelaGonzalezMarino Nov 29, 2023
42a7362
add missing ASID_LEN Parameter at mmu and shared_tlb
AngelaGonzalezMarino Nov 29, 2023
835353c
correct multiple driver warnings
AngelaGonzalezMarino Nov 29, 2023
53705c4
test only tlb unified
AngelaGonzalezMarino Dec 1, 2023
bca87bc
correct double assignment to tags_n in TLB.
AngelaGonzalezMarino Dec 1, 2023
7f3e7df
complete MMU unified - sv32 boots linux, sv39 does not
AngelaGonzalezMarino Dec 4, 2023
bf3dd82
Correct size assignment for PTE
AngelaGonzalezMarino Dec 4, 2023
2e2ccd7
Correct tlb page_match order
AngelaGonzalezMarino Dec 6, 2023
ace52fe
correct req_port_o.data_size in ptw
AngelaGonzalezMarino Dec 6, 2023
891f9e8
top mmu with no shared tlb, common top with no common exceptions
AngelaGonzalezMarino Dec 6, 2023
888e49f
parameterize top no exceptions based on sv39 with no shared tlb
AngelaGonzalezMarino Dec 6, 2023
2a10823
change all mmu to "is_page" concept
AngelaGonzalezMarino Dec 6, 2023
bcbe49b
add common exceptions in top
AngelaGonzalezMarino Dec 6, 2023
53125fb
Revert "add common exceptions in top"
AngelaGonzalezMarino Dec 7, 2023
724227e
Revert "Revert "add common exceptions in top""
AngelaGonzalezMarino Dec 7, 2023
9ffe052
Revert "correct req_port_o.data_size in ptw"
AngelaGonzalezMarino Dec 7, 2023
11573d2
Revert "Revert "correct req_port_o.data_size in ptw""
AngelaGonzalezMarino Dec 7, 2023
2a9c97b
Revert "add common exceptions in top"
AngelaGonzalezMarino Dec 7, 2023
669208d
Revert "change all mmu to "is_page" concept"
AngelaGonzalezMarino Dec 7, 2023
23f5b10
Revert "parameterize top no exceptions based on sv39 with no shared tlb"
AngelaGonzalezMarino Dec 7, 2023
db49cf4
Revert "top mmu with no shared tlb, common top with no common excepti…
AngelaGonzalezMarino Dec 7, 2023
c1f50d8
common top sv39 with shared tlb
AngelaGonzalezMarino Dec 7, 2023
fd36bae
correct is_page assignment in shared tlb
AngelaGonzalezMarino Dec 7, 2023
6a4867d
Merge branch 'tmp' into mmu_unify
AngelaGonzalezMarino Dec 7, 2023
882b9df
Revert "Merge branch 'tmp' into mmu_unify"
AngelaGonzalezMarino Dec 7, 2023
6ea3a34
common top clean up
AngelaGonzalezMarino Dec 7, 2023
e44d91d
Merge branch 'tmp' into mmu_unify
AngelaGonzalezMarino Dec 7, 2023
e9336d0
Revert "Revert "top mmu with no shared tlb, common top with no common…
AngelaGonzalezMarino Dec 7, 2023
950cbb4
Revert "Revert "parameterize top no exceptions based on sv39 with no …
AngelaGonzalezMarino Dec 7, 2023
31fdec0
Revert "Revert "change all mmu to "is_page" concept""
AngelaGonzalezMarino Dec 7, 2023
b4e8616
Revert "Revert "add common exceptions in top""
AngelaGonzalezMarino Dec 7, 2023
499d271
common mmu unified sv39 and sv32
AngelaGonzalezMarino Dec 7, 2023
65668ab
correct page match assignment in shared tlb
AngelaGonzalezMarino Dec 7, 2023
0bb4d31
add missing itlb_req signal
AngelaGonzalezMarino Dec 7, 2023
48e0968
common top clean up and fix lsu ppn o assignment in top
AngelaGonzalezMarino Dec 13, 2023
9c95d3d
change cv64a6 config pkg (TLB=2)
AngelaGonzalezMarino Dec 13, 2023
698c9fa
Merge branch 'tmp' into mmu_unify
AngelaGonzalezMarino Dec 13, 2023
219ad69
parametrization compliance update and cleanup
AngelaGonzalezMarino Dec 13, 2023
ee54587
parametrization compliance and cleanup in packages
AngelaGonzalezMarino Dec 13, 2023
f9a106b
parametrization compliance and cleanup in modules
AngelaGonzalezMarino Dec 13, 2023
91ae8b9
definition of MMU parameters in LSU
AngelaGonzalezMarino Dec 13, 2023
257f6e0
update pte_cva6_t and tlb_update_cva6_t data types to support hypervi…
AngelaGonzalezMarino Dec 14, 2023
478ff59
translation parameterized and content in tlb_update_t data type dimen…
AngelaGonzalezMarino Dec 14, 2023
3e7f23f
complete tlb merge for sv39x4 v0
AngelaGonzalezMarino Dec 15, 2023
af0e57f
common tlb with hypervisor support
AngelaGonzalezMarino Dec 15, 2023
8e826b2
Revert "common tlb with hypervisor support"
AngelaGonzalezMarino Dec 15, 2023
6d8b0c3
Revert "complete tlb merge for sv39x4 v0"
AngelaGonzalezMarino Dec 15, 2023
fb94420
Revert "translation parameterized and content in tlb_update_t data ty…
AngelaGonzalezMarino Dec 15, 2023
d7a3512
Revert "update pte_cva6_t and tlb_update_cva6_t data types to support…
AngelaGonzalezMarino Dec 15, 2023
df50be2
Apply suggestions from code review
AngelaGonzalezMarino Dec 18, 2023
b8f6e77
Apply suggestions from code review
AngelaGonzalezMarino Dec 18, 2023
ce5a46e
Apply suggestions from code review
AngelaGonzalezMarino Dec 18, 2023
254378c
fixed linting issues
AngelaGonzalezMarino Dec 19, 2023
a10ba44
more linting issues
AngelaGonzalezMarino Dec 19, 2023
34e30d3
pragma linting
AngelaGonzalezMarino Dec 19, 2023
55681a4
linting
AngelaGonzalezMarino Dec 19, 2023
f2e90f4
top mmu linting
AngelaGonzalezMarino Dec 19, 2023
d4f2af0
more linting on cva6_mmu top
AngelaGonzalezMarino Dec 19, 2023
246f4c1
Update core/mmu_unify/cva6_tlb.sv
AngelaGonzalezMarino Dec 19, 2023
5a06eb1
more linting
AngelaGonzalezMarino Dec 19, 2023
0ed2a8d
Merge branch 'mmu_unify' of github.com:planvtech/cva6 into mmu_unify
AngelaGonzalezMarino Dec 19, 2023
c09b08c
linting
AngelaGonzalezMarino Dec 19, 2023
8fabb0c
lint
AngelaGonzalezMarino Dec 19, 2023
8ce746c
lint
AngelaGonzalezMarino Dec 19, 2023
944e453
remove unwanted comments
AngelaGonzalezMarino Dec 19, 2023
2d07184
lint
AngelaGonzalezMarino Dec 19, 2023
b026e76
Apply suggestions from code review
AngelaGonzalezMarino Dec 19, 2023
a2da3d6
Apply suggestions from code review
AngelaGonzalezMarino Dec 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,32 @@ sources:
- core/include/cv32a6_imac_sv0_config_pkg.sv
- core/include/riscv_pkg.sv
- core/include/ariane_pkg.sv
- core/mmu_sv32/cva6_tlb_sv32.sv
- core/mmu_sv32/cva6_mmu_sv32.sv
- core/mmu_unify/cva6_tlb.sv
- core/mmu_unify/cva6_mmu.sv
- core/mmu_sv32/cva6_ptw_sv32.sv
- core/mmu_unify/cva6_ptw.sv
- core/cva6_accel_first_pass_decoder_stub.sv

- target: cv32a6_imac_sv32
files:
- core/include/cv32a6_imac_sv32_config_pkg.sv
- core/include/riscv_pkg.sv
- core/include/ariane_pkg.sv
- core/mmu_sv32/cva6_tlb_sv32.sv
- core/mmu_sv32/cva6_mmu_sv32.sv
- core/mmu_unify/cva6_tlb.sv
- core/mmu_unify/cva6_mmu.sv
- core/mmu_sv32/cva6_ptw_sv32.sv
- core/mmu_unify/cva6_ptw.sv
- core/cva6_accel_first_pass_decoder_stub.sv

- target: cv32a6_imafc_sv32
files:
- core/include/cv32a6_imafc_sv32_config_pkg.sv
- core/include/riscv_pkg.sv
- core/include/ariane_pkg.sv
- core/mmu_sv32/cva6_tlb_sv32.sv
- core/mmu_sv32/cva6_mmu_sv32.sv
- core/mmu_unify/cva6_tlb.sv
- core/mmu_unify/cva6_mmu.sv
- core/mmu_sv32/cva6_ptw_sv32.sv
- core/mmu_unify/cva6_ptw.sv
- core/cva6_accel_first_pass_decoder_stub.sv

# included via target core/include/${TARGET_CFG}_config_pkg.sv
Expand Down
3 changes: 3 additions & 0 deletions ariane.core
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@ filesets:
- src/miss_handler.sv
- src/mmu_sv39/mmu.sv
- src/mmu_sv32/cva6_mmu_sv32.sv
- src/mmu_unify/cva6_mmu.sv
- src/mult.sv
- src/nbdcache.sv
- src/pcgen_stage.sv
- src/perf_counters.sv
- src/mmu_sv39/ptw.sv
- src/mmu_sv32/cva6_ptw_sv32.sv
- src/mmu_unify/cva6_ptw.sv
- src/regfile_ff.sv
- src/scoreboard.sv
- src/store_buffer.sv
- src/store_unit.sv
- src/mmu_sv39/tlb.sv
- src/mmu_sv32/cva6_tlb_sv32.sv
- src/mmu_unify/cva6_tlb.sv
file_type : systemVerilogSource
depend :
- pulp-platform.org::axi_mem_if
Expand Down
6 changes: 6 additions & 0 deletions core/Flist.cva6
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,10 @@ ${CVA6_REPO_DIR}/core/mmu_sv32/cva6_ptw_sv32.sv
${CVA6_REPO_DIR}/core/mmu_sv32/cva6_tlb_sv32.sv
${CVA6_REPO_DIR}/core/mmu_sv32/cva6_shared_tlb_sv32.sv

// MMU Unify
${CVA6_REPO_DIR}/core/mmu_unify/cva6_mmu.sv
${CVA6_REPO_DIR}/core/mmu_unify/cva6_tlb.sv
${CVA6_REPO_DIR}/core/mmu_unify/cva6_shared_tlb.sv
${CVA6_REPO_DIR}/core/mmu_unify/cva6_ptw.sv

// end of manifest
4 changes: 2 additions & 2 deletions core/include/cv64a6_imafdc_sv39_config_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ package cva6_config_pkg;
localparam CVA6ConfigNrStorePipeRegs = 0;
localparam CVA6ConfigNrLoadBufEntries = 2;

localparam CVA6ConfigInstrTlbEntries = 16;
localparam CVA6ConfigDataTlbEntries = 16;
localparam CVA6ConfigInstrTlbEntries = 2;
localparam CVA6ConfigDataTlbEntries = 2;

localparam CVA6ConfigRASDepth = 2;
localparam CVA6ConfigBTBEntries = 32;
Expand Down
43 changes: 11 additions & 32 deletions core/load_store_unit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -140,41 +140,20 @@ module load_store_unit
// -------------------
// MMU e.g.: TLBs/PTW
// -------------------
if (MMU_PRESENT && (riscv::XLEN == 64)) begin : gen_mmu_sv39
mmu #(
.CVA6Cfg (CVA6Cfg),
.INSTR_TLB_ENTRIES(ariane_pkg::INSTR_TLB_ENTRIES),
.DATA_TLB_ENTRIES (ariane_pkg::DATA_TLB_ENTRIES),
.ASID_WIDTH (ASID_WIDTH)
) i_cva6_mmu (
// misaligned bypass
.misaligned_ex_i(misaligned_exception),
.lsu_is_store_i (st_translation_req),
.lsu_req_i (translation_req),
.lsu_vaddr_i (mmu_vaddr),
.lsu_valid_o (translation_valid),
.lsu_paddr_o (mmu_paddr),
.lsu_exception_o(mmu_exception),
.lsu_dtlb_hit_o (dtlb_hit), // send in the same cycle as the request
.lsu_dtlb_ppn_o (dtlb_ppn), // send in the same cycle as the request
// connecting PTW to D$ IF
.req_port_i (dcache_req_ports_i[0]),
.req_port_o (dcache_req_ports_o[0]),
// icache address translation requests
.icache_areq_i (icache_areq_i),
.asid_to_be_flushed_i,
.vaddr_to_be_flushed_i,
.icache_areq_o (icache_areq_o),
.pmpcfg_i,
.pmpaddr_i,
.*
);
end else if (MMU_PRESENT && (riscv::XLEN == 32)) begin : gen_mmu_sv32
cva6_mmu_sv32 #(
if (MMU_PRESENT) begin : gen_mmu

localparam ASID_LEN = (riscv::XLEN == 64) ? 16 : 9;
localparam VPN_LEN = (riscv::XLEN == 64) ? 27 : 20;
localparam PT_LEVELS = (riscv::XLEN == 64) ? 3 : 2;

cva6_mmu #(
.CVA6Cfg (CVA6Cfg),
.INSTR_TLB_ENTRIES(ariane_pkg::INSTR_TLB_ENTRIES),
.DATA_TLB_ENTRIES (ariane_pkg::DATA_TLB_ENTRIES),
.ASID_WIDTH (ASID_WIDTH)
.ASID_WIDTH (ASID_WIDTH),
.ASID_LEN (ASID_LEN),
.VPN_LEN (VPN_LEN),
.PT_LEVELS (PT_LEVELS)
) i_cva6_mmu (
// misaligned bypass
.misaligned_ex_i(misaligned_exception),
Expand Down
1 change: 1 addition & 0 deletions core/mmu_unify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unification of MMUs: sv32, sv39 and sv39x4
Loading
Loading