diff --git a/Changes b/Changes index a92f80239..36a705a1e 100644 --- a/Changes +++ b/Changes @@ -5,13 +5,14 @@ indicates the contributor was also the author of the fix; Thanks! * Verilator 3.60** -** Many changes to the pointers used for internal structures. - When used with gcc's -fstrict-aliasing, large models are ~***% faster. +*** Changed how internal functions are invoked to avoid aliasing in GCC 3.3+. *** Added --inhibit-sim flag for environments using old __Vm_inhibitSim. *** Added `systemc_dtor for destructor extentions. [Allan Cochrane] +*** Added -MP to make phony dependencies, ala GCC's. + **** Declare optimized lookup tables as 'static', to reduce D-Cache miss rate. **** Fix memory leak when destroying modules. [John Stroebel] diff --git a/bin/verilator b/bin/verilator index e22ca6dd7..75334375c 100755 --- a/bin/verilator +++ b/bin/verilator @@ -318,6 +318,11 @@ modules; they will always be inlined, if allowed. Enable creation of .d dependency files, used for make dependency detection, similar to gcc -MMD option. On by default, use --no-MMD to disable. +=item --MP + +When creating .d dependency files with --MMD, make phony targets. Similar +to gcc -MP option. + =item --Mdir I Specifies the name of the Make object directory. All generated files will @@ -645,14 +650,11 @@ fast path, mostly code that is executed every cycle. OPT_SLOW specifies optimizations for slow-path files (plus tracing), which execute only rarely, yet take a long time to compile with optimization on. OPT specifies overall optimization and affects all compiles, including those -OPT_FAST and OPT_SLOW affect. For best results, use OPT="-O2 --fstrict-aliasing". Nearly the same results can be had with much better -compile times with OPT_FAST="-O1 -fstrict-aliasing". Unfortunately, using -the optimizer with SystemC files can result in compiles taking several -minutes. (The SystemC libraries have many little inlined functions that -drive the compiler nuts.) Also read the manual as to the effects of --fstrict-aliasing; you may want to compile only the verilated code with -this flag. +OPT_FAST and OPT_SLOW affect. For best results, use OPT="-O2". Nearly the +same results can be had with much better compile times with OPT_FAST="-O1 +-fstrict-aliasing". Unfortunately, using the optimizer with SystemC files +can result in compiles taking several minutes. (The SystemC libraries have +many little inlined functions that drive the compiler nuts.) For best results, use GCC 3.3 or newer. GCC 3.2 and earlier have optimization bugs around pointer aliasing detection, which can result in 2x diff --git a/include/verilated.mk.in b/include/verilated.mk.in index c0103e976..716889335 100644 --- a/include/verilated.mk.in +++ b/include/verilated.mk.in @@ -22,6 +22,7 @@ SP_INCLUDER = $(PERL) $(VERILATOR_ROOT)/bin/verilator_includer ###################################################################### # C Preprocessor flags +# Add -MMD -MP if you're using a recent version of GCC. VK_CPPFLAGS_ALWAYS += \ -MMD \ -I$(VERILATOR_ROOT)/include \ diff --git a/src/Makefile_obj.in b/src/Makefile_obj.in index 87bbfec61..18b072ba4 100644 --- a/src/Makefile_obj.in +++ b/src/Makefile_obj.in @@ -65,6 +65,7 @@ CPPFLAGSNOWALL += -DYYDEBUG # Required to get nice error messages CPPFLAGSNOWALL += $(COPT) CPPFLAGS = $(CPPFLAGSNOWALL) ifeq ($(VERILATOR_AUTHOR_SITE),1) # Local... Else don't burden users +CPPFLAGSNOWALL += -MP # Only works on recent GCC versions CPPFLAGS += -W -Wall -Wno-unused-parameter -Wno-char-subscripts -Werror #CPPFLAGS += -pedantic-errors endif diff --git a/src/V3File.cpp b/src/V3File.cpp index 30a4ecc5c..0450c36cd 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -122,7 +122,18 @@ inline void V3FileDependImp::writeDepend(const string& filename) { *ofp<filename()<<" "; } } + *ofp<::iterator iter=m_filenameList.begin(); + iter!=m_filenameList.end(); ++iter) { + if (!iter->target()) { + *ofp<filename()<<":"<dumpTreeFile(v3Global.debugFilename("final.tree",99)); V3Error::abortIfErrors(); - if (v3Global.opt.depend()) { + if (v3Global.opt.makeDepend()) { V3File::writeDepend(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__ver.d"); } - if (v3Global.opt.skipIdentical() || v3Global.opt.depend()) { + if (v3Global.opt.skipIdentical() || v3Global.opt.makeDepend()) { V3File::writeTimes(v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__verFiles.dat", argString); }