From: Yann Sionneau Date: Mon, 27 Oct 2014 11:41:17 +0000 (+0100) Subject: Raise exception when not using correct boolean operators X-Git-Tag: 24jan2021_ls180~2099^2~280 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=286092b62e69de90449865c206d59994f63be12d;p=litex.git Raise exception when not using correct boolean operators --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 2859345d..071ae23c 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -24,6 +24,9 @@ class Value(HUID): Values created from integers have the minimum bit width to necessary to represent the integer. """ + def __bool__(self): + raise NotImplementedError("For boolean operations between expressions: use '&'/'|' instead of 'and'/'or'") + def __invert__(self): return _Operator("~", [self]) def __neg__(self):