From: Matthijs Kooijman Date: Tue, 17 Feb 2009 16:10:57 +0000 (+0100) Subject: Add predicates for SigUse. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=c9878e08917311385ce7edbb93f548788cf9df14;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add predicates for SigUse. --- diff --git a/FlattenTypes.hs b/FlattenTypes.hs index ce1f22d..9f080f7 100644 --- 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 +-- | 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,