add CommonPipeSpec.__getattr__ to forward attributes from parent_pspec
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 9 Dec 2021 04:00:45 +0000 (20:00 -0800)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 9 Dec 2021 04:00:45 +0000 (20:00 -0800)
replaces CommonPipeSpec.draft_bitmanip

src/soc/fu/pipe_data.py

index d48cf4c3456b2e9f620f91948921a4857890c41d..dc17150c3714f8fed2b0e3ef756fdeefa1e7b9f9 100644 (file)
@@ -81,9 +81,12 @@ class CommonPipeSpec:
         self.opkls = lambda _: self.opsubsetkls()
         self.op_wid = get_rec_width(self.opkls(None))  # hmm..
         self.stage = None
-        self.draft_bitmanip = False
         self.parent_pspec = parent_pspec
 
+    # forward attributes from parent_pspec
+    def __getattr__(self, name):
+        return getattr(self.parent_pspec, name)
+
 
 def get_pspec_draft_bitmanip(pspec):
     """ True if the draft bitmanip instructions are enabled in the provided