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:
e2a1b95
)
Add predicates for SigUse.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Tue, 17 Feb 2009 16:10:57 +0000
(17:10 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Tue, 17 Feb 2009 16:10:57 +0000
(17:10 +0100)
FlattenTypes.hs
patch
|
blob
|
history
diff --git
a/FlattenTypes.hs
b/FlattenTypes.hs
index ce1f22dc00bbece034db0108d6ae6b6f52217cc0..9f080f70666eec1755c8df1897b4c5ff507222f8 100644
(file)
--- a/
FlattenTypes.hs
+++ b/
FlattenTypes.hs
@@
-96,6
+96,23
@@
data SigUse =
| SigStateNew Int -- | Use as the new internal state
| SigSubState -- | Do not use, state variable is used in a subcircuit
| SigStateNew Int -- | Use as the new internal state
| SigSubState -- | Do not use, state variable is used in a subcircuit
+-- | Is this a port signal use?
+isPortSigUse :: SigUse -> Bool
+isPortSigUse SigPortIn = True
+isPortSigUse SigPortOut = True
+isPortSigUse _ = False
+
+-- | Is this a state signal use? Returns false for substate.
+isStateSigUse :: SigUse -> Bool
+isStateSigUse (SigStateOld _) = True
+isStateSigUse (SigStateNew _) = True
+isStateSigUse _ = False
+
+-- | Is this an internal signal use?
+isInternalSigUse :: SigUse -> Bool
+isInternalSigUse SigInternal = True
+isInternalSigUse _ = False
+
-- | Information on a signal definition
data SignalInfo = SignalInfo {
sigName :: Maybe String,
-- | Information on a signal definition
data SignalInfo = SignalInfo {
sigName :: Maybe String,