add SPR pipeline
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Jul 2020 11:56:42 +0000 (12:56 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 4 Jul 2020 11:56:42 +0000 (12:56 +0100)
src/soc/fu/spr/pipeline.py [new file with mode: 0644]

diff --git a/src/soc/fu/spr/pipeline.py b/src/soc/fu/spr/pipeline.py
new file mode 100644 (file)
index 0000000..fc3c7c2
--- /dev/null
@@ -0,0 +1,22 @@
+from nmutil.singlepipe import ControlBase
+from nmutil.pipemodbase import PipeModBaseChain
+from soc.fu.trap.main_stage import SPRMainStage
+
+class SPRStages(PipeModBaseChain):
+    def get_chain(self):
+        main = SPRMainStage(self.pspec)
+        return [main]
+
+
+class SPRBasePipe(ControlBase):
+    def __init__(self, pspec):
+        ControlBase.__init__(self)
+        self.pspec = pspec
+        self.pipe1 = SPRStages(pspec)
+        self._eqs = self.connect([self.pipe1])
+
+    def elaborate(self, platform):
+        m = ControlBase.elaborate(self, platform)
+        m.submodules.pipe = self.pipe1
+        m.d.comb += self._eqs
+        return m