From 3aa79846506ba2fc23d526a50ec38108f4f5232c Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Sun, 10 Jan 2021 14:05:03 +0100 Subject: [PATCH] add microwatt mmu config option to compunits.py --- src/soc/experiment/memory_types.org | 16 ++++++++++++++++ src/soc/fu/compunits/compunits.py | 13 ++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 src/soc/experiment/memory_types.org diff --git a/src/soc/experiment/memory_types.org b/src/soc/experiment/memory_types.org new file mode 100644 index 00000000..2e9aede6 --- /dev/null +++ b/src/soc/experiment/memory_types.org @@ -0,0 +1,16 @@ +* MMU +| MMUToLoadStore1Type (l_out) | LoadStore1ToMMUType (l_in) | +| MMUToDCacheType (d_out) | DCacheToMMUType (d_in) | +| MMUToICacheType NC (i_out) | None | + +* DCache +| DCacheToLoadStore1Type (d_out) | LoadStore1ToDCacheType (d_in) | +| DCacheToMMUType (m_out) | MMUToDCacheType (m_in) | +| WBMasterOut (wb_out) | WBSlaveOut (wb_in) | +| stall_out | None | + +* Loadstore1 -- microwatt only +| Loadstore1ToMmuType (m_out) | MmuToLoadstore1Type (m_in) | +| Loadstore1ToDcacheType (d_out) | DcacheToLoadstore1Type (d_in) | +| Loadstore1ToWritebackType (l_out) | Execute1ToLoadstore1Type (l_in) | +| Loadstore1ToExecute1Type (e_out) | None | diff --git a/src/soc/fu/compunits/compunits.py b/src/soc/fu/compunits/compunits.py index 096cda34..de88bffd 100644 --- a/src/soc/fu/compunits/compunits.py +++ b/src/soc/fu/compunits/compunits.py @@ -225,7 +225,6 @@ class LDSTFunctionUnit(LDSTCompUnit): # TODO: ReservationStations-based. - # simple one-only function unit class, for test purposes class AllFunctionUnits(Elaboratable): """AllFunctionUnits @@ -239,7 +238,7 @@ class AllFunctionUnits(Elaboratable): """ - def __init__(self, pspec, pilist=None, div_fsm=True): + def __init__(self, pspec, pilist=None, div_fsm=True,microwatt_mmu = True): addrwid = pspec.addr_wid units = pspec.units if not isinstance(units, dict): @@ -247,8 +246,9 @@ class AllFunctionUnits(Elaboratable): 'spr': 1, 'logical': 1, 'mul': 1, - #'mmu': 1, 'div': 1, 'shiftrot': 1} + if microwatt_mmu: + units['mmu'] = 1 alus = {'alu': ALUFunctionUnit, 'cr': CRFunctionUnit, 'branch': BranchFunctionUnit, @@ -269,6 +269,13 @@ class AllFunctionUnits(Elaboratable): kls = alus[name] for i in range(qty): self.fus["%s%d" % (name, i)] = kls(i) + if microwatt_mmu: + print("cut here ==============================") + alu = self.fus["mmu0"].alu + print("alu",alu) + pi = alu.pi + print("pi",pi) + pilist = [pi] if pilist is None: return for i, pi in enumerate(pilist): -- 2.30.2