diff --git a/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_unique_routing.c b/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_unique_routing.c index c5a40dc94..427368340 100644 --- a/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_unique_routing.c +++ b/vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_unique_routing.c @@ -1067,7 +1067,6 @@ RRSwitchBlock rotate_rr_switch_block_for_mirror(DeviceCoordinator& device_range, return rotated_rr_switch_block; } - /* 3. TOP-RIGHT corner: * swap the opin_node between TOP and BOTTOM, * swap the chan_node between TOP and BOTTOM, @@ -1225,6 +1224,16 @@ DeviceRRSwitchBlock build_device_rr_switch_blocks(boolean output_sb_xml, char* s "Backannotated %d switch blocks.\n", (nx + 1) * (ny + 1) ); + if (TRUE == output_sb_xml) { + write_device_rr_switch_block_to_xml(sb_xml_dir, LL_device_rr_switch_block); + + /* Skip rotating mirror searching */ + vpr_printf(TIO_MESSAGE_INFO, + "Output XML description of Switch Blocks to %s.\n", + sb_xml_dir); + + } + LL_device_rr_switch_block.build_unique_mirror(); /* Report number of unique mirrors */ @@ -1261,17 +1270,6 @@ DeviceRRSwitchBlock build_device_rr_switch_blocks(boolean output_sb_xml, char* s "Detect %d rotatable unique switch blocks from %d switch blocks.\n", LL_device_rr_switch_block.get_num_rotatable_mirror(), (nx + 1) * (ny + 1) ); - if (TRUE == output_sb_xml) { - write_device_rr_switch_block_to_xml(sb_xml_dir, LL_device_rr_switch_block); - - /* Skip rotating mirror searching */ - vpr_printf(TIO_MESSAGE_INFO, - "Output XML description of Switch Blocks to %s.\n", - sb_xml_dir); - - } - - return LL_device_rr_switch_block; } diff --git a/vpr7_x2p/vpr/SRC/fpga_x2p/base/write_rr_blocks.cpp b/vpr7_x2p/vpr/SRC/fpga_x2p/base/write_rr_blocks.cpp index c845c14bb..28b181085 100644 --- a/vpr7_x2p/vpr/SRC/fpga_x2p/base/write_rr_blocks.cpp +++ b/vpr7_x2p/vpr/SRC/fpga_x2p/base/write_rr_blocks.cpp @@ -13,7 +13,7 @@ void write_rr_switch_block_to_xml(std::string fname_prefix, RRSwitchBlock& rr_sb) { /* Prepare file name */ std::string fname(fname_prefix); - fname += rr_sb.gen_verilog_instance_name(); + fname += rr_sb.gen_verilog_module_name(); fname += ".xml"; vpr_printf(TIO_MESSAGE_INFO, "Output SB XML: %s\n", fname.c_str()); @@ -44,7 +44,8 @@ void write_rr_switch_block_to_xml(std::string fname_prefix, RRSwitchBlock& rr_sb /* Output node information: location, index, side */ fp << "\t<" << convert_chan_type_to_string(cur_rr_node->type) << " side=\"" << side_manager.to_string() - << "\" index=\"" << inode << "\">" + << "\" index=\"" << inode + << "\">" << std::endl; /* Check if this node is directly connected to the node on the opposite side */ @@ -60,9 +61,10 @@ void write_rr_switch_block_to_xml(std::string fname_prefix, RRSwitchBlock& rr_sb /* Direct connection: output the node on the opposite side */ if (0 == num_drive_rr_nodes) { Side oppo_side = side_manager.get_opposite(); - fp << "\t\ttype) + fp << "\t\ttype) << "\" side=\"" << oppo_side.to_string() - << "\" index=\"" << rr_sb.get_node_index(cur_rr_node, oppo_side.get_side(), IN_PORT) << "\"/>" + << "\" index=\"" << rr_sb.get_node_index(cur_rr_node, oppo_side.get_side(), IN_PORT) + << "\"/>" << std::endl; } else { for (size_t jnode = 0; jnode < num_drive_rr_nodes; ++jnode) { @@ -73,20 +75,33 @@ void write_rr_switch_block_to_xml(std::string fname_prefix, RRSwitchBlock& rr_sb std::string node_type_str; if (OPIN == drive_rr_nodes[jnode]->type) { node_type_str = "opin"; + Side grid_side(rr_sb.get_opin_node_grid_side(drive_node_side, drive_node_index)); + fp << "\t\t" + << std::endl; } else { node_type_str = convert_chan_type_to_string(drive_rr_nodes[jnode]->type); + size_t segment_id = rr_sb.get_chan_node_segment(drive_node_side, drive_node_index); + fp << "\t\t" + << std::endl; } - fp << "\t\t" - << std::endl; } } - fp << "\ttype) << ">" << std::endl; + fp << "\ttype) + << ">" + << std::endl; } } - fp << "" << std::endl; + fp << "" + << std::endl; /* close a file */ fp.close();