from nmigen.cli import verilog, rtlil
from math import log2
+
DCACHE_SET_ASSOC = 8
CONFIG_L1D_SIZE = 32*1024
DCACHE_INDEX_WIDTH = int(log2(CONFIG_L1D_SIZE / DCACHE_SET_ASSOC))
DCACHE_TAG_WIDTH = 56 - DCACHE_INDEX_WIDTH
+ASID_WIDTH = 8
+
class DCacheReqI:
def __init__(self):
return [ self.data_gnt, self.data_rvalid, self.data_rdata]
-ASID_WIDTH = 8
-
class PTE: #(RecordObject):
def __init__(self):
self.reserved = Signal(10)
m.d.comb += pte.flatten().eq(data_rdata)
# SV39 defines three levels of page tables
- ptw_lvl = Signal(2) # default=0=LVL1
+ ptw_lvl = Signal(2) # default=0=LVL1 on reset (see above)
ptw_lvl1 = Signal()
ptw_lvl2 = Signal()
ptw_lvl3 = Signal()