From 4cc42133b51d294e66b22e68bfb93b349fd2b74d Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 19 Oct 2023 20:13:27 -0400 Subject: [PATCH] Internals: Rename some parser rules. No functional change. --- src/verilog.y | 107 ++++++++++++++++++++++++-------------------------- 1 file changed, 52 insertions(+), 55 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index cfc01f62a..3bd0218ab 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -1758,7 +1758,7 @@ program_generate_item: // ==IEEE: program_generate_item | generate_region { $$ = $1; } // not in IEEE, but presumed so can do yBEGIN ... yEND | genItemBegin { $$ = $1; } - | elaboration_system_task { $$ = $1; } + | severity_system_task { $$ = $1; } ; extern_tf_declaration: // ==IEEE: extern_tf_declaration @@ -2397,7 +2397,7 @@ data_declaration: // ==IEEE: data_declaration // // "yVIRTUAL yID yID" looks just like a data_declaration // // Therefore the virtual_interface_declaration term isn't used // // 1800-2009: - | net_type_declaration { $$ = $1; } + | nettype_declaration { $$ = $1; } | vlTag { $$ = nullptr; } ; @@ -2489,15 +2489,15 @@ data_declarationVarFrontClass: // IEEE: part of data_declaration (for class_pro // // = class_new is in variable_decl_assignment ; -net_type_declaration: // IEEE: net_type_declaration - yNETTYPE data_type idAny/*net_type_identifier*/ ';' +nettype_declaration: // IEEE: nettype_declaration/net_type_declaration + yNETTYPE data_type idAny/*nettype_identifier*/ ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } // // package_scope part of data_type | yNETTYPE data_type idAny yWITH__ETC packageClassScopeE id/*tf_identifier*/ ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } - | yNETTYPE packageClassScopeE id/*net_type_identifier*/ idAny/*net_type_identifier*/ ';' + | yNETTYPE packageClassScopeE id/*nettype_identifier*/ idAny/*nettype_identifier*/ ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } - | yNETTYPE packageClassScopeE id/*net_type_identifier*/ idAny/*net_type_identifier*/ + | yNETTYPE packageClassScopeE id/*nettype_identifier*/ idAny/*nettype_identifier*/ /*cont*/ yWITH__ETC packageClassScopeE id/*tf_identifier*/ ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: nettype"); } ; @@ -2653,7 +2653,7 @@ module_common_item: // ==IEEE: module_common_item | always_construct { $$ = $1; } | loop_generate_construct { $$ = $1; } | conditional_generate_construct { $$ = $1; } - | elaboration_system_task { $$ = $1; } + | severity_system_task { $$ = $1; } | sigAttrScope { $$ = nullptr; } // | error ';' { $$ = nullptr; } @@ -3222,7 +3222,7 @@ cellpinListE: { VARRESET_LIST(UNKNOWN); } cellpinItListE { $$ = $2; VARRESET_NONLIST(UNKNOWN); } ; -cellparamItListE: // IEEE: list_of_parameter_assignmente +cellparamItListE: // IEEE: list_of_parameter_value_assignments/list_of_parameter_assignments cellparamItemE { $$ = $1; } | cellparamItListE ',' cellparamItemE { $$ = addNextNull($1, $3); } ; @@ -3798,11 +3798,11 @@ case_itemList: // IEEE: { case_item + ... } | case_itemList yDEFAULT colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$2, nullptr, $4}); } ; -case_inside_itemList: // IEEE: { case_inside_item + open_range_list ... } - open_range_list colon stmtBlock { $$ = new AstCaseItem{$2, $1, $3}; } +case_inside_itemList: // IEEE: { case_inside_item + range_list ... } + range_list colon stmtBlock { $$ = new AstCaseItem{$2, $1, $3}; } | yDEFAULT colon stmtBlock { $$ = new AstCaseItem{$1, nullptr, $3}; } | yDEFAULT stmtBlock { $$ = new AstCaseItem{$1, nullptr, $2}; } - | case_inside_itemList open_range_list colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$3, $2, $4}); } + | case_inside_itemList range_list colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$3, $2, $4}); } | case_inside_itemList yDEFAULT stmtBlock { $$ = $1->addNext(new AstCaseItem{$2, nullptr, $3}); } | case_inside_itemList yDEFAULT colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$2, nullptr, $4}); } ; @@ -3813,16 +3813,12 @@ rand_case_itemList: // IEEE: { rand_case_item + ... } | rand_case_itemList expr colon stmtBlock { $$ = $1->addNext(new AstCaseItem{$3, $2, $4}); } ; -open_range_list: // ==IEEE: open_range_list + open_value_range - open_value_range { $$ = $1; } - | open_range_list ',' open_value_range { $$ = $1->addNext($3); } - ; - -open_value_range: // ==IEEE: open_value_range +range_list: // ==IEEE: range_list/open_range_list + value_range/open_value_range value_range { $$ = $1; } + | range_list ',' value_range { $$ = $1->addNext($3); } ; -value_range: // ==IEEE: value_range +value_range: // ==IEEE: value_range/open_value_range expr { $$ = $1; } | '[' expr ':' expr ']' { $$ = new AstInsideRange{$1, $2, $4}; } ; @@ -4326,12 +4322,12 @@ system_f_call_or_t: // IEEE: part of system_tf_call (can be task | yD_VALUEPLUSARGS '(' expr ',' expr ')' { $$ = new AstValuePlusArgs{$1, $3, $5}; } ; -elaboration_system_task: // IEEE: elaboration_system_task (1800-2009) +severity_system_task: // IEEE: severity_system_task/elaboration_severity_system_task (1800-2009) // // TODO: These currently just make initial statements, should instead give runtime error - elaboration_system_task_guts ';' { $$ = new AstInitial{$1, $1}; } + severity_system_task_guts ';' { $$ = new AstInitial{$1, $1}; } ; -elaboration_system_task_guts: // IEEE: part of elaboration_system_task (1800-2009) +severity_system_task_guts: // IEEE: part of severity_system_task (1800-2009) // // $fatal first argument is exit number, must be constant yD_INFO parenE { $$ = new AstElabDisplay{$1, VDisplayType::DT_INFO, nullptr}; } | yD_INFO '(' exprList ')' { $$ = new AstElabDisplay{$1, VDisplayType::DT_INFO, $3}; } @@ -4817,7 +4813,7 @@ expr: // IEEE: part of expression/constant_expression/ | ~l~expr '?' ~r~expr ':' ~r~expr { $$ = new AstCond{$2, $1, $3, $5}; } // // // IEEE: inside_expression - | ~l~expr yINSIDE '{' open_range_list '}' { $$ = new AstInside{$2, $1, $4}; } + | ~l~expr yINSIDE '{' range_list '}' { $$ = new AstInside{$2, $1, $4}; } // // // IEEE: tagged_union_expression //UNSUP yTAGGED id/*member*/ %prec prTAGGED { UNSUP } @@ -4833,7 +4829,8 @@ expr: // IEEE: part of expression/constant_expression/ // // // IEEE: "... hierarchical_identifier select" see below // - // // IEEE: empty_queue (IEEE 1800-2017 empty_unpacked_array_concatenation) + // // IEEE: empty_unpacked_array_concatenation + // // IEEE: (aka empty_queue, empty_unpacked_array_concatenation) | '{' '}' { $$ = new AstEmptyQueue{$1}; } // // // IEEE: concatenation/constant_concatenation @@ -6325,7 +6322,7 @@ boolean_abbrev: // ==IEEE: boolean_abbrev | yP_BRAPLUSKET { $$ = new AstConst{$1, AstConst::BitFalse{}}; BBUNSUP($1, "Unsupported: [+] boolean abbrev expression"); } - // // IEEE: non_consecutive_repetition + // // IEEE: nonconsecutive_repetition/non_consecutive_repetition | yP_BRAEQ constExpr ']' { $$ = $2; BBUNSUP($1, "Unsupported: [= boolean abbrev expression"); } | yP_BRAEQ constExpr ':' constExpr ']' @@ -6438,13 +6435,13 @@ bins_or_options: // ==IEEE: bins_or_options // // Superset of IEEE - we allow []'s in more places coverage_option { $$ = $1; } // // Can't use wildcardE as results in conflicts - | bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' open_range_list '}' iffE + | bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' range_list '}' iffE { $$ = nullptr; BBUNSUP($4, "Unsupported: cover bin specification"); } - | bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' open_range_list '}' yWITH__CUR '{' cgexpr '}' iffE + | bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' range_list '}' yWITH__CUR '{' cgexpr '}' iffE { $$ = nullptr; BBUNSUP($8, "Unsupported: cover bin 'with' specification"); } - | yWILDCARD bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' open_range_list '}' iffE + | yWILDCARD bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' range_list '}' iffE { $$ = nullptr; BBUNSUP($5, "Unsupported: cover bin 'wildcard' specification"); } - | yWILDCARD bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' open_range_list '}' yWITH__CUR '{' cgexpr '}' iffE + | yWILDCARD bins_keyword id/*bin_identifier*/ bins_orBraE '=' '{' range_list '}' yWITH__CUR '{' cgexpr '}' iffE { $$ = nullptr; BBUNSUP($9, "Unsupported: cover bin 'wildcard' 'with' specification"); } // // // cgexpr part of trans_list @@ -6623,51 +6620,51 @@ hierarchical_btf_identifier: // ==IEEE: hierarchical_btf_identifier // Randsequence randsequence_statement: // ==IEEE: randsequence_statement - yRANDSEQUENCE '(' ')' productionList yENDSEQUENCE + yRANDSEQUENCE '(' ')' rs_productionList yENDSEQUENCE { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence"); } - | yRANDSEQUENCE '(' id/*production_identifier*/ ')' productionList yENDSEQUENCE + | yRANDSEQUENCE '(' id/*rs_production_identifier*/ ')' rs_productionList yENDSEQUENCE { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence"); } ; -productionList: // IEEE: production+ - production { $$ = $1; } - | productionList production { $$ = addNextNull($1, $2); } +rs_productionList: // IEEE: rs_production+ + rs_production { $$ = $1; } + | rs_productionList rs_production { $$ = addNextNull($1, $2); } ; -production: // ==IEEE: production - productionFront ':' rs_ruleList ';' +rs_production: // ==IEEE: rs_production + rs_productionFront ':' rs_ruleList ';' { // TODO makes a function, probably want a new Ast type instead SYMP->popScope($$); $$ = nullptr; BBUNSUP($2, "Unsupported: randsequence production"); } ; -productionFront: // IEEE: part of production +rs_productionFront: // IEEE: part of rs_production funcId/*production_identifier*/ { $$ = $1; } | funcId '(' tf_port_listE ')' { $$ = $1; $$->addStmtsp($3); } ; -rs_ruleList: // IEEE: rs_rule+ part of production +rs_ruleList: // IEEE: rs_rule+ part of rs_production rs_rule { $$ = $1; } | rs_ruleList '|' rs_rule { $$ = addNextNull($1, $3); } ; rs_rule: // ==IEEE: rs_rule rs_production_list { $$ = $1; } - | rs_production_list yP_COLONEQ weight_specification + | rs_production_list yP_COLONEQ rs_weight_specification { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence rule"); } - | rs_production_list yP_COLONEQ weight_specification rs_code_block + | rs_production_list yP_COLONEQ rs_weight_specification rs_code_block { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence rule"); } ; rs_production_list: // ==IEEE: rs_production_list rs_prodList { $$ = $1; } - | yRAND yJOIN /**/ production_item production_itemList + | yRAND yJOIN rs_production_item rs_production_itemList { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence production list"); } - | yRAND yJOIN '(' expr ')' production_item production_itemList + | yRAND yJOIN '(' expr ')' rs_production_item rs_production_itemList { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence production list"); } ; -weight_specification: // ==IEEE: weight_specification +rs_weight_specification: // ==IEEE: rs_weight_specification intnumAsConst { $$ = $1; } | idClassSel/*ps_identifier*/ { $$ = $1; } | '(' expr ')' { $$ = $2; } @@ -6694,27 +6691,27 @@ rs_prodList: // IEEE: rs_prod+ ; rs_prod: // ==IEEE: rs_prod - production_item { $$ = $1; } + rs_production_item { $$ = $1; } | rs_code_block { $$ = $1; } // // IEEE: rs_if_else - | yIF '(' expr ')' production_item %prec prLOWER_THAN_ELSE + | yIF '(' expr ')' rs_production_item %prec prLOWER_THAN_ELSE { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence if"); } - | yIF '(' expr ')' production_item yELSE production_item + | yIF '(' expr ')' rs_production_item yELSE rs_production_item { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence if"); } // // IEEE: rs_repeat - | yREPEAT '(' expr ')' production_item + | yREPEAT '(' expr ')' rs_production_item { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence repeat"); } // // IEEE: rs_case | yCASE '(' expr ')' rs_case_itemList yENDCASE { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence case"); } ; -production_itemList: // IEEE: production_item+ - production_item { $$ = $1; } - | production_itemList production_item { $$ = addNextNull($1, $2); } +rs_production_itemList: // IEEE: rs_production_item+ + rs_production_item { $$ = $1; } + | rs_production_itemList rs_production_item { $$ = addNextNull($1, $2); } ; -production_item: // ==IEEE: production_item +rs_production_item: // ==IEEE: rs_production_item id/*production_identifier*/ { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence production id"); } | id/*production_identifier*/ '(' list_of_argumentsE ')' @@ -6727,11 +6724,11 @@ rs_case_itemList: // IEEE: rs_case_item+ ; rs_case_item: // ==IEEE: rs_case_item - caseCondList ':' production_item ';' + caseCondList ':' rs_production_item ';' { $$ = nullptr; BBUNSUP($2, "Unsupported: randsequence case item"); } - | yDEFAULT production_item ';' + | yDEFAULT rs_production_item ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence case item"); } - | yDEFAULT ':' production_item ';' + | yDEFAULT ':' rs_production_item ';' { $$ = nullptr; BBUNSUP($1, "Unsupported: randsequence case item"); } ; @@ -6813,7 +6810,7 @@ checker_generate_item: // ==IEEE: checker_generate_item | c_conditional_generate_construct { $$ = $1; } | c_generate_region { $$ = $1; } // - | elaboration_system_task { $$ = $1; } + | severity_system_task { $$ = $1; } ; //UNSUPchecker_instantiation: @@ -7148,7 +7145,7 @@ constraint_expression: // ==IEEE: constraint_expression | ySOFT expr/*expression_or_dist*/ ';' { $$ = nullptr; /*UNSUP-no-UVM*/ } // // 1800-2012: // // IEEE: uniqueness_constraint ';' - | yUNIQUE '{' open_range_list '}' { $$ = nullptr; /*UNSUP-no-UVM*/ } + | yUNIQUE '{' range_list '}' { $$ = nullptr; /*UNSUP-no-UVM*/ } // // IEEE: expr yP_MINUSGT constraint_set // // Conflicts with expr:"expr yP_MINUSGT expr"; rule moved there //