Permalink
Browse files

Add command line control over anachronism warnings.

  • Loading branch information...
1 parent 69c10c4 commit fb3969b5b851eb0013e71beb34dedf7ac7b3187b @steveicarus committed Apr 30, 2012
Showing with 22 additions and 5 deletions.
  1. +3 −0 compiler.h
  2. +11 −1 driver/main.c
  3. +4 −0 main.cc
  4. +2 −2 parse.y
  5. +1 −1 scripts/devel-stub.conf
  6. +1 −1 scripts/devel-stub.sh
View
@@ -92,6 +92,9 @@ extern bool warn_inf_loop;
extern bool warn_sens_entire_vec;
extern bool warn_sens_entire_arr;
+/* Warn about level-appropriate anochronisms. */
+extern bool warn_anachronisms;
+
/* This is true if verbose output is requested. */
extern bool verbose_flag;
View
@@ -136,7 +136,7 @@ int gen_std_include = 1;
of the include list. */
int gen_relative_include = 0;
-char warning_flags[16] = "";
+char warning_flags[16] = "n";
unsigned integer_width = 32;
@@ -491,11 +491,15 @@ static int t_compile()
static void process_warning_switch(const char*name)
{
if (strcmp(name,"all") == 0) {
+ process_warning_switch("anachronisms");
process_warning_switch("implicit");
process_warning_switch("portbind");
process_warning_switch("select-range");
process_warning_switch("timescale");
process_warning_switch("sensitivity-entire-array");
+ } else if (strcmp(name,"anachronisms") == 0) {
+ if (! strchr(warning_flags, 'n'))
+ strcat(warning_flags, "n");
} else if (strcmp(name,"implicit") == 0) {
if (! strchr(warning_flags, 'i'))
strcat(warning_flags, "i");
@@ -519,6 +523,12 @@ static void process_warning_switch(const char*name)
} else if (strcmp(name,"sensitivity-entire-array") == 0) {
if (! strchr(warning_flags, 'a'))
strcat(warning_flags, "a");
+ } else if (strcmp(name,"no-anachronisms") == 0) {
+ char*cp = strchr(warning_flags, 'n');
+ if (cp) while (*cp) {
+ cp[0] = cp[1];
+ cp += 1;
+ }
} else if (strcmp(name,"no-implicit") == 0) {
char*cp = strchr(warning_flags, 'i');
if (cp) while (*cp) {
View
@@ -158,6 +158,7 @@ bool warn_inf_loop = false;
bool warn_ob_select = false;
bool warn_sens_entire_vec = false;
bool warn_sens_entire_arr = false;
+bool warn_anachronisms = false;
/*
* Debug message class flags.
@@ -667,6 +668,9 @@ static void read_iconfig_file(const char*ipath)
case 'a':
warn_sens_entire_arr = true;
break;
+ case 'n':
+ warn_anachronisms = true;
+ break;
default:
break;
}
View
@@ -4272,7 +4272,7 @@ module_item
/* Handle some anachronistic syntax cases. */
| K_generate K_begin module_item_list_opt K_end K_endgenerate
{ /* Detect and warn about anachronistic begin/end use */
- if (generation_flag > GN_VER2001) {
+ if (generation_flag > GN_VER2001 && warn_anachronisms) {
warn_count += 1;
cerr << @2 << ": warning: Anachronistic use of begin/end to surround generate schemes." << endl;
}
@@ -4281,7 +4281,7 @@ module_item
pform_start_generate_nblock(@2, $4);
} module_item_list_opt K_end K_endgenerate
{ /* Detect and warn about anachronistic named begin/end use */
- if (generation_flag > GN_VER2001) {
+ if (generation_flag > GN_VER2001 && warn_anachronisms) {
warn_count += 1;
cerr << @2 << ": warning: Anachronistic use of named begin/end to surround generate schemes." << endl;
}
View
@@ -14,7 +14,7 @@ iwidth:32
sys_func:vpi/system.sft
sys_func:vpi/v2005_math.sft
sys_func:vpi/va_math.sft
-warnings:implicit
+warnings:ailnpstv
debug:eval_tree
debug:elaborate
debug:elab_pexpr
View
@@ -9,6 +9,6 @@
#
# NOTE: DO NOT INSTALL THIS FILE.
-./ivl -v -Ctgt-stub/stub.conf -C./scripts/devel-stub.conf -Pa.pf -Na.net -fDLL=tgt-stub/stub.tgt foo.vl
+./ivl -v -Ctgt-stub/stub.conf -C./scripts/devel-stub.conf -Pa.pf -Na.net -fDLL=tgt-stub/stub.tgt foo.vl |& tee foo.log
echo "*** ivl command completed, rc=$?"

0 comments on commit fb3969b

Please sign in to comment.