Merge runsimsoc2.sh into runsimsoc.sh
authorCesar Strauss <cestrauss@gmail.com>
Sat, 23 Jul 2022 16:59:10 +0000 (13:59 -0300)
committerCesar Strauss <cestrauss@gmail.com>
Sat, 23 Jul 2022 17:04:44 +0000 (14:04 -0300)
The only difference was a different location of the ECP5 model files
and the use of python3. Make it so that both locations work, and
use python3 exclusively.

gram/simulation/.gitignore
gram/simulation/runsimsoc.sh
gram/simulation/runsimsoc2.sh [deleted file]

index 5bd86a4d554127afeb3d656d3a5555811c91ef9d..2cdcaaa861354b494bc3da89017d6d27cfb10d25 100644 (file)
@@ -13,3 +13,6 @@ build_simcrg/
 
 # Patched files
 DDRDLLA.v
+
+# ECP5 model files
+ecp5u
index 1722be78b9807a98943a6a394e6f6ec9a0b3b743..f1338e92a894c894cd1e03980e836fbce6ad314e 100755 (executable)
@@ -1,9 +1,20 @@
 #!/bin/bash
 set -e
 
-LIB_DIR=/usr/local/diamond/3.11_x64/ispfpga/verilog/data/ecp5u
+# Check for presence of the Diamond ECP5 verilog model files
+LIB_DIR=./ecp5u
+if [ ! -d "$LIB_DIR" ]; then
+    LIB_DIR=/usr/local/diamond/3.11_x64/ispfpga/verilog/data/ecp5u
+    if [ ! -d "$LIB_DIR" ]; then
+        echo "Error: Could not find the ECP5 verilog models." >&2
+        echo >&2
+        echo "Please either install Diamond (in /usr/local), " >&2
+        echo "or copy its ecp5u directory ($LIB_DIR) here." >&2
+        exit 1
+    fi
+fi
 
-python simsoc.py
+python3 simsoc.py
 yosys simsoc.ys
 cp ${LIB_DIR}/DDRDLLA.v DDRDLLA.v
 patch DDRDLLA.v < DDRDLLA.patch
diff --git a/gram/simulation/runsimsoc2.sh b/gram/simulation/runsimsoc2.sh
deleted file mode 100755 (executable)
index 4f97052..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-set -e
-
-LIB_DIR=./ecp5u
-
-python3 simsoc.py
-yosys simsoc.ys
-cp ${LIB_DIR}/DDRDLLA.v DDRDLLA.v
-patch DDRDLLA.v < DDRDLLA.patch
-iverilog -Wall -g2012 -s simsoctb -o simsoc simsoctb.v build_simsoc/top.v dram_model/ddr3.v ${LIB_DIR}/ECLKSYNCB.v ${LIB_DIR}/EHXPLLL.v ${LIB_DIR}/PUR.v ${LIB_DIR}/GSR.v \
-       ${LIB_DIR}/FD1S3AX.v ${LIB_DIR}/SGSR.v ${LIB_DIR}/ODDRX2F.v ${LIB_DIR}/ODDRX2DQA.v ${LIB_DIR}/DELAYF.v ${LIB_DIR}/BB.v ${LIB_DIR}/OB.v ${LIB_DIR}/IB.v \
-       ${LIB_DIR}/DQSBUFM.v ${LIB_DIR}/UDFDL5_UDP_X.v ${LIB_DIR}/TSHX2DQSA.v ${LIB_DIR}/TSHX2DQA.v ${LIB_DIR}/ODDRX2DQSB.v ${LIB_DIR}/IDDRX2DQA.v DDRDLLA.v \
-       ${LIB_DIR}/CLKDIVF.v
-vvp -n simsoc -fst-speed