full flow with bugs

This commit is contained in:
Lin 2024-08-19 01:18:06 -07:00
parent a785a57520
commit 699131ad58
5 changed files with 29 additions and 11 deletions

View File

@ -421,6 +421,19 @@ void DeviceRRGSB::clear() {
clear_sb_unique_module_id(); clear_sb_unique_module_id();
} }
void DeviceRRGSB::clear_unique_modules(){
/* clean unique module lists */
clear_cb_unique_module(CHANX);
clear_cb_unique_module_id(CHANX);
clear_cb_unique_module(CHANY);
clear_cb_unique_module_id(CHANY);
clear_sb_unique_module();
clear_sb_unique_module_id();
}
void DeviceRRGSB::clear_gsb() { void DeviceRRGSB::clear_gsb() {
/* clean gsb array */ /* clean gsb array */
for (size_t x = 0; x < rr_gsb_.size(); ++x) { for (size_t x = 0; x < rr_gsb_.size(); ++x) {
@ -572,18 +585,15 @@ void DeviceRRGSB::preload_unique_cb_module(
switch (cb_type) { switch (cb_type) {
case CHANX: case CHANX:
limit_x = cbx_unique_module_id_.size(); limit_x = cbx_unique_module_id_.size();
limit_y = cbx_unique_module_id_[0].size();
break; break;
case CHANY: case CHANY:
limit_x = cby_unique_module_id_.size(); limit_x = cby_unique_module_id_.size();
limit_y = cby_unique_module_id_[0].size();
break; break;
default: default:
VTR_LOG_ERROR("Invalid type"); VTR_LOG_ERROR("Invalid type");
} }
VTR_ASSERT(block_coordinate.x() < limit_x); VTR_ASSERT(block_coordinate.x() < limit_x);
VTR_ASSERT(block_coordinate.y() < limit_y);
add_cb_unique_module(cb_type, block_coordinate); add_cb_unique_module(cb_type, block_coordinate);
/* Record the id of unique mirror */ /* Record the id of unique mirror */
set_cb_unique_module_id(cb_type, block_coordinate, set_cb_unique_module_id(cb_type, block_coordinate,
@ -593,7 +603,6 @@ void DeviceRRGSB::preload_unique_cb_module(
for (auto instance_location : instance_coords) { for (auto instance_location : instance_coords) {
/* Record the id of unique mirror */ /* Record the id of unique mirror */
VTR_ASSERT(instance_location.x() < limit_x); VTR_ASSERT(instance_location.x() < limit_x);
VTR_ASSERT(instance_location.y() < limit_y);
set_cb_unique_module_id( set_cb_unique_module_id(
cb_type, instance_location, cb_type, instance_location,
cbx_unique_module_id_[block_coordinate.x()][block_coordinate.y()]); cbx_unique_module_id_[block_coordinate.x()][block_coordinate.y()]);
@ -605,7 +614,6 @@ void DeviceRRGSB::preload_unique_sb_module(
const std::vector<vtr::Point<size_t>> instance_coords) { const std::vector<vtr::Point<size_t>> instance_coords) {
/*input block coordinate should be within gsb coord range*/ /*input block coordinate should be within gsb coord range*/
VTR_ASSERT(block_coordinate.x() < sb_unique_module_id_.size()); VTR_ASSERT(block_coordinate.x() < sb_unique_module_id_.size());
VTR_ASSERT(block_coordinate.y() < sb_unique_module_id_[0].size());
sb_unique_module_.push_back(block_coordinate); sb_unique_module_.push_back(block_coordinate);
/* Record the id of unique module */ /* Record the id of unique module */
sb_unique_module_id_[block_coordinate.x()][block_coordinate.y()] = sb_unique_module_id_[block_coordinate.x()][block_coordinate.y()] =
@ -615,7 +623,6 @@ void DeviceRRGSB::preload_unique_sb_module(
* the unique module */ * the unique module */
for (auto instance_location : instance_coords) { for (auto instance_location : instance_coords) {
VTR_ASSERT(instance_location.x() < sb_unique_module_id_.size()); VTR_ASSERT(instance_location.x() < sb_unique_module_id_.size());
VTR_ASSERT(instance_location.y() < sb_unique_module_id_[0].size());
sb_unique_module_id_[instance_location.x()][instance_location.y()] = sb_unique_module_id_[instance_location.x()][instance_location.y()] =
sb_unique_module_id_[block_coordinate.x()][block_coordinate.y()]; sb_unique_module_id_[block_coordinate.x()][block_coordinate.y()];
} }

View File

@ -102,7 +102,7 @@ class DeviceRRGSB {
void preload_unique_sb_module( void preload_unique_sb_module(
const vtr::Point<size_t> block_coordinate, const vtr::Point<size_t> block_coordinate,
const std::vector<vtr::Point<size_t>> instance_coords); const std::vector<vtr::Point<size_t>> instance_coords);
void clear_unique_modules();
void get_id_sb_instance_map( void get_id_sb_instance_map(
std::map<int, std::vector<vtr::Point<size_t>>>& id_instance_map) const; std::map<int, std::vector<vtr::Point<size_t>>>& id_instance_map) const;
void get_id_unique_sb_block_map( void get_id_unique_sb_block_map(

View File

@ -101,6 +101,7 @@ int build_fabric_template(T& openfpga_ctx, const Command& cmd,
const CommandContext& cmd_context) { const CommandContext& cmd_context) {
CommandOptionId opt_frame_view = cmd.option("frame_view"); CommandOptionId opt_frame_view = cmd.option("frame_view");
CommandOptionId opt_compress_routing = cmd.option("compress_routing"); CommandOptionId opt_compress_routing = cmd.option("compress_routing");
CommandOptionId opt_preload = cmd.option("preload");
CommandOptionId opt_duplicate_grid_pin = cmd.option("duplicate_grid_pin"); CommandOptionId opt_duplicate_grid_pin = cmd.option("duplicate_grid_pin");
CommandOptionId opt_gen_random_fabric_key = CommandOptionId opt_gen_random_fabric_key =
cmd.option("generate_random_fabric_key"); cmd.option("generate_random_fabric_key");
@ -143,13 +144,18 @@ 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 == cmd_context.option_enable(cmd, opt_preload)) {
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);
} }
if (cmd_context.option_enable(cmd, opt_preload)){
openfpga_ctx.mutable_flow_manager().set_compress_routing(true);
}
VTR_LOG("\n"); VTR_LOG("\n");
/* Record the execution status in curr_status for each command /* Record the execution status in curr_status for each command

View File

@ -391,6 +391,10 @@ ShellCommandId add_build_fabric_command_template(
"Compress the number of unique routing modules by " "Compress the number of unique routing modules by "
"identifying the unique GSBs"); "identifying the unique GSBs");
/* Add an option '--preload' */
shell_cmd.add_option("preload", false,
"preload unique routing modules from user input xml file");
/* Add an option '--duplicate_grid_pin' */ /* Add an option '--duplicate_grid_pin' */
shell_cmd.add_option("duplicate_grid_pin", false, shell_cmd.add_option("duplicate_grid_pin", false,
"Duplicate the pins on the same side of a grid"); "Duplicate the pins on the same side of a grid");

View File

@ -111,7 +111,8 @@ int read_xml_unique_blocks(T& openfpga_ctx, const char* file_name,
/* get device_rr_gsb data type and initialize it*/ /* get device_rr_gsb data type and initialize it*/
openfpga::DeviceRRGSB& device_rr_gsb = openfpga_ctx.mutable_device_rr_gsb(); openfpga::DeviceRRGSB& device_rr_gsb = openfpga_ctx.mutable_device_rr_gsb();
device_rr_gsb.clear(); /* clear unique modules */
device_rr_gsb.clear_unique_modules();
/* load unique blocks xml file and set up device_rr_gdb */ /* load unique blocks xml file and set up device_rr_gdb */
for (pugi::xml_node xml_block_info : xml_root.children()) { for (pugi::xml_node xml_block_info : xml_root.children()) {