Skip to content

Commit

Permalink
Backout last commit; is unstable.
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed Jan 3, 2022
1 parent e9ad665 commit 4d1f4bb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 23 deletions.
9 changes: 3 additions & 6 deletions src/V3LinkDot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ class LinkDotResolveVisitor final : public VNVisitor {
VSymEnt* m_pinSymp = nullptr; // SymEnt for pin lookups
const AstCell* m_cellp = nullptr; // Current cell
AstNodeModule* m_modp = nullptr; // Current module
AstNodeFTask* m_ftaskp = nullptr; // Current function/task
const AstNodeFTask* m_ftaskp = nullptr; // Current function/task
int m_modportNum = 0; // Uniqueify modport numbers

struct DotStates {
Expand Down Expand Up @@ -2748,11 +2748,8 @@ class LinkDotResolveVisitor final : public VNVisitor {
if (foundp) {
if (VN_IS(foundp->nodep(), Var) && m_ds.m_dotText == "" && m_ftaskp
&& m_ftaskp->name() == foundp->nodep()->name()) {
// This is a recursive reference to the function itself, not to the var
nodep->taskp(m_ftaskp);
nodep->classOrPackagep(foundp->classOrPackagep());
UINFO(7, " Resolved recursive " << nodep
<< endl); // Also prints taskp
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Recursive function call "
<< nodep->prettyNameQ());
} else {
nodep->v3error("Found definition of '"
<< m_ds.m_dotText << (m_ds.m_dotText == "" ? "" : ".")
Expand Down
3 changes: 1 addition & 2 deletions src/V3Width.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4538,8 +4538,7 @@ class WidthVisitor final : public VNVisitor {
// Grab width from the output variable (if it's a function)
if (nodep->didWidth()) return;
if (nodep->doingWidth()) {
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Recursive function or task call: "
<< nodep->prettyNameQ());
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Recursive function or task call");
nodep->dtypeSetBit();
nodep->didWidth(true);
return;
Expand Down
7 changes: 3 additions & 4 deletions test_regress/t/t_func_recurse.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
%Error-UNSUPPORTED: t/t_func_recurse.v:9:27: Unsupported: Recursive function or task call: 'recurse_self'
: ... In instance t
9 | function automatic int recurse_self;
| ^~~~~~~~~~~~
%Error-UNSUPPORTED: t/t_func_recurse.v:12:31: Unsupported: Recursive function call 'recurse_self'
12 | else recurse_self = i + recurse_self(i - 1) * 2;
| ^~~~~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: Exiting due to
2 changes: 1 addition & 1 deletion test_regress/t/t_func_recurse2.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%Error-UNSUPPORTED: t/t_func_recurse2.v:9:27: Unsupported: Recursive function or task call: 'recurse_1'
%Error-UNSUPPORTED: t/t_func_recurse2.v:9:27: Unsupported: Recursive function or task call
: ... In instance t
9 | function automatic int recurse_1;
| ^~~~~~~~~
Expand Down
7 changes: 3 additions & 4 deletions test_regress/t/t_func_recurse_param.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
%Error-UNSUPPORTED: t/t_func_recurse_param.v:9:27: Unsupported: Recursive function or task call: 'recurse_self'
: ... In instance t
9 | function automatic int recurse_self;
| ^~~~~~~~~~~~
%Error-UNSUPPORTED: t/t_func_recurse_param.v:12:31: Unsupported: Recursive function call 'recurse_self'
12 | else recurse_self = i + recurse_self(i - 1) * 2;
| ^~~~~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: Exiting due to
10 changes: 4 additions & 6 deletions test_regress/t/t_func_recurse_param_bad.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
%Error-UNSUPPORTED: t/t_func_recurse_param_bad.v:9:27: Unsupported: Recursive function or task call: 'recurse_self'
: ... In instance t
9 | function automatic int recurse_self;
| ^~~~~~~~~~~~
%Error-UNSUPPORTED: t/t_func_recurse_param_bad.v:12:31: Unsupported: Recursive function call 'recurse_self'
12 | else recurse_self = i + recurse_self(i - 1) * 2;
| ^~~~~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: Verilator internal fault, sorry. Suggest trying --debug --gdbbt
%Error: Command Failed
%Error: Exiting due to

0 comments on commit 4d1f4bb

Please sign in to comment.