From b968f577119b09d794e1067da3443729b4708d17 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 2 Jul 2020 21:10:05 -0400 Subject: [PATCH] Suppress unsupported constraint, as implied by unsupported randomize. --- src/verilog.y | 16 +++++++++------- test_regress/t/t_randomize.out | 18 ------------------ 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index 91efc654f..0c7a1f39f 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -6055,7 +6055,9 @@ memberQualOne: // IEEE: property_qualifier + method_qualifier class_constraint: // ==IEEE: class_constraint // // IEEE: constraint_declaration - constraintStaticE yCONSTRAINT idAny constraint_block { $$ = NULL; BBUNSUP($2, "Unsupported: constraint"); /*and audit all rules below for UNSUP*/ } + // // UNSUP: We have the unsupported warning on the randomize() call, so don't bother on + // // constraint blocks. When we support randomize we need to make AST nodes for below rules + constraintStaticE yCONSTRAINT idAny constraint_block { $$ = NULL; /*UNSUP*/ } // // IEEE: constraint_prototype + constraint_prototype_qualifier | constraintStaticE yCONSTRAINT idAny ';' { $$ = NULL; } | yEXTERN constraintStaticE yCONSTRAINT idAny ';' { $$ = NULL; BBUNSUP($1, "Unsupported: extern constraint"); } @@ -6094,19 +6096,19 @@ constraint_expressionList: // ==IEEE: { constraint_expression } constraint_expression: // ==IEEE: constraint_expression expr/*expression_or_dist*/ ';' { $$ = $1; } // // 1800-2012: - | ySOFT expr/*expression_or_dist*/ ';' { $$ = NULL; /*UNSUP*/ } + | ySOFT expr/*expression_or_dist*/ ';' { $$ = NULL; /*UNSUP-no-UVM*/ } // // 1800-2012: // // IEEE: uniqueness_constraint ';' - | yUNIQUE '{' open_range_list '}' { $$ = NULL; /*UNSUP*/ } + | yUNIQUE '{' open_range_list '}' { $$ = NULL; /*UNSUP-no-UVM*/ } // // IEEE: expr yP_MINUSGT constraint_set // // Conflicts with expr:"expr yP_MINUSGT expr"; rule moved there // - | yIF '(' expr ')' constraint_set %prec prLOWER_THAN_ELSE { $$ = NULL; /*UNSUP*/ } - | yIF '(' expr ')' constraint_set yELSE constraint_set { $$ = NULL; /*UNSUP*/ } + | yIF '(' expr ')' constraint_set %prec prLOWER_THAN_ELSE { $$ = NULL; /*UNSUP-UVM*/ } + | yIF '(' expr ')' constraint_set yELSE constraint_set { $$ = NULL; /*UNSUP-UVM*/ } // // IEEE says array_identifier here, but dotted accepted in VMM + 1800-2009 - | yFOREACH '(' idClassSelForeach ')' constraint_set { $$ = NULL; /*UNSUP*/ } + | yFOREACH '(' idClassSelForeach ')' constraint_set { $$ = NULL; /*UNSUP-UVM*/ } // // soft is 1800-2012 - | yDISABLE ySOFT expr/*constraint_primary*/ ';' { $$ = NULL; /*UNSUP*/ } + | yDISABLE ySOFT expr/*constraint_primary*/ ';' { $$ = NULL; /*UNSUP-no-UVM*/ } ; constraint_set: // ==IEEE: constraint_set diff --git a/test_regress/t/t_randomize.out b/test_regress/t/t_randomize.out index f508c1cd0..ae473f217 100644 --- a/test_regress/t/t_randomize.out +++ b/test_regress/t/t_randomize.out @@ -1,24 +1,9 @@ %Error-UNSUPPORTED: t/t_randomize.v:11:4: Unsupported: extern constraint 11 | extern constraint ex; | ^~~~~~ -%Error-UNSUPPORTED: t/t_randomize.v:13:4: Unsupported: constraint - 13 | constraint a { header > 0 && header < 1000; } - | ^~~~~~~~~~ -%Error-UNSUPPORTED: t/t_randomize.v:14:4: Unsupported: constraint - 14 | constraint b { - | ^~~~~~~~~~ -%Error-UNSUPPORTED: t/t_randomize.v:19:4: Unsupported: constraint - 19 | constraint b { - | ^~~~~~~~~~ -%Error-UNSUPPORTED: t/t_randomize.v:23:4: Unsupported: constraint - 23 | constraint c { - | ^~~~~~~~~~ %Error-UNSUPPORTED: t/t_randomize.v:29:29: Unsupported: solve before 29 | constraint order { solve length before header; } | ^~~~~~ -%Error-UNSUPPORTED: t/t_randomize.v:29:4: Unsupported: constraint - 29 | constraint order { solve length before header; } - | ^~~~~~~~~~ %Error-UNSUPPORTED: t/t_randomize.v:32:16: Unsupported: dist :/ 32 | x dist { [100:102] :/ 1, 200 := 2, 300 := 5}; | ^ @@ -31,7 +16,4 @@ %Error-UNSUPPORTED: t/t_randomize.v:32:9: Unsupported: dist 32 | x dist { [100:102] :/ 1, 200 := 2, 300 := 5}; | ^~~~ -%Error-UNSUPPORTED: t/t_randomize.v:30:4: Unsupported: constraint - 30 | constraint dis { - | ^~~~~~~~~~ %Error: Exiting due to