aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2019-01-09 18:46:34 +0000
committerYann Herklotz <ymherklotz@gmail.com>2019-01-09 18:46:34 +0000
commit20b7efc999a6943dff442314ac8c2a31bd2fa08a (patch)
treed5d9555de3479ee14d3b2e0ec1053a434e73416c /src
parent84b311d642186927db877c59a95fd36b93f59ec8 (diff)
downloadverismith-20b7efc999a6943dff442314ac8c2a31bd2fa08a.tar.gz
verismith-20b7efc999a6943dff442314ac8c2a31bd2fa08a.zip
Fix Xst synthesis
Diffstat (limited to 'src')
-rw-r--r--src/Test/VeriFuzz/Simulator/Xst.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Test/VeriFuzz/Simulator/Xst.hs b/src/Test/VeriFuzz/Simulator/Xst.hs
index 17efb47..dbc307b 100644
--- a/src/Test/VeriFuzz/Simulator/Xst.hs
+++ b/src/Test/VeriFuzz/Simulator/Xst.hs
@@ -24,7 +24,9 @@ import Test.VeriFuzz.Verilog.AST
import Test.VeriFuzz.Verilog.CodeGen
import Text.Shakespeare.Text (st)
-newtype Xst = Xst { xstPath :: FilePath }
+data Xst = Xst { xstPath :: FilePath
+ , netgenPath :: FilePath
+ }
instance Simulator Xst where
toText _ = "xst"
@@ -32,6 +34,9 @@ instance Simulator Xst where
instance Synthesize Xst where
runSynth = runSynthXst
+defaultXst :: Xst
+defaultXst = Xst "/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/xst" "/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/netgen"
+
runSynthXst :: Xst -> ModDecl -> FilePath -> Sh ()
runSynthXst sim mod outf = do
writefile xstFile [st|run
@@ -40,10 +45,11 @@ runSynthXst sim mod outf = do
-fsm_extract YES -fsm_encoding Auto
-change_error_to_warning "HDLCompiler:226 HDLCompiler:1832"
|]
- writefile prjFile [st|verilog work "#{modName}.v"|]
- writefile vFile $ genSource mod
- timeout_ "/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/xst" ["-ifn", toTextIgnore xstFile]
- run_ "netgen" ["-w", "-ofmt", "verilog", toTextIgnore $ modFile <.> "ngc", "output.v"]
+ writefile prjFile [st|verilog work "rtl.v"|]
+ writefile "rtl.v" $ genSource mod
+ timeout_ (xstPath sim) ["-ifn", toTextIgnore xstFile]
+ run_ (netgenPath sim) ["-w", "-ofmt", "verilog", toTextIgnore $ modFile <.> "ngc", toTextIgnore outf]
+ run_ "sed" ["-i", "/^`ifndef/,/^`endif/ d; s/ *Timestamp: .*//;", toTextIgnore outf]
where
modName = mod ^. moduleId . getIdentifier
modFile = fromText modName