From 1da07a3b866e1bf128985477b5172ace0e284c39 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 1 Dec 2009 21:55:56 -0500 Subject: [PATCH] Fix auto-indentation of AstCStmts --- src/V3Active.cpp | 2 +- src/V3Clock.cpp | 2 +- src/V3Depth.cpp | 1 + src/V3Descope.cpp | 2 +- src/V3EmitC.cpp | 6 ++++++ src/V3ParseImp.h | 1 - src/V3Task.cpp | 2 +- src/verilog.y | 2 +- test_regress/driver.pl | 9 ++++++--- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/V3Active.cpp b/src/V3Active.cpp index e81de6479..5c7584c33 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -251,7 +251,7 @@ private: if (!m_scopeFinalp) { m_scopeFinalp = new AstCFunc(nodep->fileline(), "_final", m_namer.scopep()); m_scopeFinalp->argTypes(EmitCBaseVisitor::symClassVar()); - m_scopeFinalp->addInitsp(new AstCStmt(nodep->fileline()," "+EmitCBaseVisitor::symTopAssign()+"\n")); + m_scopeFinalp->addInitsp(new AstCStmt(nodep->fileline(), EmitCBaseVisitor::symTopAssign()+"\n")); m_scopeFinalp->dontCombine(true); m_scopeFinalp->formCallTree(true); m_scopeFinalp->slow(true); diff --git a/src/V3Clock.cpp b/src/V3Clock.cpp index ec93a2c3d..7ff4fb7b2 100644 --- a/src/V3Clock.cpp +++ b/src/V3Clock.cpp @@ -235,7 +235,7 @@ private: funcp->addInitsp( new AstCStmt(nodep->fileline(), " "+EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n")); - funcp->addInitsp(new AstCStmt(nodep->fileline()," "+EmitCBaseVisitor::symTopAssign()+"\n")); + funcp->addInitsp(new AstCStmt(nodep->fileline(), EmitCBaseVisitor::symTopAssign()+"\n")); m_scopep->addActivep(funcp); m_finalFuncp = funcp; } diff --git a/src/V3Depth.cpp b/src/V3Depth.cpp index 4b5c4f4e3..b18071c77 100644 --- a/src/V3Depth.cpp +++ b/src/V3Depth.cpp @@ -131,6 +131,7 @@ private: //-------------------- // Marking of non-static functions (because they might need "this") + // (Here just to avoid another iteration) void needNonStaticFunc(AstNode* nodep) { if (!m_funcp) nodep->v3fatalSrc("Non-static accessor not under a function"); if (m_funcp->isStatic()) { diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index eb06ebe92..0cb9ee4dc 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -122,7 +122,7 @@ private: newfuncp->addInitsp( new AstCStmt(newfuncp->fileline(), " "+EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n")); - newfuncp->addInitsp(new AstCStmt(newfuncp->fileline()," "+EmitCBaseVisitor::symTopAssign()+"\n")); + newfuncp->addInitsp(new AstCStmt(newfuncp->fileline(), EmitCBaseVisitor::symTopAssign()+"\n")); topFuncp->addNextHere(newfuncp); // In the body, call each function if it matches the given scope for (FuncMmap::iterator eachIt = it; eachIt!=m_modFuncs.end() && eachIt->first==name; ++eachIt) { diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 3b47efef9..aafa5d574 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -415,9 +415,11 @@ public: ofp()->putsNoTracking(nodep->text()); } virtual void visit(AstCStmt* nodep, AstNUser*) { + putbs(""); nodep->bodysp()->iterateAndNext(*this); } virtual void visit(AstCMath* nodep, AstNUser*) { + putbs(""); nodep->bodysp()->iterateAndNext(*this); } virtual void visit(AstUCStmt* nodep, AstNUser*) { @@ -572,6 +574,9 @@ public: } // Just iterate + virtual void visit(AstNetlist* nodep, AstNUser*) { + nodep->iterateChildren(*this); + } virtual void visit(AstTopScope* nodep, AstNUser*) { nodep->iterateChildren(*this); } @@ -585,6 +590,7 @@ public: virtual void visit(AstNodeText*, AstNUser*) {} // Handled outside the Visit class virtual void visit(AstTraceDecl*, AstNUser*) {} // Handled outside the Visit class virtual void visit(AstTraceInc*, AstNUser*) {} // Handled outside the Visit class + virtual void visit(AstCFile*, AstNUser*) {} // Handled outside the Visit class // Default virtual void visit(AstNode* nodep, AstNUser*) { puts((string)"\n???? // "+nodep->prettyTypeName()+"\n"); diff --git a/src/V3ParseImp.h b/src/V3ParseImp.h index f11bfbcf5..93f084474 100644 --- a/src/V3ParseImp.h +++ b/src/V3ParseImp.h @@ -72,7 +72,6 @@ struct V3ParseBisonYYSType { AstPin* pinp; AstRange* rangep; AstSenTree* sentreep; - AstTask* taskp; AstVar* varp; }; }; diff --git a/src/V3Task.cpp b/src/V3Task.cpp index a85e10117..9d260acc8 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -540,7 +540,7 @@ private: // We need to get a pointer to all of our variables (may have eval'ed something else earlier) cfuncp->addInitsp( new AstCStmt(nodep->fileline(), - " "+EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n")); + EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n")); } else { // Need symbol table cfuncp->argTypes(EmitCBaseVisitor::symClassVar()); diff --git a/src/verilog.y b/src/verilog.y index c0c2d7020..416bfaf46 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -2015,7 +2015,7 @@ lifetime: // ==IEEE: lifetime | yAUTOMATIC { } ; -taskId: +taskId: tfIdScoped { $$ = new AstTask($1, *$1, NULL); SYMP->pushNewUnder($$, NULL); } diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 67ed714d5..6a54b2d7e 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -94,7 +94,7 @@ if ($#opt_tests<0) { mkdir "obj_dir"; mkdir "logs"; -my $okcnt=0; my $failcnt=0; +my $leftcnt=0; my $okcnt=0; my $failcnt=0; my @fails; foreach my $testpl (@opt_tests) { @@ -108,6 +108,7 @@ $Fork->wait_all(); # Wait for all children to finish sub one_test { my @params = @_; + $leftcnt++; $Fork->schedule ( run_on_start => sub { @@ -139,6 +140,8 @@ sub one_test { $failcnt++; if ($opt_stop) { die "%Error: --stop and errors found\n"; } } + $leftcnt--; + print "==SUMMARY: Left $leftcnt Passed $okcnt Failed $failcnt\n"; }, )->ready(); } @@ -203,12 +206,12 @@ sub report { $fh->print("\n"); $fh->print("="x70,"\n"); - $fh->print("TESTS Passed $okcnt Failed $failcnt\n"); + $fh->print("TESTS Passed $okcnt Failed $failcnt\n"); foreach my $f (@$fails) { chomp $f; $fh->print("$f\n"); } - $fh->print("TESTS Passed $okcnt Failed $failcnt\n"); + $fh->print("TESTS Passed $okcnt Failed $failcnt\n"); } #######################################################################