diff --git a/bin/verilator b/bin/verilator index c6e1c441f..b65cd9b25 100755 --- a/bin/verilator +++ b/bin/verilator @@ -232,6 +232,7 @@ descriptions in the next sections for more information. -O0 Disable optimizations -O3 High performance optimizations -O Selectable optimizations + -o Name of final executable --output-split Split .cpp files into pieces --output-split-cfuncs Split .ccp functions --pins-bv Specify types for top level ports @@ -564,6 +565,11 @@ disables an optimization, an upper case letter enables it. This is intended for debugging use only; see the source code for version-dependent mappings of optimizations to -O letters. +=item -o + +Specify the name for the final executable built if using --exe. Defaults +to the --prefix if not specified. + =item --output-split I Enables splitting the output .cpp/.sp files into multiple outputs. When a diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp index 1dc785e1b..979e01f76 100644 --- a/src/V3EmitMk.cpp +++ b/src/V3EmitMk.cpp @@ -119,7 +119,7 @@ public: of.puts("\n"); if (v3Global.opt.exe()) { - of.puts("default: "+v3Global.opt.prefix()+"\n"); + of.puts("default: "+v3Global.opt.exeName()+"\n"); } else { of.puts("default: "+v3Global.opt.prefix()+"__ALL.a\n"); } @@ -205,7 +205,7 @@ public: } of.puts("\n### Link rules... (from --exe)\n"); - of.puts(v3Global.opt.prefix()+": $(VK_USER_OBJS) $(VK_GLOBAL_OBJS) $(VM_PREFIX)__ALL.a\n"); + of.puts(v3Global.opt.exeName()+": $(VK_USER_OBJS) $(VK_GLOBAL_OBJS) $(VM_PREFIX)__ALL.a\n"); of.puts("\t$(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) $(SC_LIBS) 2>&1 | c++filt\n"); of.puts("\n"); } diff --git a/src/V3Options.cpp b/src/V3Options.cpp index f0d3cdda7..92d6bfed0 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -750,6 +750,9 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) { shift; m_makeDir = argv[i]; addIncDir (string (m_makeDir)); // Need to find generated files there too } + else if ( !strcmp (sw, "-o") && (i+1)_run(logfile=>"$self->{obj_dir}/vlt_sim.log", cmd=>[($run_env .($opt_gdbsim ? "gdbrun ":"") - ."$self->{obj_dir}/$param{VM_PREFIX}"), + .$param{executable}), @{$param{all_run_flags}}, ], %param,