diff --git a/openfpga/src/base/openfpga_build_fabric_template.h b/openfpga/src/base/openfpga_build_fabric_template.h index 87d40c439..21fa7497d 100644 --- a/openfpga/src/base/openfpga_build_fabric_template.h +++ b/openfpga/src/base/openfpga_build_fabric_template.h @@ -285,7 +285,7 @@ int write_fabric_hierarchy_template(const T& openfpga_ctx, const Command& cmd, /* Write hierarchy to a file */ return write_fabric_hierarchy_to_text_file( - openfpga_ctx.module_graph(), hie_file_name, size_t(depth), + openfpga_ctx.module_graph(), openfpga_ctx.module_name_map(), hie_file_name, size_t(depth), cmd_context.option_enable(cmd, opt_verbose)); } diff --git a/openfpga/src/fabric/fabric_hierarchy_writer.cpp b/openfpga/src/fabric/fabric_hierarchy_writer.cpp index 546f0ebc1..86f4065e7 100644 --- a/openfpga/src/fabric/fabric_hierarchy_writer.cpp +++ b/openfpga/src/fabric/fabric_hierarchy_writer.cpp @@ -84,6 +84,7 @@ static int rec_output_module_hierarchy_to_text_file( * Return 2 if fail when creating files ***************************************************************************************/ int write_fabric_hierarchy_to_text_file(const ModuleManager& module_manager, + const ModuleNameMap& module_name_map, const std::string& fname, const size_t& hie_depth_to_stop, const bool& verbose) { @@ -111,7 +112,7 @@ int write_fabric_hierarchy_to_text_file(const ModuleManager& module_manager, check_file_stream(fname.c_str(), fp); /* Find top-level module */ - std::string top_module_name = generate_fpga_top_module_name(); + std::string top_module_name = module_name_map.name(generate_fpga_top_module_name()); ModuleId top_module = module_manager.find_module(top_module_name); if (true != module_manager.valid_module_id(top_module)) { VTR_LOGV_ERROR(verbose, "Unable to find the top-level module '%s'!\n", diff --git a/openfpga/src/fabric/fabric_hierarchy_writer.h b/openfpga/src/fabric/fabric_hierarchy_writer.h index ccba3f99d..71fbea25b 100644 --- a/openfpga/src/fabric/fabric_hierarchy_writer.h +++ b/openfpga/src/fabric/fabric_hierarchy_writer.h @@ -15,6 +15,7 @@ namespace openfpga { int write_fabric_hierarchy_to_text_file(const ModuleManager& module_manager, + const ModuleNameMap& module_name_map, const std::string& fname, const size_t& hie_depth_to_stop, const bool& verbose);