Copyright | (c) 2018-2019 Yann Herklotz |
---|---|
License | GPL-3 |
Maintainer | yann [at] yannherklotz [dot] com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Verismith.Tool.Internal
Description
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 :: Show ann => a -> SourceInfo ann -> [ByteString] -> ResultSh ByteString
- runSimWithFile :: a -> FilePath -> [ByteString] -> ResultSh ByteString
- class Tool a => Synthesiser a where
- runSynth :: Show ann => a -> SourceInfo ann -> ResultSh ()
- synthOutput :: a -> FilePath
- setSynthOutput :: a -> FilePath -> a
- data Failed
- renameSource :: Synthesiser a => a -> SourceInfo ann -> SourceInfo ann
- checkPresent :: FilePath -> Text -> Sh (Maybe Text)
- checkPresentModules :: FilePath -> SourceInfo ann -> Sh [Text]
- replace :: FilePath -> Text -> Text -> Sh ()
- replaceMods :: FilePath -> Text -> SourceInfo ann -> 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 :: forall (m :: Type -> Type). (MonadSh m, Monad m) => Failed -> FilePath -> Text -> FilePath -> [Text] -> ResultT Failed m Text
- execute_ :: forall (m :: Type -> Type). (MonadSh m, Monad m) => Failed -> FilePath -> Text -> FilePath -> [Text] -> ResultT Failed m ()
- (<?>) :: forall (m :: Type -> Type) a b. (Monad m, Monoid a) => ResultT a m b -> a -> ResultT a m b
- annotate :: forall (m :: Type -> Type) a b. (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.
Methods
Arguments
:: Show ann | |
=> a | Simulator instance |
-> SourceInfo ann | 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 SimTool Source # | |
Defined in Verismith.Report Methods runSim :: Show ann => SimTool -> SourceInfo ann -> [ByteString] -> ResultSh ByteString Source # runSimWithFile :: SimTool -> FilePath -> [ByteString] -> ResultSh ByteString Source # | |
Simulator Icarus Source # | |
Defined in Verismith.Tool.Icarus Methods runSim :: Show ann => Icarus -> SourceInfo ann -> [ByteString] -> ResultSh ByteString Source # runSimWithFile :: Icarus -> FilePath -> [ByteString] -> ResultSh ByteString Source # |
class Tool a => Synthesiser a where Source #
Synthesiser type class.
Methods
Arguments
:: Show ann | |
=> a | Synthesiser tool instance |
-> SourceInfo ann | Run information |
-> ResultSh () | does not return any values |
synthOutput :: a -> FilePath Source #
setSynthOutput :: a -> FilePath -> a Source #
Instances
Synthesiser SynthTool Source # | |
Defined in Verismith.Report | |
Synthesiser Identity Source # | |
Defined in Verismith.Tool.Identity | |
Synthesiser Quartus Source # | |
Defined in Verismith.Tool.Quartus | |
Synthesiser QuartusLight Source # | |
Defined in Verismith.Tool.QuartusLight Methods runSynth :: Show ann => QuartusLight -> SourceInfo ann -> ResultSh () Source # synthOutput :: QuartusLight -> FilePath Source # setSynthOutput :: QuartusLight -> FilePath -> QuartusLight Source # | |
Synthesiser Vivado Source # | |
Defined in Verismith.Tool.Vivado | |
Synthesiser XST Source # | |
Defined in Verismith.Tool.XST | |
Synthesiser Yosys Source # | |
Defined in Verismith.Tool.Yosys |
Constructors
EmptyFail | |
EquivFail (Maybe CounterEg) | |
EquivError | |
SimFail ByteString | |
SynthFail | |
TimeoutError |
renameSource :: Synthesiser a => a -> SourceInfo ann -> SourceInfo ann Source #
checkPresentModules :: FilePath -> SourceInfo ann -> 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 ann -> 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 :: forall (m :: Type -> Type). (MonadSh m, Monad m) => Failed -> FilePath -> Text -> FilePath -> [Text] -> ResultT Failed m Text Source #
execute_ :: forall (m :: Type -> Type). (MonadSh m, Monad m) => Failed -> FilePath -> Text -> FilePath -> [Text] -> ResultT Failed m () Source #