You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 1. HPTW threw an exception -> signal with a page fault exception
371
371
// 2. We got an access error because of insufficient permissions -> throw an access exception
@@ -382,9 +382,12 @@ module cva6_mmu
382
382
// AXI decode error), or when PTW performs walk due to ITLB miss and raises
383
383
// an error.
384
384
if ((enable_translation_i || enable_g_translation_i)) begin
385
-
// we work with SV39 or SV32, so if VM is enabled, check that all bits [CVA6Cfg.VLEN-1:CVA6Cfg.SV-1] are equal
386
-
if (icache_areq_i.fetch_req &&!((&icache_areq_i.fetch_vaddr[CVA6Cfg.VLEN-1:CVA6Cfg.SV-1]) ==1'b1|| (|icache_areq_i.fetch_vaddr[CVA6Cfg.VLEN-1:CVA6Cfg.SV-1]) ==1'b0)) begin
387
-
385
+
// If second-level address translation is enabled:
386
+
// - in VS stage, check that all bits [CVA6Cfg.VLEN-1:CVA6Cfg.SV-1] are equal
387
+
// - in pure G stage (SV39x4 mode), [CVA6Cfg.VLEN-1:CVA6Cfg.GPLEN] must be zero.
388
+
// - in pure G stage (SV32x4 mode), no check is needed.
389
+
if ((enable_translation_i && (icache_areq_i.fetch_req &&!((&icache_areq_i.fetch_vaddr[CVA6Cfg.VLEN-1:CVA6Cfg.SV-1]) ==1'b1|| (|icache_areq_i.fetch_vaddr[CVA6Cfg.VLEN-1:CVA6Cfg.SV-1]) ==1'b0)))
390
+
|| (enable_g_translation_i &&!enable_translation_i && CVA6Cfg.IS_XLEN64&& (|icache_areq_i.fetch_vaddr[CVA6Cfg.VLEN-1:CVA6Cfg.GPLEN] !=1'b0))) begin
0 commit comments