Safe Haskell | None |
---|---|
Language | Haskell2010 |
Probes log the shallow-embedding signals of a Lava circuit in the | deep embedding, so that the results can be observed post-mortem.
- probeS :: Rep a => String -> Signal c a -> Signal c a
- unpackedProbe :: forall c a p. (Rep a, Pack c a, p ~ Unpacked c a) => String -> p -> p
- resetProbesForVCD :: IO ()
- snapProbesAsVCD :: IO VCD
- setProbesAsTrace :: (String -> IO ()) -> IO ()
- setShallowProbes :: (forall a. Rep a => String -> Integer -> X a -> X a) -> IO ()
- setProbes :: (forall a i. Rep a => String -> Signal i a -> Signal i a) -> IO ()
Probes
probeS :: Rep a => String -> Signal c a -> Signal c a Source
probeS
adds a named probe to the front of a signal.
unpackedProbe :: forall c a p. (Rep a, Pack c a, p ~ Unpacked c a) => String -> p -> p Source
unpackedProbe
is an unpacked version of probeS
.
resetProbesForVCD :: IO () Source
Setting up the debugging mode for probes
setProbesAsTrace :: (String -> IO ()) -> IO () Source
A simplified API, where each internal probe event is represented as a newline-terminated String, and can be printed, or appended to a file.
To append to a debugging file, use
ghci> setProbesAsTrace $ appendFile "DEBUG.out"
To write to the screen, use
ghci> setProbesAsTrace $ putStr
You will need to re-execute your program after calling any probe function, so typically this done on the command line, or by puting setProbeAsTrace inside main.