projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a66c8a
)
remove Mux Value.cast before passing to 1st argument __Mux__
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Tue, 28 Sep 2021 12:14:10 +0000
(13:14 +0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Tue, 28 Sep 2021 12:14:10 +0000
(13:14 +0100)
only one case requires Mux to perform Value.cast, which is when the sel
argument is a python bool
nmigen/hdl/ast.py
patch
|
blob
|
history
diff --git
a/nmigen/hdl/ast.py
b/nmigen/hdl/ast.py
index 227bf604983c5a24a29c6e002861cfe0982d1b08..7b1fd8f7dd4144b8391c8acf161f37796125cf4d 100644
(file)
--- a/
nmigen/hdl/ast.py
+++ b/
nmigen/hdl/ast.py
@@
-732,9
+732,8
@@
class Operator(Value):
def Mux(sel, val1, val0):
- sel = Value.cast(sel)
- if len(sel) != 1:
- sel = sel.bool()
+ if isinstance(sel, bool): # one instance where Mux is passed an actual bool
+ sel = Value.cast(sel)
return sel.__Mux__(val1, val0)