From fd4b0b5152f94cd406f2e5de86ce7ed0a4d2cbd0 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 2 Apr 2019 19:47:32 +0100 Subject: Large refactor with passing tests --- src/VeriFuzz/XST.hs | 65 ----------------------------------------------------- 1 file changed, 65 deletions(-) delete mode 100644 src/VeriFuzz/XST.hs (limited to 'src/VeriFuzz/XST.hs') diff --git a/src/VeriFuzz/XST.hs b/src/VeriFuzz/XST.hs deleted file mode 100644 index 3f4f6c3..0000000 --- a/src/VeriFuzz/XST.hs +++ /dev/null @@ -1,65 +0,0 @@ -{-| -Module : VeriFuzz.XST -Description : Xst (ise) simulator implementation. -Copyright : (c) 2018-2019, Yann Herklotz -License : BSD-3 -Maintainer : ymherklotz [at] gmail [dot] com -Stability : experimental -Portability : POSIX - -Xst (ise) simulator implementation. --} - -{-# LANGUAGE QuasiQuotes #-} - -module VeriFuzz.XST where - -import Prelude hiding (FilePath) -import Shelly -import Text.Shakespeare.Text (st) -import VeriFuzz.CodeGen -import VeriFuzz.Internal - -data Xst = Xst { xstPath :: {-# UNPACK #-} !FilePath - , netgenPath :: {-# UNPACK #-} !FilePath - } - deriving (Eq, Show) - -instance Tool Xst where - toText _ = "xst" - -instance Synthesisor Xst where - runSynth = runSynthXst - -defaultXst :: Xst -defaultXst = Xst "xst" "netgen" - -runSynthXst :: Xst -> SourceInfo -> FilePath -> Sh () -runSynthXst sim (SourceInfo top src) outf = do - dir <- pwd - writefile xstFile $ xstSynthConfig top - writefile prjFile [st|verilog work "rtl.v"|] - writefile "rtl.v" $ genSource src - echoP "XST: run" - _ <- logger dir "xst" $ timeout (xstPath sim) ["-ifn", toTextIgnore xstFile] - echoP "XST: netgen" - _ <- logger dir "netgen" $ run - (netgenPath sim) - [ "-w" - , "-ofmt" - , "verilog" - , toTextIgnore $ modFile <.> "ngc" - , toTextIgnore outf - ] - echoP "XST: clean" - noPrint $ run_ - "sed" - [ "-i" - , "/^`ifndef/,/^`endif/ d; s/ *Timestamp: .*//;" - , toTextIgnore outf - ] - echoP "XST: done" - where - modFile = fromText top - xstFile = modFile <.> "xst" - prjFile = modFile <.> "prj" -- cgit