mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Mark infrequently called functions with GCC cold attribute.
This commit is contained in:
parent
1fb0af7fba
commit
afea6d84e3
2
Changes
2
Changes
@ -10,6 +10,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
|||||||
|
|
||||||
**** Fix sign-compare warning in verilated.cpp, bug1437. [Sergey Kvachonok]
|
**** Fix sign-compare warning in verilated.cpp, bug1437. [Sergey Kvachonok]
|
||||||
|
|
||||||
|
**** Mark infrequently called functions with GCC cold attribute.
|
||||||
|
|
||||||
|
|
||||||
* Verilator 4.014 2019-05-08
|
* Verilator 4.014 2019-05-08
|
||||||
|
|
||||||
|
@ -1034,15 +1034,15 @@ developers.
|
|||||||
|
|
||||||
=item --output-split I<bytes>
|
=item --output-split I<bytes>
|
||||||
|
|
||||||
Enables splitting the output .cpp files into multiple outputs. When a
|
Enables splitting the output .cpp files into multiple outputs. When a C++
|
||||||
C++ file exceeds the specified number of operations, a new file will be
|
file exceeds the specified number of operations, a new file will be created
|
||||||
created at the next function boundary. In addition, any slow routines will
|
at the next function boundary. In addition, any infrequently executed
|
||||||
be placed into __Slow files. This accelerates compilation by as
|
"cold" routines will be placed into __Slow files. This accelerates
|
||||||
optimization can be disabled on the slow routines, and the remaining files
|
compilation by as optimization can be disabled on the routines in __Slow,
|
||||||
can be compiled on parallel machines. Using --output-split should have
|
and the remaining files can be compiled on parallel machines. Using
|
||||||
only a trivial impact on performance. With GCC 3.3 on a 2GHz Opteron,
|
--output-split should have only a trivial impact on performance. With GCC
|
||||||
--output-split 20000 will result in splitting into approximately
|
3.3 on a 2GHz Opteron, --output-split 20000 will result in splitting into
|
||||||
one-minute-compile chunks.
|
approximately one-minute-compile chunks.
|
||||||
|
|
||||||
=item --output-split-cfuncs I<statements>
|
=item --output-split-cfuncs I<statements>
|
||||||
|
|
||||||
@ -1871,7 +1871,7 @@ For -cc and -sc mode, it also creates:
|
|||||||
|
|
||||||
{prefix}.cpp // Top level C++ file
|
{prefix}.cpp // Top level C++ file
|
||||||
{prefix}.h // Top level header
|
{prefix}.h // Top level header
|
||||||
{prefix}__Slow{__n}.cpp // Constructors and infrequent routines
|
{prefix}__Slow{__n}.cpp // Constructors and infrequent cold routines
|
||||||
{prefix}{__n}.cpp // Additional top C++ files (--output-split)
|
{prefix}{__n}.cpp // Additional top C++ files (--output-split)
|
||||||
{prefix}{each_verilog_module}.cpp // Lower level internal C++ files
|
{prefix}{each_verilog_module}.cpp // Lower level internal C++ files
|
||||||
{prefix}{each_verilog_module}.h // Lower level internal header files
|
{prefix}{each_verilog_module}.h // Lower level internal header files
|
||||||
|
@ -36,6 +36,8 @@
|
|||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# define VL_ATTR_ALIGNED(alignment) __attribute__ ((aligned (alignment)))
|
# define VL_ATTR_ALIGNED(alignment) __attribute__ ((aligned (alignment)))
|
||||||
# define VL_ATTR_ALWINLINE __attribute__ ((always_inline))
|
# define VL_ATTR_ALWINLINE __attribute__ ((always_inline))
|
||||||
|
# define VL_ATTR_COLD __attribute__ ((cold))
|
||||||
|
# define VL_ATTR_HOT __attribute__ ((hot))
|
||||||
# define VL_ATTR_NORETURN __attribute__ ((noreturn))
|
# define VL_ATTR_NORETURN __attribute__ ((noreturn))
|
||||||
# define VL_ATTR_PRINTF(fmtArgNum) __attribute__ ((format (printf, (fmtArgNum), (fmtArgNum)+1)))
|
# define VL_ATTR_PRINTF(fmtArgNum) __attribute__ ((format (printf, (fmtArgNum), (fmtArgNum)+1)))
|
||||||
# define VL_ATTR_PURE __attribute__ ((pure))
|
# define VL_ATTR_PURE __attribute__ ((pure))
|
||||||
@ -70,6 +72,12 @@
|
|||||||
#ifndef VL_ATTR_ALWINLINE
|
#ifndef VL_ATTR_ALWINLINE
|
||||||
# define VL_ATTR_ALWINLINE ///< Inline, even when not optimizing
|
# define VL_ATTR_ALWINLINE ///< Inline, even when not optimizing
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef VL_ATTR_COLD
|
||||||
|
# define VL_ATTR_COLD ///< Function is rarely executed
|
||||||
|
#endif
|
||||||
|
#ifndef VL_ATTR_HOT
|
||||||
|
# define VL_ATTR_HOT ///< Function is highly executed
|
||||||
|
#endif
|
||||||
#ifndef VL_ATTR_NORETURN
|
#ifndef VL_ATTR_NORETURN
|
||||||
# define VL_ATTR_NORETURN ///< Function does not ever return
|
# define VL_ATTR_NORETURN ///< Function does not ever return
|
||||||
#endif
|
#endif
|
||||||
|
@ -2367,7 +2367,9 @@ void EmitCImp::emitIntFuncDecls(AstNodeModule* modp) {
|
|||||||
if (funcp->ifdef()!="") puts("#ifdef "+funcp->ifdef()+"\n");
|
if (funcp->ifdef()!="") puts("#ifdef "+funcp->ifdef()+"\n");
|
||||||
if (funcp->isStatic().trueU()) puts("static ");
|
if (funcp->isStatic().trueU()) puts("static ");
|
||||||
puts(funcp->rtnTypeVoid()); puts(" ");
|
puts(funcp->rtnTypeVoid()); puts(" ");
|
||||||
puts(funcp->name()); puts("("+cFuncArgs(funcp)+");\n");
|
puts(funcp->name()); puts("("+cFuncArgs(funcp)+")");
|
||||||
|
if (funcp->slow()) puts(" VL_ATTR_COLD");
|
||||||
|
puts(";\n");
|
||||||
if (funcp->ifdef()!="") puts("#endif // "+funcp->ifdef()+"\n");
|
if (funcp->ifdef()!="") puts("#endif // "+funcp->ifdef()+"\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user