projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add higherordercpu and matrix multiplication examples
[matthijs/master-project/cλash.git]
/
clash
/
CLasH
/
VHDL
/
VHDLTools.hs
diff --git
a/clash/CLasH/VHDL/VHDLTools.hs
b/clash/CLasH/VHDL/VHDLTools.hs
index a70036ef33b56ff60816390b43505b7f7fcb6e77..ab3360b8126c44950c2f9cabddf71f73f38ef0ee 100644
(file)
--- a/
clash/CLasH/VHDL/VHDLTools.hs
+++ b/
clash/CLasH/VHDL/VHDLTools.hs
@@
-346,7
+346,8
@@
mkHTypeEither' ty | ty_has_free_tyvars ty = return $ Left $ "\nVHDLTools.mkHType
return $ Right $ SizedIType len
"Index" -> do
bound <- tfp_to_int (ranged_word_bound_ty ty)
return $ Right $ SizedIType len
"Index" -> do
bound <- tfp_to_int (ranged_word_bound_ty ty)
- return $ Right $ RangedWType bound
+ -- Upperbound is exclusive, hence the -1
+ return $ Right $ RangedWType (bound - 1)
otherwise ->
mkTyConHType tycon args
Nothing -> return $ Left $ "\nVHDLTools.mkHTypeEither': Do not know what to do with type: " ++ pprString ty
otherwise ->
mkTyConHType tycon args
Nothing -> return $ Left $ "\nVHDLTools.mkHTypeEither': Do not know what to do with type: " ++ pprString ty
@@
-570,8
+571,8
@@
getFields ::
getFields htype dc_i = case htype of
(AggrType name _ fieldss)
| dc_i >= 0 && dc_i < length fieldss -> fieldss!!dc_i
getFields htype dc_i = case htype of
(AggrType name _ fieldss)
| dc_i >= 0 && dc_i < length fieldss -> fieldss!!dc_i
- | otherwise -> error $ "Invalid constructor index: " ++ (show dc_i) ++ ". No such constructor in HType: " ++ (show htype)
- _ -> error $ "Can't get fields from non-aggregate HType: " ++ show htype
+ | otherwise -> error $ "
VHDLTool.getFields:
Invalid constructor index: " ++ (show dc_i) ++ ". No such constructor in HType: " ++ (show htype)
+ _ -> error $ "
VHDLTool.getFields:
Can't get fields from non-aggregate HType: " ++ show htype
-- Finds the field labels for an aggregation type, as VHDLIds.
getFieldLabels ::
-- Finds the field labels for an aggregation type, as VHDLIds.
getFieldLabels ::