From 40bdd85a07aef24808f231b7034da94bce15ffa9 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 29 Oct 2019 22:57:25 -0400 Subject: [PATCH] Fix minor output spacing issues. --- MANIFEST.SKIP | 1 + bin/verilator | 2 +- nodist/fuzzer/wrapper.cpp | 6 +++--- src/V3EmitC.cpp | 21 +++++++++++---------- test_regress/driver.pl | 14 ++++++-------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index e6f73b20a..5583e8d36 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -1,3 +1,4 @@ +\.clang-format \.clang-tidy \.git/ \.git$ diff --git a/bin/verilator b/bin/verilator index f2442a0e5..12e52611c 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1823,7 +1823,7 @@ This is an example similar to the above, but using SystemC. cat >sc_main.cpp <<'EOF' #include "Vour.h" - int sc_main(int argc, char **argv) { + int sc_main(int argc, char** argv) { Verilated::commandArgs(argc, argv); sc_clock clk ("clk", 10, 0.5, 3, true); Vour* top; diff --git a/nodist/fuzzer/wrapper.cpp b/nodist/fuzzer/wrapper.cpp index 6a86ae42d..25ea4b028 100644 --- a/nodist/fuzzer/wrapper.cpp +++ b/nodist/fuzzer/wrapper.cpp @@ -19,8 +19,8 @@ // This does slow down the execution to some degree but makes the results // more reliable. -int main(int argc, char **argv, char **envp) { +int main(int argc, char** argv, char** envp) { auto r = system("rm -rf obj_dir"); - assert(r==0); - return execve("../../bin/verilator_bin",argv,envp); + assert(r == 0); + return execve("../../bin/verilator_bin", argv, envp); } diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index fb4e9bd58..bee5d2751 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -528,16 +528,16 @@ public: virtual void visit(AstStop* nodep) { puts("VL_STOP_MT("); putsQuoted(protect(nodep->fileline()->filename())); - puts(","); + puts(", "); puts(cvtToStr(nodep->fileline()->lineno())); - puts(",\"\");\n"); + puts(", \"\");\n"); } virtual void visit(AstFinish* nodep) { puts("VL_FINISH_MT("); putsQuoted(protect(nodep->fileline()->filename())); - puts(","); + puts(", "); puts(cvtToStr(nodep->fileline()->lineno())); - puts(",\"\");\n"); + puts(", \"\");\n"); } virtual void visit(AstText* nodep) { if (nodep->tracking() || m_trackText) { @@ -2138,7 +2138,7 @@ void EmitCImp::emitSettleLoop(const std::string& eval_call, bool initial) { puts( "Verilated::debug(1);\n"); puts( "__Vchange = "+protect("_change_request")+"(vlSymsp);\n"); puts( "Verilated::debug(__Vsaved_debug);\n"); - puts( "VL_FATAL_MT(__FILE__,__LINE__,__FILE__,\"Verilated model didn't "); + puts( "VL_FATAL_MT(__FILE__, __LINE__, __FILE__, \"Verilated model didn't "); if (initial) puts("DC "); puts( "converge\");\n"); puts( "} else {\n"); @@ -2652,13 +2652,13 @@ void EmitCImp::emitInt(AstNodeModule* modp) { puts("/// The special name "" may be used to make a wrapper with a\n"); puts("/// single model invisible with respect to DPI scope names.\n"); } - puts(modClassName(modp)+"(const char* name=\"TOP\");\n"); + puts(modClassName(modp)+"(const char* name = \"TOP\");\n"); if (modp->isTop()) puts("/// Destroy the model; called (often implicitly) by application code\n"); puts("~"+modClassName(modp)+"();\n"); } if (v3Global.opt.trace() && modp->isTop()) { puts("/// Trace signals in the model; called by application code\n"); - puts("void trace("+v3Global.opt.traceClassBase()+"C* tfp, int levels, int options=0);\n"); + puts("void trace("+v3Global.opt.traceClassBase()+"C* tfp, int levels, int options = 0);\n"); if (optSystemC()) { puts("/// SC tracing; avoid overloaded virtual function lint warning\n"); puts("virtual void trace(sc_trace_file* tfp) const { ::sc_core::sc_module::trace(tfp); }\n"); @@ -2892,7 +2892,8 @@ class EmitCTrace : EmitCStmts { puts(topClassName()+"* t = ("+topClassName()+"*)userthis;\n"); puts(EmitCBaseVisitor::symClassVar()+" = t->__VlSymsp; // Setup global symbol table\n"); puts("if (!Verilated::calcUnusedSigs()) {\n"); - puts( "VL_FATAL_MT(__FILE__,__LINE__,__FILE__,\"Turning on wave traces requires Verilated::traceEverOn(true) call before time 0.\");\n"); + puts( "VL_FATAL_MT(__FILE__, __LINE__, __FILE__,\n"); + puts( " \"Turning on wave traces requires Verilated::traceEverOn(true) call before time 0.\");\n"); puts("}\n"); puts("vcdp->scopeEscape(' ');\n"); puts("t->"+protect("traceInitThis")+"(vlSymsp, vcdp, code);\n"); @@ -2974,7 +2975,7 @@ class EmitCTrace : EmitCStmts { if (nodep->declDirection().isInoutish()) puts(",FST_VD_INOUT"); else if (nodep->declDirection().isWritable()) puts(",FST_VD_OUTPUT"); else if (nodep->declDirection().isNonOutput()) puts(",FST_VD_INPUT"); - else puts(",FST_VD_IMPLICIT"); + else puts(", FST_VD_IMPLICIT"); // // fstVarType AstVarType vartype = nodep->varType(); @@ -3165,7 +3166,7 @@ class EmitCTrace : EmitCStmts { if (nodep->symProlog()) puts(EmitCBaseVisitor::symTopAssign()+"\n"); - puts("int c=code;\n"); + puts("int c = code;\n"); puts("if (0 && vcdp && c) {} // Prevent unused\n"); if (nodep->funcType() == AstCFuncType::TRACE_INIT) { puts("vcdp->module(vlSymsp->name()); // Setup signal names\n"); diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 498f64995..6e7f1a375 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -1577,12 +1577,10 @@ sub _make_main { print $fh "#include \"verilated_vcd_sc.h\"\n" if $self->{trace} && $self->{trace_format} eq 'vcd-sc'; print $fh "#include \"verilated_save.h\"\n" if $self->{savable}; - print $fh "$VM_PREFIX * topp;\n"; + print $fh "$VM_PREFIX* topp;\n"; if (!$self->sc) { print $fh "vluint64_t main_time = false;\n"; - print $fh "double sc_time_stamp() {\n"; - print $fh " return main_time;\n"; - print $fh "}\n"; + print $fh "double sc_time_stamp() { return main_time; }\n"; } if ($self->{savable}) { @@ -1608,13 +1606,13 @@ sub _make_main { #### Main if ($self->sc) { - print $fh "extern int sc_main(int argc, char **argv);\n"; - print $fh "int sc_main(int argc, char **argv) {\n"; + print $fh "extern int sc_main(int argc, char** argv);\n"; + print $fh "int sc_main(int argc, char** argv) {\n"; print $fh " sc_signal fastclk;\n" if $self->{inputs}{fastclk}; print $fh " sc_signal clk;\n" if $self->{inputs}{clk}; print $fh " sc_time sim_time($self->{sim_time}, SC_NS);\n"; } else { - print $fh "int main(int argc, char **argv, char **env) {\n"; + print $fh "int main(int argc, char** argv, char** env) {\n"; print $fh " double sim_time = $self->{sim_time};\n"; } print $fh " Verilated::commandArgs(argc, argv);\n"; @@ -1690,7 +1688,7 @@ sub _make_main { } print $fh " }\n"; print $fh " if (!Verilated::gotFinish()) {\n"; - print $fh ' vl_fatal(__FILE__,__LINE__,"main", "%Error: Timeout; never got a $finish");',"\n"; + print $fh ' vl_fatal(__FILE__, __LINE__, "main", "%Error: Timeout; never got a $finish");',"\n"; print $fh " }\n"; print $fh " topp->final();\n";