aboutsummaryrefslogtreecommitdiffstats
path: root/src/VeriFuzz/Icarus.hs
diff options
context:
space:
mode:
authorYann Herklotz Grave <git@yannherklotzgrave.com>2019-02-17 11:41:38 +0000
committerYann Herklotz Grave <git@yannherklotzgrave.com>2019-02-17 11:41:38 +0000
commit0ea6e208f2c3c41922f8334174fc8e81a21d67f4 (patch)
tree3c4889aff5a85f58f7d4db296d7f2f26b8ad031f /src/VeriFuzz/Icarus.hs
parent08b2b306ae1accfa0b84dc3d327ba54add10a284 (diff)
downloadverismith-0ea6e208f2c3c41922f8334174fc8e81a21d67f4.tar.gz
verismith-0ea6e208f2c3c41922f8334174fc8e81a21d67f4.zip
Brittany formatting
Diffstat (limited to 'src/VeriFuzz/Icarus.hs')
-rw-r--r--src/VeriFuzz/Icarus.hs28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/VeriFuzz/Icarus.hs b/src/VeriFuzz/Icarus.hs
index c8bfccd..45e932f 100644
--- a/src/VeriFuzz/Icarus.hs
+++ b/src/VeriFuzz/Icarus.hs
@@ -52,31 +52,27 @@ defaultIcarus = Icarus "iverilog" "vvp"
addDisplay :: [Stmnt] -> [Stmnt]
addDisplay s = concat $ transpose
- [s, replicate l $ TimeCtrl 1 Nothing, replicate l
- . SysTaskEnable $ Task "display" ["%b", Id "y"]]
+ [s, replicate l $ TimeCtrl 1 Nothing, replicate l . SysTaskEnable $ Task "display" ["%b", Id "y"]]
where l = length s
assignFunc :: [Port] -> ByteString -> Stmnt
-assignFunc inp bs =
- NonBlockAssign . Assign conc Nothing . Number (B.length bs * 8) $ bsToI bs
- where
- conc = RegConcat (portToExpr <$> inp)
+assignFunc inp bs = NonBlockAssign . Assign conc Nothing . Number (B.length bs * 8) $ bsToI bs
+ where conc = RegConcat (portToExpr <$> inp)
convert :: Text -> ByteString
convert =
toStrict
- . (encode :: Integer -> L.ByteString)
- . maybe 0 fst
- . listToMaybe
- . readInt 2 (`elem` ("01" :: String)) digitToInt
- . T.unpack
+ . (encode :: Integer -> L.ByteString)
+ . maybe 0 fst
+ . listToMaybe
+ . readInt 2 (`elem` ("01" :: String)) digitToInt
+ . T.unpack
mask :: Text -> Text
mask = T.replace "x" "0"
callback :: ByteString -> Text -> ByteString
-callback b t =
- b <> convert (mask t)
+callback b t = b <> convert (mask t)
runSimIcarus :: Icarus -> ModDecl -> [ByteString] -> Sh ByteString
runSimIcarus sim m bss = do
@@ -99,5 +95,7 @@ runSimIcarusWithFile sim f _ = do
echoP "Icarus: Compile"
_ <- logger dir "icarus" $ run (icarusPath sim) ["-o", "main", toTextIgnore f]
echoP "Icarus: Run"
- B.take 8 . BA.convert . (hash :: ByteString -> Digest SHA256) <$>
- logger dir "vvp" (runFoldLines (mempty :: ByteString) callback (vvpPath sim) ["main"])
+ B.take 8 . BA.convert . (hash :: ByteString -> Digest SHA256) <$> logger
+ dir
+ "vvp"
+ (runFoldLines (mempty :: ByteString) callback (vvpPath sim) ["main"])