From 893dee3434630d9f7cf7ed143e15ea613e360613 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 6 Jun 2020 10:21:16 -0400 Subject: [PATCH] Support --bbox-unsup parsing of forward defed class calls --- src/verilog.y | 8 +++++++- test_regress/t/t_class2.out | 3 --- test_regress/t/t_class_unsup_bad.out | 21 +++++++++++++++++++++ test_regress/t/t_class_unsup_bad.v | 10 ++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index 7d184e7da..efec4e9ee 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -3348,6 +3348,9 @@ taskRef: // IEEE: part of tf_call | id '(' list_of_argumentsE ')' { $$ = new AstTaskRef($1,*$1,$3); } | package_scopeIdFollows id '(' list_of_argumentsE ')' { $$ = AstDot::newIfPkg($2, $1, new AstTaskRef($2,*$2,$4)); } + | class_scopeIdFollows id '(' list_of_argumentsE ')' + { $$ = new AstTaskRef($2, *$2, $4); + BBUNSUP($2, "Unsupported: Class-scoped tasks"); } ; funcRef: // IEEE: part of tf_call @@ -3363,6 +3366,9 @@ funcRef: // IEEE: part of tf_call id '(' list_of_argumentsE ')' { $$ = new AstFuncRef($1, *$1, $3); } | package_scopeIdFollows id '(' list_of_argumentsE ')' { $$ = AstDot::newIfPkg($2, $1, new AstFuncRef($2,*$2,$4)); } + | class_scopeIdFollows id '(' list_of_argumentsE ')' + { $$ = new AstFuncRef($2, *$2, $4); + BBUNSUP($2, "Unsupported: Class-scoped functions"); } //UNSUP list_of_argumentE should be pev_list_of_argumentE //UNSUP: idDotted is really just id to allow dotted method calls ; @@ -4170,7 +4176,7 @@ exprScope: // scope and variable for use to inside an expression | yD_ROOT { $$ = new AstParseRef($1, VParseRefExp::PX_ROOT, "$root"); } | idArrayed { $$ = $1; } | package_scopeIdFollows idArrayed { $$ = AstDot::newIfPkg($2->fileline(), $1, $2); } - | class_scopeIdFollows idArrayed { $$ = $2; BBUNSUP($1, "Unsupported: scoped class reference"); } + | class_scopeIdFollows idArrayed { $$ = $2; BBUNSUP($2, "Unsupported: scoped class reference"); } | ~l~expr '.' idArrayed { $$ = new AstDot($2, false, $1, $3); } // // expr below must be a "yTHIS" | ~l~expr '.' ySUPER { $$ = $1; BBUNSUP($3, "Unsupported: super"); } diff --git a/test_regress/t/t_class2.out b/test_regress/t/t_class2.out index 7787ca18d..64a43df53 100644 --- a/test_regress/t/t_class2.out +++ b/test_regress/t/t_class2.out @@ -4,7 +4,4 @@ %Error: t/t_class2.v:35:16: Unsupported: scoped class reference 35 | if (Cls::ENUM_VAL != 22) $stop; | ^~~~~~~~ -%Error: t/t_class2.v:34:11: Unsupported: scoped class reference - 34 | if (Pkg::ENUMP_VAL != 33) $stop; - | ^~~ %Error: Exiting due to diff --git a/test_regress/t/t_class_unsup_bad.out b/test_regress/t/t_class_unsup_bad.out index 42116d10f..a2c32713b 100644 --- a/test_regress/t/t_class_unsup_bad.out +++ b/test_regress/t/t_class_unsup_bad.out @@ -25,4 +25,25 @@ %Error: t/t_class_unsup_bad.v:32:1: Unsupported: virtual classes 32 | virtual class VC; | ^~~~~~~ +%Error: t/t_class_unsup_bad.v:42:4: Unsupported: virtual class member qualifier + 42 | virtual function uvm_root get_root(); + | ^~~~~~~ +%Error: t/t_class_unsup_bad.v:43:15: Unsupported: Hierarchical class references + 43 | uvm_root::m_forward_task_call(); + | ^~ +%Error: t/t_class_unsup_bad.v:43:17: Unsupported: scoped class reference + 43 | uvm_root::m_forward_task_call(); + | ^~~~~~~~~~~~~~~~~~~ +%Error: t/t_class_unsup_bad.v:43:17: Unsupported: Class-scoped tasks + 43 | uvm_root::m_forward_task_call(); + | ^~~~~~~~~~~~~~~~~~~ +%Error: t/t_class_unsup_bad.v:44:22: Unsupported: Hierarchical class references + 44 | return uvm_root::m_uvm_get_root(); + | ^~ +%Error: t/t_class_unsup_bad.v:44:24: Unsupported: scoped class reference + 44 | return uvm_root::m_uvm_get_root(); + | ^~~~~~~~~~~~~~ +%Error: t/t_class_unsup_bad.v:44:24: Unsupported: Class-scoped functions + 44 | return uvm_root::m_uvm_get_root(); + | ^~~~~~~~~~~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_class_unsup_bad.v b/test_regress/t/t_class_unsup_bad.v index 7d4e032ce..69d5e9793 100644 --- a/test_regress/t/t_class_unsup_bad.v +++ b/test_regress/t/t_class_unsup_bad.v @@ -34,3 +34,13 @@ endclass module t (/*AUTOARG*/); endmodule + +typedef class uvm_root; +typedef class uvm_coreservice_t; + +class uvm_default_coreservice_t extends uvm_coreservice_t; + virtual function uvm_root get_root(); + uvm_root::m_forward_task_call(); + return uvm_root::m_uvm_get_root(); + endfunction +endclass