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 (parent:
171a9d2
)
Let mkIfaceSigDecs and createSignalAssignments handle Unused values.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Tue, 3 Feb 2009 10:10:46 +0000
(11:10 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Tue, 3 Feb 2009 10:10:46 +0000
(11:10 +0100)
Translator.hs
patch
|
blob
|
history
diff --git
a/Translator.hs
b/Translator.hs
index f54dcf3ea9d73bdd1356dfbcfd3780c23e46c47c..363ffe2215aa7c47669157428acbf711bb48c14d 100644
(file)
--- a/
Translator.hs
+++ b/
Translator.hs
@@
-45,7
+45,7
@@
main =
--core <- GHC.compileToCoreSimplified "Adders.hs"
core <- GHC.compileToCoreSimplified "Adders.hs"
--liftIO $ printBinds (cm_binds core)
--core <- GHC.compileToCoreSimplified "Adders.hs"
core <- GHC.compileToCoreSimplified "Adders.hs"
--liftIO $ printBinds (cm_binds core)
- let binds = Maybe.mapMaybe (findBind (cm_binds core)) ["
shalf_adder
"]
+ let binds = Maybe.mapMaybe (findBind (cm_binds core)) ["
dff
"]
liftIO $ printBinds binds
-- Turn bind into VHDL
let (vhdl, sess) = State.runState (mkVHDL binds) (VHDLSession 0 [])
liftIO $ printBinds binds
-- Turn bind into VHDL
let (vhdl, sess) = State.runState (mkVHDL binds) (VHDLSession 0 [])
@@
-412,6
+412,10
@@
mkIfaceSigDecs mode (Single (port_id, ty)) =
mkIfaceSigDecs mode (Tuple ports) =
concat $ map (mkIfaceSigDecs mode) ports
mkIfaceSigDecs mode (Tuple ports) =
concat $ map (mkIfaceSigDecs mode) ports
+-- Unused values (state) don't generate ports
+mkIfaceSigDecs mode Unused =
+ []
+
-- Create concurrent assignments of one map of signals to another. The maps
-- should have a similar form.
createSignalAssignments ::
-- Create concurrent assignments of one map of signals to another. The maps
-- should have a similar form.
createSignalAssignments ::
@@
-433,6
+437,14
@@
createSignalAssignments (Single (dst, _)) (Single (src, _)) =
createSignalAssignments (Tuple dsts) (Tuple srcs) =
concat $ zipWith createSignalAssignments dsts srcs
createSignalAssignments (Tuple dsts) (Tuple srcs) =
concat $ zipWith createSignalAssignments dsts srcs
+createSignalAssignments Unused (Single (src, _)) =
+ -- Write state
+ []
+
+createSignalAssignments (Single (src, _)) Unused =
+ -- Read state
+ []
+
createSignalAssignments dst src =
error $ "Non matching source and destination: " ++ show dst ++ "\nand\n" ++ show src
createSignalAssignments dst src =
error $ "Non matching source and destination: " ++ show dst ++ "\nand\n" ++ show src