Fix tXXDController (was overflowing)
authorJean THOMAS <git0@pub.jeanthomas.me>
Fri, 24 Jul 2020 13:49:17 +0000 (15:49 +0200)
committerJean THOMAS <git0@pub.jeanthomas.me>
Fri, 24 Jul 2020 13:49:17 +0000 (15:49 +0200)
gram/common.py

index 0c0503bc6be3b78b84fb89be4a699a1c3a1358f5..e43bb74b274a8b132392e25a5ab0b495d4630d6f 100644 (file)
@@ -238,7 +238,7 @@ class tXXDController(Elaboratable):
                     count.eq(self._txxd-1),
                     self.ready.eq((self._txxd - 1) == 0),
                 ]
-            with m.Else():
+            with m.Elif(~self.ready):
                 m.d.sync += count.eq(count-1)
                 with m.If(count == 1):
                     m.d.sync += self.ready.eq(1)