create eq_from function based on eq_from_execute1
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 7 Sep 2020 21:01:01 +0000 (22:01 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 7 Sep 2020 21:14:45 +0000 (22:14 +0100)
src/soc/fu/base_input_record.py

index 50c5958bf9fe843f417103447e3b2e8f47927a84..e39daef89a647da3e110ce03d215dfb721fe40b0 100644 (file)
@@ -21,17 +21,22 @@ class CompOpSubsetBase(Record):
         for fname, sig in self.fields.items():
             sig.reset_less = True
 
-    def eq_from_execute1(self, other):
-        """ use this to copy in from Decode2Execute1Type
+    def eq_from(self, other):
+        """ use this to copy in from another CompRecord
         """
         res = []
-        print ("eq_from_execute self", self, self.fields)
-        print ("                other", other, other.fields)
+        print ("eq_from self", self, self.fields)
+        print ("        other", other, other.fields)
         for fname, sig in self.fields.items():
-            eqfrom = other.do.fields[fname]
+            eqfrom = other.fields[fname]
             res.append(sig.eq(eqfrom))
         return res
 
+    def eq_from_execute1(self, other):
+        """ use this to copy in from Decode2Execute1Type
+        """
+        return self.eq_from(other.do)
+
     def ports(self):
         res = []
         for fname, sig in self.fields.items():