projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f69e59a
)
Number of bits for an Index is the Ceiling of the log2 of its upperbound, not the...
author
christiaanb
<christiaan.baaij@gmail.com>
Wed, 23 Jun 2010 10:07:34 +0000
(12:07 +0200)
committer
christiaanb
<christiaan.baaij@gmail.com>
Wed, 23 Jun 2010 10:07:34 +0000
(12:07 +0200)
clash/CLasH/VHDL/Generate.hs
patch
|
blob
|
history
diff --git
a/clash/CLasH/VHDL/Generate.hs
b/clash/CLasH/VHDL/Generate.hs
index 06bc2655cec986b48e5257a71e99d3a04ab33588..df0991c39a25698fc656d6aa12dffa8f5a87d7fe 100644
(file)
--- a/
clash/CLasH/VHDL/Generate.hs
+++ b/
clash/CLasH/VHDL/Generate.hs
@@
-500,7
+500,7
@@
genFromInteger' (Left res) f args = do
"Unsigned" -> MonadState.lift tsType $ tfp_to_int (sized_word_len_ty ty)
"Index" -> do
bound <- MonadState.lift tsType $ tfp_to_int (ranged_word_bound_ty ty)
"Unsigned" -> MonadState.lift tsType $ tfp_to_int (sized_word_len_ty ty)
"Index" -> do
bound <- MonadState.lift tsType $ tfp_to_int (ranged_word_bound_ty ty)
- return $
floor (logBase 2 (fromInteger (toInteger (bound)))) + 1
+ return $
(ceiling (logBase 2 (fromInteger (toInteger (bound)))))
let fname = case name of "Signed" -> toSignedId ; "Unsigned" -> toUnsignedId ; "Index" -> toUnsignedId
case args of
[integer] -> do -- The type and dictionary arguments are removed by genApplication
let fname = case name of "Signed" -> toSignedId ; "Unsigned" -> toUnsignedId ; "Index" -> toUnsignedId
case args of
[integer] -> do -- The type and dictionary arguments are removed by genApplication