Copyright | (c) 2018-2019 Yann Herklotz |
---|---|
License | BSD-3 |
Maintainer | yann [at] yannherklotz [dot] com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Class of the simulator and the synthesize tool.
Synopsis
- type ResultSh = ResultT Failed Sh
- resultSh :: ResultSh a -> Sh a
- class Tool a where
- class Tool a => Simulator a where
- runSim :: a -> SourceInfo -> [ByteString] -> ResultSh ByteString
- runSimWithFile :: a -> FilePath -> [ByteString] -> ResultSh ByteString
- class Tool a => Synthesiser a where
- runSynth :: a -> SourceInfo -> ResultSh ()
- synthOutput :: a -> FilePath
- setSynthOutput :: a -> FilePath -> a
- data Failed
- renameSource :: Synthesiser a => a -> SourceInfo -> SourceInfo
- checkPresent :: FilePath -> Text -> Sh (Maybe Text)
- checkPresentModules :: FilePath -> SourceInfo -> Sh [Text]
- replace :: FilePath -> Text -> Text -> Sh ()
- replaceMods :: FilePath -> Text -> SourceInfo -> Sh ()
- rootPath :: Sh FilePath
- timeout :: FilePath -> [Text] -> Sh Text
- timeout_ :: FilePath -> [Text] -> Sh ()
- bsToI :: ByteString -> Integer
- noPrint :: Sh a -> Sh a
- logger :: Text -> Sh ()
- logCommand :: FilePath -> Text -> Sh a -> Sh a
- logCommand_ :: FilePath -> Text -> Sh a -> Sh ()
- execute :: (MonadSh m, Monad m) => Failed -> FilePath -> Text -> FilePath -> [Text] -> ResultT Failed m Text
- execute_ :: (MonadSh m, Monad m) => Failed -> FilePath -> Text -> FilePath -> [Text] -> ResultT Failed m ()
- (<?>) :: (Monad m, Monoid a) => ResultT a m b -> a -> ResultT a m b
- annotate :: (Monad m, Monoid a) => a -> ResultT a m b -> ResultT a m b
Documentation
Tool class.
class Tool a => Simulator a where Source #
Simulation type class.
:: a | Simulator instance |
-> SourceInfo | Run information |
-> [ByteString] | Inputs to simulate |
-> ResultSh ByteString | Returns the value of the hash at the output of the testbench. |
runSimWithFile :: a -> FilePath -> [ByteString] -> ResultSh ByteString Source #
Instances
Simulator Icarus Source # | |
Defined in Verismith.Tool.Icarus runSim :: Icarus -> SourceInfo -> [ByteString] -> ResultSh ByteString Source # runSimWithFile :: Icarus -> FilePath -> [ByteString] -> ResultSh ByteString Source # | |
Simulator SimTool Source # | |
Defined in Verismith.Report runSim :: SimTool -> SourceInfo -> [ByteString] -> ResultSh ByteString Source # runSimWithFile :: SimTool -> FilePath -> [ByteString] -> ResultSh ByteString Source # |
class Tool a => Synthesiser a where Source #
Synthesiser type class.
:: a | Synthesiser tool instance |
-> SourceInfo | Run information |
-> ResultSh () | does not return any values |
synthOutput :: a -> FilePath Source #
setSynthOutput :: a -> FilePath -> a Source #
Instances
Synthesiser XST Source # | |
Defined in Verismith.Tool.XST | |
Synthesiser Vivado Source # | |
Defined in Verismith.Tool.Vivado | |
Synthesiser QuartusLight Source # | |
Defined in Verismith.Tool.QuartusLight runSynth :: QuartusLight -> SourceInfo -> ResultSh () Source # synthOutput :: QuartusLight -> FilePath Source # setSynthOutput :: QuartusLight -> FilePath -> QuartusLight Source # | |
Synthesiser Quartus Source # | |
Defined in Verismith.Tool.Quartus | |
Synthesiser Identity Source # | |
Defined in Verismith.Tool.Identity | |
Synthesiser Yosys Source # | |
Defined in Verismith.Tool.Yosys | |
Synthesiser SynthTool Source # | |
Defined in Verismith.Report |
renameSource :: Synthesiser a => a -> SourceInfo -> SourceInfo Source #
checkPresentModules :: FilePath -> SourceInfo -> Sh [Text] Source #
Checks what modules are present in the synthesised output, as some modules may have been inlined. This could be improved if the parser worked properly.
replaceMods :: FilePath -> Text -> SourceInfo -> Sh () Source #
This is used because rename only renames the definitions of modules of course, so instead this just searches and replaces all the module names. This should find all the instantiations and definitions. This could again be made much simpler if the parser works.
bsToI :: ByteString -> Integer Source #
Helper function to convert bytestrings to integers
execute :: (MonadSh m, Monad m) => Failed -> FilePath -> Text -> FilePath -> [Text] -> ResultT Failed m Text Source #