add DIV function unit to compunits
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 2 Jul 2020 18:28:10 +0000 (19:28 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 2 Jul 2020 18:28:10 +0000 (19:28 +0100)
src/soc/fu/compunits/compunits.py

index 2fadd8c58ca00df8386d0cae756f8ab57a53cd63..98520022d6fd8d7e618b59b5e409e64f174f6636 100644 (file)
@@ -67,6 +67,9 @@ from soc.fu.shift_rot.pipe_data import ShiftRotPipeSpec
 from soc.fu.trap.pipeline import TrapBasePipe
 from soc.fu.trap.pipe_data import TrapPipeSpec
 
+from soc.fu.div.pipeline import DIVBasePipe
+from soc.fu.div.pipe_data import DIVPipeSpec
+
 from soc.fu.ldst.pipe_data import LDSTPipeSpec
 from soc.experiment.compldst_multi import LDSTCompUnit # special-case
 
@@ -131,6 +134,10 @@ class ShiftRotFunctionUnit(FunctionUnitBaseSingle):
     fnunit = Function.SHIFT_ROT
     def __init__(self): super().__init__(ShiftRotPipeSpec, ShiftRotBasePipe)
 
+class DIVFunctionUnit(FunctionUnitBaseSingle):
+    fnunit = Function.DIV
+    def __init__(self): super().__init__(DIVPipeSpec, DIVBasePipe)
+
 class TrapFunctionUnit(FunctionUnitBaseSingle):
     fnunit = Function.TRAP
     def __init__(self): super().__init__(TrapPipeSpec, TrapBasePipe)
@@ -169,6 +176,7 @@ class AllFunctionUnits(Elaboratable):
                                  ('cr', 1, CRFunctionUnit),
                                  ('branch', 1, BranchFunctionUnit),
                                  ('trap', 1, TrapFunctionUnit),
+                                 ('div', 1, DIVFunctionUnit),
                                  ('logical', 1, LogicalFunctionUnit),
                                  ('shiftrot', 1, ShiftRotFunctionUnit),
                                 ):