atom-1.0.7: A DSL for embedded hard realtime applications.ContentsIndex
Language.Atom.Code
Description
Atom C code generation.
Synopsis
data Config = Config {
cFuncName :: String
cStateName :: String
cCode :: [Name] -> [Name] -> [(Name, Type)] -> (String, String)
cRuleCoverage :: Bool
cAssert :: Bool
cAssertName :: String
cCoverName :: String
hardwareClock :: Maybe Clock
}
data Clock = Clock {
clockName :: String
clockType :: Type
delta :: Integer
delay :: String
err :: Maybe String
}
writeC :: Name -> Config -> StateHierarchy -> [Rule] -> Schedule -> [Name] -> [Name] -> [(Name, Type)] -> IO RuleCoverage
defaults :: Config
defaultClock :: Clock
cType :: Type -> String
type RuleCoverage = [(Name, Int, Int)]
Documentation
data Config
C code configuration parameters.
Constructors
Config
cFuncName :: StringAlternative primary function name. Leave empty to use compile name.
cStateName :: StringName of state variable structure. Default: state
cCode :: [Name] -> [Name] -> [(Name, Type)] -> (String, String)Custom C code to insert above and below, given assertion names, coverage names, and probe names and types.
cRuleCoverage :: BoolEnable rule coverage tracking.
cAssert :: BoolEnable assertions and functional coverage.
cAssertName :: StringName of assertion function. Type: void assert(int, bool, uint64_t);
cCoverName :: StringName of coverage function. Type: void cover(int, bool, uint64_t);
hardwareClock :: Maybe ClockDo we use a hardware counter to schedule rules?
data Clock
Data associated with sampling a hardware clock.
Constructors
Clock
clockName :: StringC function to sample the clock. The funciton is assumed to have the prototype clockType clockName(void).
clockType :: TypeClock type. Assumed to be one of Word8, Word16, Word32, or Word64. It is permissible for the clock to rollover.
delta :: IntegerNumber of ticks in a phase. Must be greater than 0.
delay :: StringC function to delay/sleep. The function is assumed to have the prototype void delay(clockType i), where i is the duration of delay/sleep.
err :: Maybe StringNothing or a user-defined error-reporting function if the period duration is violated; e.g., the execution time was greater than delta. Assumed to have prototype void err(void).
writeC :: Name -> Config -> StateHierarchy -> [Rule] -> Schedule -> [Name] -> [Name] -> [(Name, Type)] -> IO RuleCoverage
defaults :: Config
Default C code configuration parameters (default function name, no pre/post code, ANSI C types).
defaultClock :: Clock
cType :: Type -> String
C99 type naming rules.
type RuleCoverage = [(Name, Int, Int)]
Produced by Haddock version 2.7.2