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:
ae1328b
)
Swap argument order on findBind.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 29 Jan 2009 16:47:45 +0000
(17:47 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 29 Jan 2009 16:47:45 +0000
(17:47 +0100)
Translator.hs
patch
|
blob
|
history
diff --git
a/Translator.hs
b/Translator.hs
index 338d16f4b92fccfd0815b08e02ea1b6e8f6017b8..705b552c876b1e2703a63855f819e5848d1a4233 100644
(file)
--- a/
Translator.hs
+++ b/
Translator.hs
@@
-44,7
+44,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 bind =
findBind "full_adder" (cm_binds core)
+ let bind =
Maybe.fromJust $ findBind (cm_binds core) "full_adder"
let NonRec var expr = bind
-- Turn bind into VHDL
let vhdl = State.evalState (mkVHDL bind) (VHDLSession 0 builtin_funcs)
let NonRec var expr = bind
-- Turn bind into VHDL
let vhdl = State.evalState (mkVHDL bind) (VHDLSession 0 builtin_funcs)
@@
-84,15
+84,15
@@
printBind' (b, expr) = do
--putStr $ showSDoc $ ppr expr
putStr "\n"
--putStr $ showSDoc $ ppr expr
putStr "\n"
-findBind ::
String -> [CoreBind] ->
CoreBind
-findBind lookfor =
+findBind ::
[CoreBind] -> String -> Maybe
CoreBind
+findBind
binds
lookfor =
-- This ignores Recs and compares the name of the bind with lookfor,
-- disregarding any namespaces in OccName and extra attributes in Name and
-- Var.
-- This ignores Recs and compares the name of the bind with lookfor,
-- disregarding any namespaces in OccName and extra attributes in Name and
-- Var.
-
Maybe.fromJust .
find (\b -> case b of
+ find (\b -> case b of
Rec l -> False
NonRec var _ -> lookfor == (occNameString $ nameOccName $ getName var)
Rec l -> False
NonRec var _ -> lookfor == (occNameString $ nameOccName $ getName var)
- )
+ )
binds
getPortMapEntry ::
SignalNameMap AST.VHDLId -- The port name to bind to
getPortMapEntry ::
SignalNameMap AST.VHDLId -- The port name to bind to