From 12f95410db85ecd83e3adc2364f232384b38e2f3 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 19 Jun 2020 02:44:24 +0100 Subject: [PATCH] parameterise LoadStoreUnitInterface to be expandable --- src/soc/minerva/units/loadstore.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/soc/minerva/units/loadstore.py b/src/soc/minerva/units/loadstore.py index b081de82..b14bbbd7 100644 --- a/src/soc/minerva/units/loadstore.py +++ b/src/soc/minerva/units/loadstore.py @@ -11,14 +11,14 @@ __all__ = ["LoadStoreUnitInterface", "BareLoadStoreUnit", class LoadStoreUnitInterface: - def __init__(self): + def __init__(self, addr_wid=32, mask_wid=4, data_wid=32): self.dbus = Record(wishbone_layout) - self.x_addr = Signal(32) - self.x_mask = Signal(4) + self.x_addr = Signal(addr_wid) + self.x_mask = Signal(mask_wid) self.x_load = Signal() self.x_store = Signal() - self.x_store_data = Signal(32) + self.x_store_data = Signal(data_wid) self.x_stall = Signal() self.x_valid = Signal() self.m_stall = Signal() @@ -26,10 +26,10 @@ class LoadStoreUnitInterface: self.x_busy = Signal() self.m_busy = Signal() - self.m_load_data = Signal(32) + self.m_load_data = Signal(data_wid) self.m_load_error = Signal() self.m_store_error = Signal() - self.m_badaddr = Signal(30) + self.m_badaddr = Signal(addr_wid-log2_int(mask_wid)) class BareLoadStoreUnit(LoadStoreUnitInterface, Elaboratable): -- 2.30.2