| Copyright | (c) 2013 Tom Hawkins & Lee Pike |
|---|---|
| Safe Haskell | None |
| Language | Haskell98 |
Language.Atom.Code
Description
Atom C code configuration and generation
Synopsis
Documentation
C code configuration parameters.
Constructors
Fields
- cFuncName :: String
Alternative primary function name. If this is empty, then it will default to the name passed to
compile.- cStateName :: String
Name of state variable structure. Default:
state- cCode :: [Name] -> [Name] -> [(Name, Type)] -> (String, String)
Custom C code to insert above and below the functions, given assertion names, coverage names, and probe names and types.
- hCode :: [Name] -> [Name] -> [(Name, Type)] -> (String, String)
Custom C code to insert above and below the state definition in the header file, given assertion names, coverage names, and probe names and types.
- cRuleCoverage :: Bool
Enable rule coverage tracking.
- cAssert :: Bool
Enable assertions and functional coverage.
- cAssertName :: String
Name of assertion function. Prototype:
void assert(int, bool, uint64_t);- cCoverName :: String
Name of coverage function. Prototype:
void cover(int, bool, uint64_t);- hardwareClock :: Maybe Clock
Hardware counter to schedule rules, or
Nothing(the default).
Data associated with sampling a hardware clock. For the clock to work
correctly, you MUST assign __global_clock the current time (according to
clockName) the first time you enter the main Atom-generated function
calling your rules.
Constructors
Fields
- clockName :: String
C function to sample the clock. The function is assumed to have the prototype:
clockType clockName(void).- clockType :: Type
Clock type. Assumed to be one of
Word8,Word16,Word32, orWord64. It is permissible for the clock to roll over.- delta :: Integer
Number of ticks in a phase. Must be greater than 0.
- delay :: String
C function to delay/sleep. The function is assumed to have the prototype:
void delay(clockType i), whereiis the duration of delay/sleep.- err :: Maybe String
Nothing, or a user-defined error-reporting function if the period duration is violated, e.g., the execution time was greater thandelta. Assumed to have prototype:void err(void).
writeC :: Name -> Config -> StateHierarchy -> [Rule] -> Schedule -> [Name] -> [Name] -> [(Name, Type)] -> IO RuleCoverage Source
Default C code configuration parameters (default function name, no pre/post code, ANSI C types).
Default hardware clock parameters (name "clk", Word64, delta 1, delay
function is "delay", no error function).
type RuleCoverage = [(Name, Int, Int)] Source