fix is_compressed_ tag

This commit is contained in:
Lin 2024-09-09 11:19:12 +08:00
parent 73d5e6429f
commit af7201d4bb
3 changed files with 14 additions and 19 deletions

View File

@ -66,9 +66,8 @@ size_t DeviceRRGSB::get_num_cb_unique_module(const t_rr_type& cb_type) const {
} }
} }
void DeviceRRGSB::init_is_dirty_flag() { is_dirty_ = false; }
void DeviceRRGSB::set_is_dirty_flag(const bool flag) { is_dirty_ = flag; } bool DeviceRRGSB::is_compressed() const { return is_compressed_; }
bool DeviceRRGSB::get_is_dirty_flag() const { return is_dirty_; }
/* Identify if a GSB actually exists at a location */ /* Identify if a GSB actually exists at a location */
bool DeviceRRGSB::is_gsb_exist(const RRGraphView& rr_graph, bool DeviceRRGSB::is_gsb_exist(const RRGraphView& rr_graph,
const vtr::Point<size_t> coord) const { const vtr::Point<size_t> coord) const {
@ -363,7 +362,7 @@ void DeviceRRGSB::build_unique_module(const RRGraphView& rr_graph) {
build_cb_unique_module(rr_graph, CHANY); build_cb_unique_module(rr_graph, CHANY);
build_gsb_unique_module(); build_gsb_unique_module();
set_is_dirty_flag(true); is_compressed_ = true;
} }
void DeviceRRGSB::add_gsb_unique_module(const vtr::Point<size_t>& coordinate) { void DeviceRRGSB::add_gsb_unique_module(const vtr::Point<size_t>& coordinate) {
@ -424,7 +423,7 @@ void DeviceRRGSB::clear() {
clear_sb_unique_module(); clear_sb_unique_module();
clear_sb_unique_module_id(); clear_sb_unique_module_id();
init_is_dirty_flag(); is_compressed_ = false;
} }
void DeviceRRGSB::clear_unique_modules() { void DeviceRRGSB::clear_unique_modules() {
@ -437,7 +436,7 @@ void DeviceRRGSB::clear_unique_modules() {
clear_sb_unique_module(); clear_sb_unique_module();
clear_sb_unique_module_id(); clear_sb_unique_module_id();
init_is_dirty_flag(); is_compressed_ = false;
} }
void DeviceRRGSB::clear_gsb() { void DeviceRRGSB::clear_gsb() {

View File

@ -69,8 +69,7 @@ class DeviceRRGSB {
const vtr::Point<size_t>& coordinate) const; const vtr::Point<size_t>& coordinate) const;
public: /* Mutators */ public: /* Mutators */
void set_is_dirty_flag(const bool flag); bool is_compressed() const;
bool get_is_dirty_flag() const;
void build_gsb_unique_module(); /* Add a switch block to the array, which will void build_gsb_unique_module(); /* Add a switch block to the array, which will
automatically identify and update the lists automatically identify and update the lists
of unique mirrors and rotatable mirrors */ of unique mirrors and rotatable mirrors */
@ -126,7 +125,6 @@ class DeviceRRGSB {
private: /* Internal cleaners */ private: /* Internal cleaners */
void clear_gsb(); /* clean the content */ void clear_gsb(); /* clean the content */
void clear_cb_unique_module(const t_rr_type& cb_type); /* clean the content */ void clear_cb_unique_module(const t_rr_type& cb_type); /* clean the content */
void init_is_dirty_flag();
void clear_cb_unique_module_id( void clear_cb_unique_module_id(
const t_rr_type& cb_type); /* clean the content */ const t_rr_type& cb_type); /* clean the content */
void clear_sb_unique_module(); /* clean the content */ void clear_sb_unique_module(); /* clean the content */
@ -165,7 +163,7 @@ class DeviceRRGSB {
private: /* Internal Data */ private: /* Internal Data */
std::vector<std::vector<RRGSB>> rr_gsb_; std::vector<std::vector<RRGSB>> rr_gsb_;
bool is_dirty_ = false; // is_valid bool is_compressed_ = false; // is_valid
std::vector<std::vector<size_t>> std::vector<std::vector<size_t>>
gsb_unique_module_id_; /* A map from rr_gsb to its unique mirror */ gsb_unique_module_id_; /* A map from rr_gsb to its unique mirror */

View File

@ -125,11 +125,10 @@ int build_fabric_template(T& openfpga_ctx, const Command& cmd,
cmd.option_name(opt_duplicate_grid_pin).c_str()); cmd.option_name(opt_duplicate_grid_pin).c_str());
return CMD_EXEC_FATAL_ERROR; return CMD_EXEC_FATAL_ERROR;
} }
if (!cmd_context.option_enable(cmd, opt_compress_routing)) { if (!openfpga_ctx.device_rr_gsb().is_compressed()) {
VTR_LOG_ERROR( VTR_LOG_ERROR(
"Option '%s' requires options '%s' to be enabled due to a conflict!\n", "Option '%s' requires unique blocks to be valid due to a conflict!\n",
cmd.option_name(opt_group_tile).c_str(), cmd.option_name(opt_group_tile).c_str());
cmd.option_name(opt_compress_routing).c_str());
return CMD_EXEC_FATAL_ERROR; return CMD_EXEC_FATAL_ERROR;
} }
} }
@ -145,13 +144,12 @@ int build_fabric_template(T& openfpga_ctx, const Command& cmd,
} }
if (true == cmd_context.option_enable(cmd, opt_compress_routing) && if (true == cmd_context.option_enable(cmd, opt_compress_routing) &&
false == openfpga_ctx.device_rr_gsb().get_is_dirty_flag()) { false == openfpga_ctx.device_rr_gsb().is_compressed()) {
compress_routing_hierarchy_template<T>( compress_routing_hierarchy_template<T>(
openfpga_ctx, cmd_context.option_enable(cmd, opt_verbose)); openfpga_ctx, cmd_context.option_enable(cmd, opt_verbose));
/* Update flow manager to enable compress routing */ /* Update flow manager to enable compress routing */
openfpga_ctx.mutable_flow_manager().set_compress_routing(true); openfpga_ctx.mutable_flow_manager().set_compress_routing(true);
} else if (true == cmd_context.option_enable(cmd, opt_compress_routing) && } else if (true == openfpga_ctx.device_rr_gsb().is_compressed()) {
true == openfpga_ctx.device_rr_gsb().get_is_dirty_flag()) {
openfpga_ctx.mutable_flow_manager().set_compress_routing(true); openfpga_ctx.mutable_flow_manager().set_compress_routing(true);
} }
@ -180,7 +178,7 @@ int build_fabric_template(T& openfpga_ctx, const Command& cmd,
*/ */
TileConfig tile_config; TileConfig tile_config;
if (cmd_context.option_enable(cmd, opt_group_tile)) { if (cmd_context.option_enable(cmd, opt_group_tile)) {
if (!cmd_context.option_enable(cmd, opt_compress_routing)) { if (!openfpga_ctx.device_rr_gsb().is_compressed()) {
VTR_LOG_ERROR( VTR_LOG_ERROR(
"Group tile is applicable only when compress routing is enabled!\n"); "Group tile is applicable only when compress routing is enabled!\n");
return CMD_EXEC_FATAL_ERROR; return CMD_EXEC_FATAL_ERROR;
@ -198,7 +196,7 @@ int build_fabric_template(T& openfpga_ctx, const Command& cmd,
openfpga_ctx.mutable_fabric_tile(), openfpga_ctx.mutable_module_name_map(), openfpga_ctx.mutable_fabric_tile(), openfpga_ctx.mutable_module_name_map(),
const_cast<const T&>(openfpga_ctx), g_vpr_ctx.device(), const_cast<const T&>(openfpga_ctx), g_vpr_ctx.device(),
cmd_context.option_enable(cmd, opt_frame_view), cmd_context.option_enable(cmd, opt_frame_view),
cmd_context.option_enable(cmd, opt_compress_routing), openfpga_ctx.device_rr_gsb().is_compressed(),
cmd_context.option_enable(cmd, opt_duplicate_grid_pin), cmd_context.option_enable(cmd, opt_duplicate_grid_pin),
predefined_fabric_key, tile_config, predefined_fabric_key, tile_config,
cmd_context.option_enable(cmd, opt_group_config_block), cmd_context.option_enable(cmd, opt_group_config_block),