cxxrtl: restore C++11 compatibility.
authorwhitequark <whitequark@whitequark.org>
Wed, 10 Jun 2020 15:49:28 +0000 (15:49 +0000)
committerwhitequark <whitequark@whitequark.org>
Wed, 10 Jun 2020 15:57:07 +0000 (15:57 +0000)
This is necessary to be able to build CXXRTL models via yosys-config.

backends/cxxrtl/cxxrtl_backend.cc

index 785625f17f3ab2823b58b96f0ea346fd673ef04b..ed2d3261e7ff8271dc108a2a4bd33585220fea01 100644 (file)
@@ -1922,8 +1922,9 @@ struct CxxrtlWorker {
                if (top_module != nullptr && debug_info) {
                        f << "cxxrtl_toplevel " << design_ns << "_create() {\n";
                        inc_indent();
+                               std::string top_type = design_ns + "::" + mangle(top_module);
                                f << indent << "return new _cxxrtl_toplevel { ";
-                               f << "std::make_unique<" << design_ns << "::" << mangle(top_module) << ">()";
+                               f << "std::unique_ptr<" << top_type << ">(new " + top_type + ")";
                                f << " };\n";
                        dec_indent();
                        f << "}\n";