| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
ReWire.Hyle.Interp
Description
The Hyle interpreter: a direct transcription of the denotational semantics in doc/hyle.md (sections 5 and 6). The device denotes a Mealy stream function: registers start at their initial values, outputs and next-register values are computed from the body's equations each cycle.
Programs containing instances (sequential externs) or calls to model-less combinational externs cannot be evaluated.
Synopsis
- interp :: forall (m :: Type -> Type). MonadError AstError m => Config -> Program -> MealyT m Ins Outs
- evalExp :: MonadError AstError m => IEnv -> HashMap Name BV -> Exp -> m BV
- evalOp :: MonadError AstError m => Annote -> Op -> [BV] -> m BV
- data IEnv = IEnv {}
- type Ins = HashMap Name Value
- type Outs = HashMap Name BV
- run :: MonadIO m => Config -> MealyT m Ins Outs -> [Ins] -> m [Outs]
- subRange :: (Int, Int) -> BV -> BV
- inputValue :: Size -> Ins -> Name -> Value
- yamlPrefixes :: [Text]
Documentation
interp :: forall (m :: Type -> Type). MonadError AstError m => Config -> Program -> MealyT m Ins Outs Source #
evalOp :: MonadError AstError m => Annote -> Op -> [BV] -> m BV Source #
Primitive denotations (doc/hyle.md, section 5.2).
run :: MonadIO m => Config -> MealyT m Ins Outs -> [Ins] -> m [Outs] Source #
Runs non-interactively: given a stream of inputs, produces a stream of outputs.
inputValue :: Size -> Ins -> Name -> Value Source #
The value driven onto an input wire for a cycle (interp-style inputs: missing wires are driven to zero; values are truncated to the wire width).
yamlPrefixes :: [Text] Source #
Per-cycle output records in the interpreter's YAML format: the first output prefixed with "- ", the rest indented, in port order.