From 51815f1d7530b6bd5458271092562b243f90f684 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Tue, 4 Aug 2020 15:45:37 +0200 Subject: [PATCH] Raise ValueError if anti-starvation timeout is unsupported (fixing #48) --- gram/core/multiplexer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gram/core/multiplexer.py b/gram/core/multiplexer.py index 37114dc..9de4b2b 100644 --- a/gram/core/multiplexer.py +++ b/gram/core/multiplexer.py @@ -206,6 +206,9 @@ class _Steerer(Elaboratable): class _AntiStarvation(Elaboratable): def __init__(self, timeout): + if timeout <= 2: + raise ValueError("Timeout values under 2 are not currently supported") + self.en = Signal() self.max_time = Signal(reset=1) self._timeout = timeout @@ -213,9 +216,6 @@ class _AntiStarvation(Elaboratable): def elaborate(self, platform): m = Module() - # TODO: timeout=1 fails formal checks - assert self._timeout != 1 - if self._timeout > 0: time = Signal(range(self._timeout)) with m.If(~self.en): -- 2.30.2