okaaay add a "rdflags" function which obtains the yes/no flags for each register...
[soc.git] / src / soc / fu / compunits / compunits.py
index d40549d5324dc50ef38e6ba88e1bca9a42dd6451..203055ad1cf3e3f1eabf0e80d93ad3157fe0c6c6 100644 (file)
@@ -40,6 +40,7 @@ see:
 
 """
 
+from nmigen import Cat
 from nmigen.cli import rtlil
 from soc.experiment.compalu_multi import MultiCompUnit
 
@@ -78,6 +79,10 @@ class FunctionUnitBaseSingle(MultiCompUnit):
     note that it is through MultiCompUnit.get_in/out that we *actually*
     connect up the association between regspec variable names (defined
     in the pipe_data).
+
+    note that the rdflags function obtains (dynamically, from instruction
+    decoding) which read-register ports are to be requested.  this is not
+    ideal (it could be a lot neater) but works for now.
     """
     def __init__(self, speckls, pipekls):
         pspec = speckls(id_wid=2)                # spec (NNNPipeSpec instance)
@@ -86,6 +91,10 @@ class FunctionUnitBaseSingle(MultiCompUnit):
         alu = pipekls(pspec)                     # create actual NNNBasePipe
         super().__init__(regspec, alu, opsubset) # pass to MultiCompUnit
 
+    def rdflags(self, e):
+        print (dir(self.alu))
+        return self.alu.pspec.rdflags(e)
+
 
 ##############################################################
 # TODO: ReservationStations-based (FunctionUnitBaseConcurrent)
@@ -112,6 +121,7 @@ class BranchFunctionUnit(FunctionUnitBaseSingle):
 class ShiftRotFunctionUnit(FunctionUnitBaseSingle):
     def __init__(self): super().__init__(ShiftRotPipeSpec, ShiftRotBasePipe)
 
+
 #####################################################################
 ###### actual Function Units: these are "multi" stage pipelines #####