projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58e1cda
)
icache.py fix ispow2() util fn per https://bugs.libre-soc.org/show_bug.cgi?id=485#c53
author
Cole Poirier
<colepoirier@gmail.com>
Mon, 5 Oct 2020 16:44:36 +0000
(09:44 -0700)
committer
Cole Poirier
<colepoirier@gmail.com>
Mon, 5 Oct 2020 16:44:36 +0000
(09:44 -0700)
src/soc/experiment/icache.py
patch
|
blob
|
history
diff --git
a/src/soc/experiment/icache.py
b/src/soc/experiment/icache.py
index 00697f6c6d67f274b139acdb302f007e24c8f765..06031af0268862ac5f862d281a1945bf833e7013 100644
(file)
--- a/
src/soc/experiment/icache.py
+++ b/
src/soc/experiment/icache.py
@@
-140,7
+140,7
@@
print("WAY_BITS =", WAY_BITS)
# from microwatt/utils.vhdl
def ispow2(n):
- return
((n << 32) & ((n-1) << 32
)) == 0
+ return
n != 0 and (n & (n - 1
)) == 0
assert LINE_SIZE % ROW_SIZE == 0
assert ispow2(LINE_SIZE), "LINE_SIZE not power of 2"