From 396a8977217e40bee0eaa90ac4d927f26179835d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 14 Jun 2020 21:22:04 +0100 Subject: [PATCH] add optional LDSTFunctionUnit to compunits --- src/soc/fu/compunits/compunits.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/soc/fu/compunits/compunits.py b/src/soc/fu/compunits/compunits.py index 6b082d4e..1ffe7d8d 100644 --- a/src/soc/fu/compunits/compunits.py +++ b/src/soc/fu/compunits/compunits.py @@ -156,16 +156,20 @@ class AllFunctionUnits(Elaboratable): * type of FU required """ - def __init__(self): + def __init__(self, pi=None): self.fus = {} for (name, qty, kls) in (('alu', 1, ALUFunctionUnit), ('cr', 1, CRFunctionUnit), ('branch', 1, BranchFunctionUnit), ('logical', 1, LogicalFunctionUnit), - ('shiftrot', 1, ShiftRotFunctionUnit) + ('shiftrot', 1, ShiftRotFunctionUnit), ): for i in range(qty): self.fus["%s%d" % (name, i)] = kls() + if pi is None: + return + for i in enumerate(pi): + self.fus["ldst%d" % (i)] = LDSTFunctionUnit(pi[i]) def elaborate(self, platform): m = Module() -- 2.30.2