tests: extend tests/arch/run-tests.sh for defines
authorEddie Hung <eddie@fpgeh.com>
Thu, 5 Mar 2020 16:08:32 +0000 (08:08 -0800)
committerEddie Hung <eddie@fpgeh.com>
Thu, 5 Mar 2020 16:08:32 +0000 (08:08 -0800)
tests/arch/run-test.sh

index 5292d161556509c91149ba26c3cece72ac0d5046..170078a7fded3d3c0992132a4bf093327d967a0a 100755 (executable)
@@ -2,12 +2,23 @@
 
 set -e
 
+declare -A defines=( ["ice40"]="ICE40_HX ICE40_LP ICE40_U" )
+
 echo "Running syntax check on arch sim models"
 for arch in ../../techlibs/*; do
        find $arch -name cells_sim.v | while read path; do
-               echo -n "Test $path ->"
-               iverilog -t null -I$arch $path
-               echo " ok"
+               arch_name=$(basename -- $arch)
+               if [ "${defines[$arch_name]}" ]; then
+                       for def in ${defines[$arch_name]}; do
+                               echo -n "Test $path -D$def ->"
+                               iverilog -t null -I$arch -D$def $path
+                               echo " ok"
+                       done
+               else
+                       echo -n "Test $path ->"
+                       iverilog -t null -I$arch $path
+                       echo " ok"
+               fi
        done
 done