From 12100f95c1d0560b8dd8cd0408a2c4837e9cdde6 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 23 Jan 2019 19:36:11 +0000 Subject: Add better echo --- src/VeriFuzz/Simulator/General.hs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/VeriFuzz') diff --git a/src/VeriFuzz/Simulator/General.hs b/src/VeriFuzz/Simulator/General.hs index 543c139..dbd1da0 100644 --- a/src/VeriFuzz/Simulator/General.hs +++ b/src/VeriFuzz/Simulator/General.hs @@ -12,12 +12,14 @@ Class of the simulator and the synthesize tool. module VeriFuzz.Simulator.General where -import Data.Bits (shiftL) -import Data.ByteString (ByteString) -import qualified Data.ByteString as B -import Data.Text (Text) -import Prelude hiding (FilePath) +import Data.Bits (shiftL) +import Data.ByteString (ByteString) +import qualified Data.ByteString as B +import Data.Text (Text) +import qualified Data.Text as T +import Prelude hiding (FilePath) import Shelly +import System.FilePath.Posix (takeBaseName) import VeriFuzz.Verilog.AST -- | Simulator class. @@ -59,3 +61,10 @@ bsToI = B.foldl' (\i b -> (i `shiftL` 8) + fromIntegral b) 0 noPrint :: Sh a -> Sh a noPrint = print_stdout False . print_stderr False + +echoP :: Text -> Sh () +echoP t = do + fn <- pwd + echo $ bname fn <> " :: " <> t + where + bname = T.pack . takeBaseName . T.unpack . toTextIgnore -- cgit