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
Let mkCompInsSm look up the actual VHDL entity id.
[matthijs/master-project/cλash.git]
/
Translator.hs
diff --git
a/Translator.hs
b/Translator.hs
index 78c3a6f08be46eec78cde6662c6e0c73c9ed85c9..37a812b2bceca493cf1e95824c6b7ea4b4484d4e 100644
(file)
--- a/
Translator.hs
+++ b/
Translator.hs
@@
-70,6
+70,7
@@
main =
mapM processBind binds
modFuncs nameFlatFunction
modFuncs VHDL.createEntity
mapM processBind binds
modFuncs nameFlatFunction
modFuncs VHDL.createEntity
+ modFuncs VHDL.createArchitecture
-- Extract the library units generated from all the functions in the
-- session.
funcs <- getFuncs
-- Extract the library units generated from all the functions in the
-- session.
funcs <- getFuncs
@@
-115,7
+116,7
@@
flattenBind hsfunc bind@(NonRec var expr) = do
let flatfunc = flattenFunction hsfunc bind
addFunc hsfunc
setFlatFunc hsfunc flatfunc
let flatfunc = flattenFunction hsfunc bind
addFunc hsfunc
setFlatFunc hsfunc flatfunc
- let used_hsfuncs = map appFunc (apps flatfunc)
+ let used_hsfuncs = map appFunc (
flat_
apps flatfunc)
State.mapM resolvFunc used_hsfuncs
return ()
State.mapM resolvFunc used_hsfuncs
return ()
@@
-176,19
+177,19
@@
mkHsFunction f ty =
nameFlatFunction ::
HsFunction
-> FuncData
nameFlatFunction ::
HsFunction
-> FuncData
- ->
FuncData
+ ->
VHDLState ()
nameFlatFunction hsfunc fdata =
let func = flatFunc fdata in
case func of
-- Skip (builtin) functions without a FlatFunction
nameFlatFunction hsfunc fdata =
let func = flatFunc fdata in
case func of
-- Skip (builtin) functions without a FlatFunction
- Nothing ->
fdata
+ Nothing ->
do return ()
-- Name the signals in all other functions
Just flatfunc ->
-- Name the signals in all other functions
Just flatfunc ->
- let s = sigs flatfunc in
+ let s =
flat_
sigs flatfunc in
let s' = map (\(id, (SignalInfo Nothing ty)) -> (id, SignalInfo (Just $ "sig_" ++ (show id)) ty)) s in
let s' = map (\(id, (SignalInfo Nothing ty)) -> (id, SignalInfo (Just $ "sig_" ++ (show id)) ty)) s in
- let flatfunc' = flatfunc { sigs = s' } in
- fdata { flatFunc = Just flatfunc' }
+ let flatfunc' = flatfunc {
flat_
sigs = s' } in
+ setFlatFunc hsfunc flatfunc'
-- | Splits a tuple type into a list of element types, or Nothing if the type
-- is not a tuple type.
-- | Splits a tuple type into a list of element types, or Nothing if the type
-- is not a tuple type.