aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/testenv.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/testenv.sh')
-rw-r--r--testsuite/testenv.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/testenv.sh b/testsuite/testenv.sh
new file mode 100644
index 0000000..87aca65
--- /dev/null
+++ b/testsuite/testenv.sh
@@ -0,0 +1,30 @@
+# Testsuite environment
+
+set -e
+
+if [ x"$GHDL" = x ]; then
+ GHDL=ghdl
+fi
+
+if [ x"$YOSYS" = x ]; then
+ YOSYS="yosys -m ../../ghdl.so"
+fi
+
+analyze ()
+{
+ echo "analyze $@"
+ "$GHDL" -a $GHDL_STD_FLAGS $GHDL_FLAGS $@
+}
+
+synth ()
+{
+ echo "synthesize $@"
+ "$YOSYS" -p "ghdl $@; synth_ice40 -blif out.blif"
+}
+
+clean ()
+{
+ echo "Remove work library"
+ "$GHDL" --remove $GHDL_STD_FLAGS
+ rm -f out.blif
+}