From 7124a4f00e536b4d5323a7488c1f65469dddb102 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 12 May 2020 12:21:36 +0100 Subject: Format with ormolu --- src/Verismith/Tool/XST.hs | 122 +++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 60 deletions(-) (limited to 'src/Verismith/Tool/XST.hs') diff --git a/src/Verismith/Tool/XST.hs b/src/Verismith/Tool/XST.hs index 213fae8..9447675 100644 --- a/src/Verismith/Tool/XST.hs +++ b/src/Verismith/Tool/XST.hs @@ -1,83 +1,85 @@ -{-| -Module : Verismith.Tool.XST -Description : XST (ise) simulator implementation. -Copyright : (c) 2018-2019, Yann Herklotz -License : GPL-3 -Maintainer : yann [at] yannherklotz [dot] com -Stability : experimental -Portability : POSIX - -XST (ise) simulator implementation. --} - {-# LANGUAGE QuasiQuotes #-} +-- | +-- Module : Verismith.Tool.XST +-- Description : XST (ise) simulator implementation. +-- Copyright : (c) 2018-2019, Yann Herklotz +-- License : GPL-3 +-- Maintainer : yann [at] yannherklotz [dot] com +-- Stability : experimental +-- Portability : POSIX +-- +-- XST (ise) simulator implementation. module Verismith.Tool.XST - ( XST(..) - , defaultXST - ) + ( XST (..), + defaultXST, + ) where -import Control.DeepSeq (NFData, rnf, rwhnf) -import Data.Text (Text, unpack) -import Prelude hiding (FilePath) -import Shelly -import Shelly.Lifted (liftSh) -import Verismith.Tool.Internal -import Verismith.Tool.Template -import Verismith.Verilog.AST -import Verismith.Verilog.CodeGen +import Control.DeepSeq (NFData, rnf, rwhnf) +import Data.Text (Text, unpack) +import Shelly +import Shelly.Lifted (liftSh) +import Verismith.Tool.Internal +import Verismith.Tool.Template +import Verismith.Verilog.AST +import Verismith.Verilog.CodeGen +import Prelude hiding (FilePath) -data XST = XST { xstBin :: !(Maybe FilePath) - , xstDesc :: !Text - , xstOutput :: !FilePath - } - deriving (Eq) +data XST + = XST + { xstBin :: !(Maybe FilePath), + xstDesc :: !Text, + xstOutput :: !FilePath + } + deriving (Eq) instance Tool XST where - toText (XST _ t _) = t + toText (XST _ t _) = t instance Show XST where - show t = unpack $ toText t + show t = unpack $ toText t instance Synthesiser XST where - runSynth = runSynthXST - synthOutput = xstOutput - setSynthOutput (XST a b _) = XST a b + runSynth = runSynthXST + synthOutput = xstOutput + setSynthOutput (XST a b _) = XST a b instance NFData XST where - rnf = rwhnf + rnf = rwhnf defaultXST :: XST defaultXST = XST Nothing "xst" "syn_xst.v" runSynthXST :: Show ann => XST -> (SourceInfo ann) -> ResultSh () runSynthXST sim (SourceInfo top src) = do - dir <- liftSh pwd - let exec n = execute_ - SynthFail - dir - "xst" - (maybe (fromText n) ( fromText n) $ xstBin sim) - liftSh $ do - writefile xstFile $ xstSynthConfig top - writefile prjFile "verilog work \"rtl.v\"" - writefile "rtl.v" $ genSource src - exec "xst" ["-ifn", toTextIgnore xstFile] - exec - "netgen" - [ "-w" - , "-ofmt" - , "verilog" - , toTextIgnore $ modFile <.> "ngc" - , toTextIgnore $ synthOutput sim - ] - liftSh . noPrint $ run_ - "sed" - [ "-i" - , "/^`ifndef/,/^`endif/ d; s/ *Timestamp: .*//;" - , toTextIgnore $ synthOutput sim - ] + dir <- liftSh pwd + let exec n = + execute_ + SynthFail + dir + "xst" + (maybe (fromText n) ( fromText n) $ xstBin sim) + liftSh $ do + writefile xstFile $ xstSynthConfig top + writefile prjFile "verilog work \"rtl.v\"" + writefile "rtl.v" $ genSource src + exec "xst" ["-ifn", toTextIgnore xstFile] + exec + "netgen" + [ "-w", + "-ofmt", + "verilog", + toTextIgnore $ modFile <.> "ngc", + toTextIgnore $ synthOutput sim + ] + liftSh . noPrint $ + run_ + "sed" + [ "-i", + "/^`ifndef/,/^`endif/ d; s/ *Timestamp: .*//;", + toTextIgnore $ synthOutput sim + ] where modFile = fromText top xstFile = modFile <.> "xst" -- cgit