From c77c12ddeb2ab0741b87a368968ef2ae92cd6c1d Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 4 Feb 2012 21:44:57 +0000 Subject: [PATCH] Scripts and README for using the VI test suite with NVC --- .gitignore | 3 +++ test/vi_suite/README.nvc | 20 +++++++++++++++++ test/vi_suite/install.patch | 38 ++++++++++++++++++++++++++++++++ test/vi_suite/nvc/SSF | 12 ++++++++++ test/vi_suite/nvc/compile | 4 ++++ test/vi_suite/nvc/create_library | 2 ++ test/vi_suite/nvc/simulate | 12 ++++++++++ 7 files changed, 91 insertions(+) create mode 100644 test/vi_suite/README.nvc create mode 100644 test/vi_suite/install.patch create mode 100644 test/vi_suite/nvc/SSF create mode 100755 test/vi_suite/nvc/compile create mode 100755 test/vi_suite/nvc/create_library create mode 100755 test/vi_suite/nvc/simulate diff --git a/.gitignore b/.gitignore index 8b49f9e86..3b288898b 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ stamp-h1 # IEEE sources cannot be freely redistributed lib/ieee/*.vhdl + +# VI test suite also cannot be distributed +test/vi_suite* diff --git a/test/vi_suite/README.nvc b/test/vi_suite/README.nvc new file mode 100644 index 000000000..9aff63a04 --- /dev/null +++ b/test/vi_suite/README.nvc @@ -0,0 +1,20 @@ +To run the VI VHDL test suite on NVC do the following: + +1. Find vi_suite.tar.Z (MD5: cc8eb372e4a97a95f6f3a68ea7696ec5) on the + internet Wayback Machine. +2. Extract in nvc/test (i.e. over the top of this directory) +3. Install csh on your computer +4. Change "acc" in cfiles/*.mkf to "gcc". With GNU sed you can do + sed -i'' s/acc/gcc/g cfiles/*.mkf +5. Set the VI_TEST environment variable to the vi_suite directory + export VI_TEST=$(pwd) +6. Add $VI_TEST to your PATH + export PATH=$PATH:$VI_TEST +7. Patch the install script to support NVC + patch -p0 < install.patch +8. Run ./install +9. Run ./tcp +10. At the TCP# prompt: + set branch on all + set entorcfg entity + execute diff --git a/test/vi_suite/install.patch b/test/vi_suite/install.patch new file mode 100644 index 000000000..3fc92833e --- /dev/null +++ b/test/vi_suite/install.patch @@ -0,0 +1,38 @@ +--- install.old 2012-02-04 21:36:38.059578767 +0000 ++++ install 2012-02-04 21:38:37.776668713 +0000 +@@ -89,7 +89,7 @@ + # Choose Simulator + #-------------------------------------------------------------------- + set simulator = "" +-while (($simulator != '1') && ($simulator != '2') && ($simulator != '3') && ($simulator != '4') && ($simulator != '5')) ++while (($simulator != '1') && ($simulator != '2') && ($simulator != '3') && ($simulator != '4') && ($simulator != '5') && ($simulator != '6')) + echo "" + echo "Simulators For which Install Scripts are Available...." + echo "Mentor Graphics. = 1" +@@ -97,6 +97,7 @@ + echo "Synopsys........ = 3" + echo "Model Technology = 4" + echo "Other........... = 5" ++ echo "NVC............. = 6" + echo -n "Please enter the number of your choice : " + set simulator = ($<) + end +@@ -158,6 +159,18 @@ + echo "" + echo "" + ++else if ($simulator == '6') then ++# --------------------------------------------------------------------- ++# NVC ++# --------------------------------------------------------------------- ++ /bin/ln -s nvc/SSF SSF ++ /bin/ln -s nvc/create_library create_library ++ /bin/ln -s nvc/compile compile ++ /bin/ln -s nvc/simulate simulate ++ ++ echo "The installation is now complete." ++ ++ + endif + + echo "Remember to add the line: setenv VI_TEST install_directory/vi_suite" diff --git a/test/vi_suite/nvc/SSF b/test/vi_suite/nvc/SSF new file mode 100644 index 000000000..4cc451af1 --- /dev/null +++ b/test/vi_suite/nvc/SSF @@ -0,0 +1,12 @@ +compiler_error: +** Error +simulator_error: +** Fatal +create_library: +$work $work_path $suite_dir +compile: +$src_file $src_path $out_path $work $work_path $suite_dir +simulate: +$src_file $out_path $work $work_path $entity $arch $config $time_unit $time $suite_dir +end + diff --git a/test/vi_suite/nvc/compile b/test/vi_suite/nvc/compile new file mode 100755 index 000000000..23a449cbf --- /dev/null +++ b/test/vi_suite/nvc/compile @@ -0,0 +1,4 @@ +#!/bin/bash +#set -x +cd $6$5 +nvc --work $4 -a $6$2$1.vhd &> $6$3$1.co diff --git a/test/vi_suite/nvc/create_library b/test/vi_suite/nvc/create_library new file mode 100755 index 000000000..5a14dead7 --- /dev/null +++ b/test/vi_suite/nvc/create_library @@ -0,0 +1,2 @@ +#!/bin/sh +# Nothing to do \ No newline at end of file diff --git a/test/vi_suite/nvc/simulate b/test/vi_suite/nvc/simulate new file mode 100755 index 000000000..bd06d9b47 --- /dev/null +++ b/test/vi_suite/nvc/simulate @@ -0,0 +1,12 @@ +#!/bin/bash +#set -x +cd ${10}$4 + +if [ $7 != - ]; then + # TODO: configurations + echo "Cannot elaborate configuration" > ${10}$2$1.so + exit 1 +else + nvc --work $3 -e $5 &> ${10}$2$1.so + nvc --work $3 -r $5 --stop-time=$9$8 &>> ${10}$2$1.so +fi