diff --git a/Changes b/Changes index c2e473987..be9990507 100644 --- a/Changes +++ b/Changes @@ -6,18 +6,22 @@ indicates the contributor was also the author of the fix; Thanks! * Verilator 3.65** ** Add --compiler msvc option. This is now required when Verilated code - is to be run through MSVC++. This also enables fixing error C1061, - blocks nested too deeply. [Ralf Karge] + is to be run through MSVC++. This also enables fixing MSVC++ error + C1061, blocks nested too deeply. [Ralf Karge] -** Add --lint-only option. +** Add --lint-only option, to lint without creating other output. *** Add /*verilator lint_save*/ and /*verilator lint_restore*/ to allow - friendly control over re-enabling lint messages. [Gerald Williams] + friendly control over re-enabling lint messages. [Gerald Williams] *** Support SystemVerilog .name and .* interconnect. *** Support while and do-while loops. +*** Use $(LINK) instead of $(CXX) for Makefile link rules. [Gerald Williams] + +*** Add USER_CPPFLAGS and USER_LDFLAGS to Makefiles. [Gerald Williams] + **** Fix compile errors under Windows MINGW compiler. [Gerald Williams] **** Fix dotted bit reference to local memory. [Eugene Weber] diff --git a/include/verilated.mk.in b/include/verilated.mk.in index 83c846354..67a476564 100644 --- a/include/verilated.mk.in +++ b/include/verilated.mk.in @@ -49,7 +49,12 @@ VPATH += $(VERILATOR_ROOT)/include CPPFLAGS += $(OPT) CPPFLAGS += $(M32) -LDFLAGS += $(M32) +LDFLAGS += $(M32) + +# Allow upper level user makefiles to specify flags they want. +# These aren't ever set by Verilator, so users are free to override them. +CPPFLAGS += $(USER_CPPFLAGS) +LDFLAGS += $(USER_LDFLAGS) # See the benchmarking section of bin/verilator. # Support class optimizations. This includes the tracing and symbol table. diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp index a90a8aa80..43632647a 100644 --- a/src/V3EmitMk.cpp +++ b/src/V3EmitMk.cpp @@ -138,7 +138,7 @@ public: of.puts("\n# Link rules...\n"); of.puts(v3Global.opt.prefix()+": $(VK_USER_OBJS) $(SP_SRCS) $(VM_PREFIX)__ALL.a\n"); - of.puts("\t$(CXX) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt\n"); + of.puts("\t$(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt\n"); of.puts("\n"); } diff --git a/src/Verilator.cpp b/src/Verilator.cpp index 1a8387990..c0dcc7405 100644 --- a/src/Verilator.cpp +++ b/src/Verilator.cpp @@ -381,7 +381,7 @@ void process () { //--MODULE OPTIMIZATIONS-------------- // Split deep blocks to appease MSVC++. Must be before Localize. - if (v3Global.opt.compLimitBlocks()) { + if (!v3Global.opt.lintOnly() && v3Global.opt.compLimitBlocks()) { V3DepthBlock::depthBlockAll(v3Global.rootp()); v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("deepblock.tree")); } diff --git a/test_c/Makefile_obj b/test_c/Makefile_obj index ea2c36dce..b0984953c 100644 --- a/test_c/Makefile_obj +++ b/test_c/Makefile_obj @@ -34,6 +34,6 @@ ifeq ($(VM_TRACE),1) endif simx: sim_main.o $(SP_SRCS) $(VM_PREFIX)__ALL.a - $(CXX) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt + $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt sim_main.o: sim_main.cpp $(VM_PREFIX).h diff --git a/test_regress/Makefile_obj b/test_regress/Makefile_obj index 624c7dd3d..c73fac543 100644 --- a/test_regress/Makefile_obj +++ b/test_regress/Makefile_obj @@ -43,7 +43,7 @@ endif #Default compile, using normal make rules #$(VM_PREFIX): $(SP_SRCS) $(VK_OBJS) -# $(CXX) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt +# $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt #Our own compile rules; Faster compile, all in one file $(VM_PREFIX)__ALLboth.cpp: $(VK_CLASSES_CPP) $(VK_SUPPORT_CPP) @@ -54,5 +54,5 @@ $(VM_PREFIX)__ALLboth.o: $(VM_PREFIX)__ALLboth.cpp ifneq ($(MAKE_MAIN),0) $(VM_PREFIX): $(VM_PREFIX)__ALLboth.o - $(CXX) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt + $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt endif diff --git a/test_sc/Makefile_obj b/test_sc/Makefile_obj index 9fb04535c..aae953384 100644 --- a/test_sc/Makefile_obj +++ b/test_sc/Makefile_obj @@ -32,7 +32,7 @@ SC_LIB = $(SYSTEMC)/lib-$(VM_SC_TARGET_ARCH)/libsystemc.a simx: sc_main.o $(SP_SRCS) \ $(VM_PREFIX)__ALL.a $(SC_LIB) - $(CXX) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(SC_LIBS) $(LIBS) 2>&1 | c++filt + $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(SC_LIBS) $(LIBS) 2>&1 | c++filt VPATH += ../test_sp diff --git a/test_sp/Makefile_obj b/test_sp/Makefile_obj index 9325a346f..252f6bf4f 100644 --- a/test_sp/Makefile_obj +++ b/test_sp/Makefile_obj @@ -36,6 +36,6 @@ SC_LIB = $(SYSTEMC)/lib-$(VM_SC_TARGET_ARCH)/libsystemc.a simx: sc_main.o $(SP_SRCS) \ $(VM_PREFIX)__ALL.a $(SC_LIB) - $(CXX) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(SC_LIBS) $(LIBS) 2>&1 | c++filt + $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(SC_LIBS) $(LIBS) 2>&1 | c++filt sc_main.o: sc_main.cpp $(VM_PREFIX).h diff --git a/test_verilated/Makefile_obj b/test_verilated/Makefile_obj index 4f8638b78..4afdc6a60 100644 --- a/test_verilated/Makefile_obj +++ b/test_verilated/Makefile_obj @@ -32,6 +32,6 @@ SP_SRCS = verilated.o #SP_SRCS = sp_log.o SpTraceVcd.o simx: sim_main.o $(SP_SRCS) $(VM_PREFIX)__ALL.a - $(CXX) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt + $(LINK) $(LDFLAGS) -g $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LIBS) 2>&1 | c++filt sim_main.o: sim_main.cpp $(VM_PREFIX).h