diff options
author | Marlon James <marlon.james@gmail.com> | 2021-04-17 15:08:50 -0700 |
---|---|---|
committer | tgingold <tgingold@users.noreply.github.com> | 2021-04-18 17:34:57 +0200 |
commit | 90ac6b099104d285babbf0bce15cd735bf790336 (patch) | |
tree | d099bc04b7d897b239b263fc9f4d7ec0ea6b01c4 /testsuite/vhpi/005trace_file/testsuite.sh | |
parent | e9de3601fcd8e164ffcbf8243b45619d72a4ef3a (diff) | |
download | ghdl-90ac6b099104d285babbf0bce15cd735bf790336.tar.gz ghdl-90ac6b099104d285babbf0bce15cd735bf790336.tar.bz2 ghdl-90ac6b099104d285babbf0bce15cd735bf790336.zip |
VHPI: add tracing tests
Diffstat (limited to 'testsuite/vhpi/005trace_file/testsuite.sh')
-rwxr-xr-x | testsuite/vhpi/005trace_file/testsuite.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/vhpi/005trace_file/testsuite.sh b/testsuite/vhpi/005trace_file/testsuite.sh new file mode 100755 index 000000000..24f3ddd9f --- /dev/null +++ b/testsuite/vhpi/005trace_file/testsuite.sh @@ -0,0 +1,32 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze mydesign.vhdl +elab myentity + +if c_compiler_is_available && ghdl_has_feature myentity vhpi; then + $GHDL --vpi-compile -v gcc -c vhpi_lib.c + $GHDL --vpi-link -v gcc -o vhpi_lib.vhpi vhpi_lib.o + + add_vpi_path + + simulate myentity --vhpi=./vhpi_lib.vhpi --vhpi-trace=./vhpi_trace.log | tee myentity.out + if grep -q Error myentity.out; then + echo "Error in output" + exit 1; + fi + if grep -q error myentity.out; then + echo "error in output" + exit 1; + fi + if ! grep -q "vhpi_register_cb (" vhpi_trace.log; then + echo "VHPI trace missing" + exit 1; + fi + + rm -f vhpi_lib.vhpi vhpi_lib.o myentity.out vhpi_trace.log +fi +clean + +echo "Test successful" |