X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=backends%2Fcxxrtl%2Fcxxrtl_capi.cc;h=227173ba87f94de34b393a4eed57378c7c9ae706;hb=a7ee01065acc3522277230bcb31859193033d723;hp=1c3c63e3e54df39e4b54313be5817413d5e66f5a;hpb=3e13cfe53dd62f71820b227d4c04cc47bbb95001;p=yosys.git diff --git a/backends/cxxrtl/cxxrtl_capi.cc b/backends/cxxrtl/cxxrtl_capi.cc index 1c3c63e3e..227173ba8 100644 --- a/backends/cxxrtl/cxxrtl_capi.cc +++ b/backends/cxxrtl/cxxrtl_capi.cc @@ -32,9 +32,22 @@ const cxxrtl::debug_items &cxxrtl_debug_items_from_handle(cxxrtl_handle handle) } cxxrtl_handle cxxrtl_create(cxxrtl_toplevel design) { + return cxxrtl_create_at(design, ""); +} + +cxxrtl_handle cxxrtl_create_at(cxxrtl_toplevel design, const char *root) { + std::string path = root; + if (!path.empty()) { + // module::debug_info() accepts either an empty path, or a path ending in space to simplify + // the logic in generated code. While this is sketchy at best to expose in the C++ API, this + // would be a lot worse in the C API, so don't expose it here. + assert(path.back() != ' '); + path += ' '; + } + cxxrtl_handle handle = new _cxxrtl_handle; handle->module = std::move(design->module); - handle->module->debug_info(handle->objects); + handle->module->debug_info(handle->objects, path); delete design; return handle; } @@ -73,3 +86,7 @@ void cxxrtl_enum(cxxrtl_handle handle, void *data, for (auto &it : handle->objects.table) callback(data, it.first.c_str(), static_cast(&it.second[0]), it.second.size()); } + +void cxxrtl_outline_eval(cxxrtl_outline outline) { + outline->eval(); +}