genlib.cdc.MultiReg: self.regs should be a private field.
authorwhitequark <cz@m-labs.hk>
Wed, 12 Dec 2018 10:52:32 +0000 (10:52 +0000)
committerwhitequark <cz@m-labs.hk>
Wed, 12 Dec 2018 10:52:32 +0000 (10:52 +0000)
nmigen/genlib/cdc.py

index c7d77e7993d4f62d2870e02e00a27433dd5de44d..122dcbce79a6c2fa29f1c594d43a49f7826f32e8 100644 (file)
@@ -10,13 +10,13 @@ class MultiReg(Module):
         self.o = o
         self.odomain = odomain
 
-        self.regs = [Signal(self.i.bits_sign(), name="cdc{}".format(i),
-                            reset=reset, reset_less=True)#, attrs=("no_retiming",))
-                     for i in range(n)]
+        self._regs = [Signal(self.i.bits_sign(), name="cdc{}".format(i),
+                             reset=reset, reset_less=True)#, attrs=("no_retiming",))
+                      for i in range(n)]
 
     def get_fragment(self, platform):
         f = Module()
-        for i, o in zip((self.i, *self.regs), self.regs):
+        for i, o in zip((self.i, *self._regs), self._regs):
             f.sync[self.odomain] += o.eq(i)
-        f.comb += self.o.eq(self.regs[-1])
+        f.comb += self.o.eq(self._regs[-1])
         return f.lower(platform)