From: Sebastien Bourdeauducq Date: Thu, 17 Sep 2015 09:22:24 +0000 (+0800) Subject: fhdl/structure: all case statements should be lists X-Git-Tag: 24jan2021_ls180~2099^2~3^2~80 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=776579f0d7d029a545134e023d8a8b68f8b27815;p=litex.git fhdl/structure: all case statements should be lists --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index e3faae51..ba72f09b 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -547,6 +547,8 @@ class Case(_Statement): if (not isinstance(k, Constant) and not (isinstance(k, str) and k == "default")): raise TypeError("Case object is not a Migen constant") + if not isinstance(v, _collections.Iterable): + v = [v] if not _check_statement(v): raise TypeError("Not all objects for case {} " "are Migen statements".format(k))