aboutsummaryrefslogtreecommitdiffstats
path: root/backends/cxxrtl/cxxrtl_backend.cc
diff options
context:
space:
mode:
authorwhitequark <whitequark@whitequark.org>2020-12-13 18:16:55 +0000
committerwhitequark <whitequark@whitequark.org>2020-12-15 11:02:38 +0000
commitf75bc6c7aac92c7c1c8954ec7fe5325a94e6e491 (patch)
tree3470df22d68e3e847981b3413827edaf4981f461 /backends/cxxrtl/cxxrtl_backend.cc
parent4d40595d644cfe58425a3de023c712641c429010 (diff)
downloadyosys-f75bc6c7aac92c7c1c8954ec7fe5325a94e6e491.tar.gz
yosys-f75bc6c7aac92c7c1c8954ec7fe5325a94e6e491.tar.bz2
yosys-f75bc6c7aac92c7c1c8954ec7fe5325a94e6e491.zip
cxxrtl: disable optimization of debug_items().
Implementing outlining has greatly increased the amount of debug information in a typical build, and consequently exposed performance issues in C++ compilers, which are similar for both GCC and Clang; the compile time of Minerva SoC SRAM increased almost twofold. Although one would expect the slowdown to be caused by the increased use of templates in `debug_eval()`, it is actually almost entirely attributable to optimizations and codegen for `debug_items()`. Fortunately, it is neither possible nor desirable to optimize `debug_items()`: in most cases it is called exactly once, and its body is a linear sequence of calls with unique arguments. This commit turns off optimizations for `debug_items()` on GCC and Clang, improving -Os compile time of Minerva SoC SRAM by ~40% (!)
Diffstat (limited to 'backends/cxxrtl/cxxrtl_backend.cc')
-rw-r--r--backends/cxxrtl/cxxrtl_backend.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc
index fa19a8dd6..7bf44626a 100644
--- a/backends/cxxrtl/cxxrtl_backend.cc
+++ b/backends/cxxrtl/cxxrtl_backend.cc
@@ -2038,6 +2038,7 @@ struct CxxrtlWorker {
f << indent << "}\n";
f << "\n";
}
+ f << indent << "CXXRTL_EXTREMELY_COLD\n";
f << indent << "void " << mangle(module) << "::debug_info(debug_items &items, std::string path) {\n";
dump_debug_info_method(module);
f << indent << "}\n";