projects
/
nmutil.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
24fb96b
)
use bit_length rather than log2_int function in mask.py
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 5 Jan 2022 14:14:29 +0000
(14:14 +0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 5 Jan 2022 14:23:20 +0000
(14:23 +0000)
src/nmutil/mask.py
patch
|
blob
|
history
diff --git
a/src/nmutil/mask.py
b/src/nmutil/mask.py
index 4a04862afe99dd7c1dcaf225dfd1c89df5935ff3..dc2f05d59f4e460b2692798cc749142b2abb933e 100644
(file)
--- a/
src/nmutil/mask.py
+++ b/
src/nmutil/mask.py
@@
-17,14
+17,14
@@
def masked(m_out, m_in, mask):
class Mask(Elaboratable):
def __init__(self, sz):
self.sz = sz
- self.shift = Signal(
log2_int(sz, False
)+1)
+ self.shift = Signal(
sz.bit_length(
)+1)
self.mask = Signal(sz)
def elaborate(self, platform):
m = Module()
for i in range(self.sz):
- with m.If(
self.shift > i
):
+ with m.If(
i < self.shift
):
m.d.comb += self.mask[i].eq(1)
return m