atom-1.0.7: A DSL for embedded hard realtime applications.ContentsIndex
Language.Atom.Elaboration
Contents
Atom monad and container.
Type Aliases and Utilities
Synopsis
data Atom a
data AtomDB = AtomDB {
atomId :: Int
atomName :: Name
atomNames :: [Name]
atomEnable :: UE
atomSubs :: [AtomDB]
atomPeriod :: Int
atomPhase :: Phase
atomAssigns :: [(UV, UE)]
atomActions :: [([String] -> String, [UE])]
atomAsserts :: [(Name, UE)]
atomCovers :: [(Name, UE)]
}
data Global = Global {
gRuleId :: Int
gVarId :: Int
gArrayId :: Int
gState :: [StateHierarchy]
gProbes :: [(String, UE)]
gPeriod :: Int
gPhase :: Phase
}
data Rule
= Rule {
ruleId :: Int
ruleName :: Name
ruleEnable :: UE
ruleAssigns :: [(UV, UE)]
ruleActions :: [([String] -> String, [UE])]
rulePeriod :: Int
rulePhase :: Phase
}
| Assert {
ruleName :: Name
ruleEnable :: UE
ruleAssert :: UE
}
| Cover {
ruleName :: Name
ruleEnable :: UE
ruleCover :: UE
}
data StateHierarchy
= StateHierarchy Name [StateHierarchy]
| StateVariable Name Const
| StateArray Name [Const]
buildAtom :: Global -> Name -> Atom a -> IO (a, (Global, AtomDB))
type UID = Int
type Name = String
data Phase
= MinPhase Int
| ExactPhase Int
type Path = [Name]
elaborate :: Name -> Atom () -> IO (Maybe (StateHierarchy, [Rule], [Name], [Name], [(Name, Type)]))
var :: Expr a => Name -> a -> Atom (V a)
var' :: Name -> Type -> V a
array :: Expr a => Name -> [a] -> Atom (A a)
array' :: Expr a => Name -> Type -> A a
addName :: Name -> Atom Name
get :: Atom (Global, AtomDB)
put :: (Global, AtomDB) -> Atom ()
allUVs :: [Rule] -> UE -> [UV]
allUEs :: Rule -> [UE]
Atom monad and container.
data Atom a
The Atom monad holds variable and rule declarations.
show/hide Instances
data AtomDB
Constructors
AtomDB
atomId :: Int
atomName :: Name
atomNames :: [Name]
atomEnable :: UE
atomSubs :: [AtomDB]
atomPeriod :: Int
atomPhase :: Phase
atomAssigns :: [(UV, UE)]
atomActions :: [([String] -> String, [UE])]
atomAsserts :: [(Name, UE)]
atomCovers :: [(Name, UE)]
show/hide Instances
data Global
Constructors
Global
gRuleId :: Int
gVarId :: Int
gArrayId :: Int
gState :: [StateHierarchy]
gProbes :: [(String, UE)]
gPeriod :: Int
gPhase :: Phase
data Rule
Constructors
Rule
ruleId :: Int
ruleName :: Name
ruleEnable :: UE
ruleAssigns :: [(UV, UE)]
ruleActions :: [([String] -> String, [UE])]
rulePeriod :: Int
rulePhase :: Phase
Assert
ruleName :: Name
ruleEnable :: UE
ruleAssert :: UE
Cover
ruleName :: Name
ruleEnable :: UE
ruleCover :: UE
show/hide Instances
data StateHierarchy
Constructors
StateHierarchy Name [StateHierarchy]
StateVariable Name Const
StateArray Name [Const]
buildAtom :: Global -> Name -> Atom a -> IO (a, (Global, AtomDB))
Type Aliases and Utilities
type UID = Int
type Name = String
A name.
data Phase
A phase is either the minimum phase or the exact phase.
Constructors
MinPhase Int
ExactPhase Int
type Path = [Name]
A hierarchical name.
elaborate :: Name -> Atom () -> IO (Maybe (StateHierarchy, [Rule], [Name], [Name], [(Name, Type)]))

A Relation is used for relative performance constraints between Actions. data Relation = Higher UID | Lower UID deriving (Show, Eq)

Given a top level name and design, elaborates design and returns a design database.

var :: Expr a => Name -> a -> Atom (V a)
Generic local variable declaration.
var' :: Name -> Type -> V a
Generic external variable declaration.
array :: Expr a => Name -> [a] -> Atom (A a)
Generic array declaration.
array' :: Expr a => Name -> Type -> A a
Generic external array declaration.
addName :: Name -> Atom Name
get :: Atom (Global, AtomDB)
put :: (Global, AtomDB) -> Atom ()
allUVs :: [Rule] -> UE -> [UV]
All the variables that directly and indirectly control the value of an expression.
allUEs :: Rule -> [UE]
All primary expressions used in a rule.
Produced by Haddock version 2.7.2