projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13de024
)
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>
Sat, 2 Oct 2021 14:58:16 +0000
(15:58 +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 9ddc7176d2723c951de062686bccffb2b8937200..6a1a05ee9d6beb5289a671a9745375c474d3a9a3 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)