From 4693b69a6f716b950dd38becb7b4b44df7a13670 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Wed, 17 Jan 2024 19:26:13 +0000 Subject: [PATCH] Allow the --std option to control which standard the install scripts use Fixes #836 --- NEWS.md | 2 ++ contrib/install-icecube2.sh | 2 +- contrib/install-libero.sh | 2 +- contrib/install-quartus.sh | 4 ++-- contrib/install-uvvm.sh | 5 +++-- contrib/install-vivado.sh | 2 +- contrib/install-vunit.sh | 2 +- contrib/install-xpm_vhdl.sh | 2 +- src/nvc.c | 7 ++++++- 9 files changed, 18 insertions(+), 10 deletions(-) diff --git a/NEWS.md b/NEWS.md index 17c71fb8..132ec3fc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ (#815). - Fixed various issues in the implementation of guarded blocks and disconnection specifications (#829). +- The `--std` option now controls which VHDL standard the `--install` + command uses to compile third-party libraries (#836). ## Version 1.11.2 - 2024-01-04 - Fixed an incorrect length check in the equivalent process for diff --git a/contrib/install-icecube2.sh b/contrib/install-icecube2.sh index 0f38b8ac..f8abc28a 100755 --- a/contrib/install-icecube2.sh +++ b/contrib/install-icecube2.sh @@ -35,7 +35,7 @@ src=$ICECUBE2/vhdl GLOBAL_OPTS="-M 64m" A_OPTS="--relaxed" -for STD in 1993 2008; do +for STD in ${NVC_STD:-1993 2008}; do WORK=ice$(std_suffix $STD) analyse $src/vcomponent_vital.vhd analyse $src/sb_ice_syn_vital.vhd diff --git a/contrib/install-libero.sh b/contrib/install-libero.sh index 2d6a2115..ad894e1a 100755 --- a/contrib/install-libero.sh +++ b/contrib/install-libero.sh @@ -35,7 +35,7 @@ src=$LIBERO/Designer/lib/ GLOBAL_OPTS="-M 64m" A_OPTS="--relaxed" -for STD in 1993 2008; do +for STD in ${NVC_STD:-1993 2008}; do WORK=axcelerator$(std_suffix $STD) analyse $src/vtl/95/axcelerator.vhd done diff --git a/contrib/install-quartus.sh b/contrib/install-quartus.sh index 75e88b9e..735ec214 100755 --- a/contrib/install-quartus.sh +++ b/contrib/install-quartus.sh @@ -32,7 +32,7 @@ elif [ -d "$QUARTUS_ROOTDIR/eda/sim_lib" ]; then # Old Quartus directory layout # - for STD in 1993 2008; do + for STD in ${NVC_STD:-1993 2008}; do analyse_list altera$(std_suffix $STD) <user_set_std) + setenv("NVC_STD", standard_text(standard()), 1); + for (int i = optind; i < next_cmd; i++) { tb_rewind(tb); get_libexec_dir(tb); @@ -1971,6 +1975,7 @@ int main(int argc, char **argv) opterr = 0; const char *work_name = "work"; + cmd_state_t state = {}; const int next_cmd = scan_cmd(1, argc, argv); int c, index = 0; @@ -1994,6 +1999,7 @@ int main(int argc, char **argv) break; case 's': set_standard(parse_standard(optarg)); + state.user_set_std = true; break; case 'I': set_message_style(parse_message_style(optarg)); @@ -2038,7 +2044,6 @@ int main(int argc, char **argv) argc -= next_cmd - 1; argv += next_cmd - 1; - cmd_state_t state = {}; const int ret = process_command(argc, argv, &state); if (state.jit != NULL) -- 2.39.2