add link to regspecs on wiki
[soc.git] / src / soc / fu / pipe_data.py
index 764de09fbda099faccf957cd132fdd5eb73e999f..3ceab14a1d69704b638f8a54ab323958b937727a 100644 (file)
@@ -1,4 +1,5 @@
 from ieee754.fpcommon.getop import FPPipeContext
+from nmutil.dynamicpipe import SimpleHandshakeRedir
 
 
 class IntegerData:
@@ -15,3 +16,21 @@ class IntegerData:
 
     def ports(self):
         return self.ctx.ports()
+
+# hmmm there has to be a better way than this
+def get_rec_width(rec):
+    recwidth = 0
+    # Setup random inputs for dut.op
+    for p in rec.ports():
+        width = p.width
+        recwidth += width
+    return recwidth
+
+
+class CommonPipeSpec:
+    def __init__(self, id_wid):
+        self.pipekls = SimpleHandshakeRedir
+        self.id_wid = id_wid
+        self.opkls = lambda _: self.opsubsetkls(name="op")
+        self.op_wid = get_rec_width(self.opkls(None)) # hmm..
+        self.stage = None