From afafadffe4d59cc943ca6879c36ebe461add8120 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Tue, 4 Aug 2020 15:43:56 +0200 Subject: [PATCH] Raise ValueError if commands array isn't of len=4 (fixing #48) --- gram/core/multiplexer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gram/core/multiplexer.py b/gram/core/multiplexer.py index f59c389..37114dc 100644 --- a/gram/core/multiplexer.py +++ b/gram/core/multiplexer.py @@ -140,7 +140,9 @@ class _Steerer(Elaboratable): """ def __init__(self, commands, dfi): - assert len(commands) == 4 + if len(commands) != 4: + raise ValueError("Commands is not the right size") + self._commands = commands self._dfi = dfi self.sel = [Signal(range(len(commands))) for i in range(len(dfi.phases))] -- 2.30.2