update comments
[ieee754fpu.git] / src / add / stageapi.py
index dd969ae4ab3fc76d0404e9b7abd41c7c9cfae78d..9651bf79fe778f1b26aa510d8a0f5d6c0800778d 100644 (file)
     of the incoming and outgoing data, and they provide a means to
     PROCESS that data (from incoming format to outgoing format).
 
-    Stage Blocks really must be combinatorial blocks.  It would be ok
-    to have input come in from sync'd sources (clock-driven) however by
-    doing so they would no longer be deterministic, and chaining such
-    blocks with such side-effects together could result in unexpected,
-    unpredictable, unreproduceable behaviour.
+    Stage Blocks really should be combinatorial blocks (Moore FSMs).
+    It would be ok to have input come in from sync'd sources
+    (clock-driven, Mealy FSMs) however by doing so they would no longer
+    be deterministic, and chaining such blocks with such side-effects
+    together could result in unexpected, unpredictable, unreproduceable
+    behaviour.
+
     So generally to be avoided, then unless you know what you are doing.
+    https://en.wikipedia.org/wiki/Moore_machine
+    https://en.wikipedia.org/wiki/Mealy_machine
 
     the methods of a stage instance must be as follows:
 
@@ -174,7 +178,8 @@ class StageHelper(Stage):
     def new_specs(self, name):
         """ allocates new ispec and ospec pair
         """
-        return self.ispec("%s_i" % name), self.ospec("%s_o" % name)
+        return (_spec(self.ispec, "%s_i" % name),
+                _spec(self.ospec, "%s_o" % name))
 
     def process(self, i):
         if self.stage and hasattr(self.stage, "process"):