From: Jean THOMAS Date: Fri, 24 Jul 2020 12:36:32 +0000 (+0200) Subject: Fix AntiStarvation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=814e70f888f65ed93859cd4ad58904e285d246e2;p=gram.git Fix AntiStarvation --- diff --git a/gram/core/multiplexer.py b/gram/core/multiplexer.py index 62bc7b2..789a07b 100644 --- a/gram/core/multiplexer.py +++ b/gram/core/multiplexer.py @@ -220,16 +220,18 @@ class _AntiStarvation(Elaboratable): if self._timeout > 0: time = Signal(range(self._timeout)) with m.If(~self.en): - m.d.sync += time.eq(self._timeout-1) + m.d.sync += [ + time.eq(self._timeout-1), + self.max_time.eq(0), + ] + with m.Elif(time != 0): + m.d.sync += [ + time.eq(time-1) + ] with m.If(time == 1): m.d.sync += self.max_time.eq(1) with m.Else(): m.d.sync += self.max_time.eq(0) - with m.Elif(time != 0): - m.d.sync += [ - time.eq(time-1), - self.max_time.eq(0), - ] else: m.d.comb += self.max_time.eq(0)