fhdl/structure: all case statements should be lists
This commit is contained in:
parent
bcf62997f6
commit
776579f0d7
|
@ -547,6 +547,8 @@ class Case(_Statement):
|
||||||
if (not isinstance(k, Constant)
|
if (not isinstance(k, Constant)
|
||||||
and not (isinstance(k, str) and k == "default")):
|
and not (isinstance(k, str) and k == "default")):
|
||||||
raise TypeError("Case object is not a Migen constant")
|
raise TypeError("Case object is not a Migen constant")
|
||||||
|
if not isinstance(v, _collections.Iterable):
|
||||||
|
v = [v]
|
||||||
if not _check_statement(v):
|
if not _check_statement(v):
|
||||||
raise TypeError("Not all objects for case {} "
|
raise TypeError("Not all objects for case {} "
|
||||||
"are Migen statements".format(k))
|
"are Migen statements".format(k))
|
||||||
|
|
Loading…
Reference in New Issue