From c85c64eb5a01b2d26afc5ef544500425d17f1cb6 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 15 Sep 2023 23:30:34 -0700 Subject: [PATCH] [core] syntax --- openfpga/src/base/openfpga_build_fabric_template.h | 2 +- openfpga/src/base/openfpga_setup_command_template.h | 2 +- openfpga/src/fabric/build_device_module.cpp | 2 +- openfpga/src/fabric/build_device_module.h | 3 +++ openfpga/src/fabric/rename_modules.cpp | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/openfpga/src/base/openfpga_build_fabric_template.h b/openfpga/src/base/openfpga_build_fabric_template.h index 9c897d2f3..0fdb26674 100644 --- a/openfpga/src/base/openfpga_build_fabric_template.h +++ b/openfpga/src/base/openfpga_build_fabric_template.h @@ -346,7 +346,7 @@ int add_fpga_core_to_fabric_template(T& openfpga_ctx, const Command& cmd, * Rename modules in module graph with a set of given rules *******************************************************************/ template -int rename_modules_template(const T& openfpga_ctx, const Command& cmd, +int rename_modules_template(T& openfpga_ctx, const Command& cmd, const CommandContext& cmd_context) { CommandOptionId opt_verbose = cmd.option("verbose"); diff --git a/openfpga/src/base/openfpga_setup_command_template.h b/openfpga/src/base/openfpga_setup_command_template.h index b2e18a839..0a6938fb8 100644 --- a/openfpga/src/base/openfpga_setup_command_template.h +++ b/openfpga/src/base/openfpga_setup_command_template.h @@ -812,7 +812,7 @@ ShellCommandId add_rename_modules_command_template( ShellCommandId shell_cmd_id = shell.add_command( shell_cmd, "Rename modules with a set of given rules", hidden); shell.set_command_class(shell_cmd_id, cmd_class_id); - shell.set_command_const_execute_function(shell_cmd_id, + shell.set_command_execute_function(shell_cmd_id, rename_modules_template); /* Add command dependency to the Shell */ diff --git a/openfpga/src/fabric/build_device_module.cpp b/openfpga/src/fabric/build_device_module.cpp index 060a67a47..e759dba03 100644 --- a/openfpga/src/fabric/build_device_module.cpp +++ b/openfpga/src/fabric/build_device_module.cpp @@ -162,7 +162,7 @@ int build_device_module_graph( } if (name_module_using_index) { /* Update module name data */ - status = update_module_map_name_with_indexing_names(module_name_map, device_rr_gsb, fabric_tile, verbose); + status = update_module_map_name_with_indexing_names(module_name_map, openfpga_ctx.device_rr_gsb(), fabric_tile, verbose); if (CMD_EXEC_FATAL_ERROR == status) { return status; } diff --git a/openfpga/src/fabric/build_device_module.h b/openfpga/src/fabric/build_device_module.h index fb4178cc8..98db557bd 100644 --- a/openfpga/src/fabric/build_device_module.h +++ b/openfpga/src/fabric/build_device_module.h @@ -7,6 +7,7 @@ #include "fabric_key.h" #include "fabric_tile.h" #include "io_name_map.h" +#include "module_name_map.h" #include "openfpga_context.h" #include "tile_config.h" #include "vpr_context.h" @@ -21,10 +22,12 @@ namespace openfpga { int build_device_module_graph( ModuleManager& module_manager, DecoderLibrary& decoder_lib, MemoryBankShiftRegisterBanks& blwl_sr_banks, FabricTile& fabric_tile, + ModuleNameMap& module_name_map, const OpenfpgaContext& openfpga_ctx, const DeviceContext& vpr_device_ctx, const bool& frame_view, const bool& compress_routing, const bool& duplicate_grid_pin, const FabricKey& fabric_key, const TileConfig& tile_config, const bool& group_config_block, + const bool& name_module_using_index, const bool& generate_random_fabric_key, const bool& verbose); } /* end namespace openfpga */ diff --git a/openfpga/src/fabric/rename_modules.cpp b/openfpga/src/fabric/rename_modules.cpp index 5f216ed52..53f9bbdcb 100644 --- a/openfpga/src/fabric/rename_modules.cpp +++ b/openfpga/src/fabric/rename_modules.cpp @@ -64,7 +64,7 @@ int update_module_map_name_with_indexing_names(ModuleNameMap& module_name_map, c FabricTileId fabric_tile_id = fabric_tile.unique_tiles()[itile]; vtr::Point tile_coord = fabric_tile.tile_coordinate(fabric_tile_id); std::string name_using_coord = generate_tile_module_name(tile_coord); - std::string name_using_index = generate_tile_module_name_using_index(tile_coord, itile); + std::string name_using_index = generate_tile_module_name_using_index(itile); status = module_name_map.set_tag_to_name_pair(name_using_coord, name_using_index); if (status != CMD_EXEC_SUCCESS) { return CMD_EXEC_SUCCESS; @@ -79,7 +79,7 @@ int rename_fabric_modules(ModuleManager& module_manager, const ModuleNameMap& mo size_t cnt = 0; for (ModuleId curr_module : module_manager.modules()) { std::string new_name = module_name_map.name(module_manager.module_name(curr_module)); - if (new_name != module_manager.module_name()) { + if (new_name != module_manager.module_name(curr_module)) { VTR_LOGV(verbose, "Rename module '%s' to its new name '%s'\n", module_manager.module_name(curr_module).c_str(), new_name.c_str()); module_manager.set_module_name(curr_module, new_name); }