[core] code format

This commit is contained in:
tangxifan 2024-06-26 17:58:26 -07:00
parent 59404e5487
commit 59be95b227
4 changed files with 115 additions and 82 deletions

View File

@ -363,7 +363,8 @@ std::string ClockNetwork::tap_to_port(const ClockTapId& tap_id) const {
return tap_to_ports_[tap_id]; return tap_to_ports_[tap_id];
} }
ClockNetwork::e_tap_type ClockNetwork::tap_type(const ClockTapId& tap_id) const { ClockNetwork::e_tap_type ClockNetwork::tap_type(
const ClockTapId& tap_id) const {
VTR_ASSERT(valid_tap_id(tap_id)); VTR_ASSERT(valid_tap_id(tap_id));
/* If not a region, it is a default type covering all the coordinates*/ /* If not a region, it is a default type covering all the coordinates*/
if (tap_bbs_[tap_id] == empty_tap_bb_) { if (tap_bbs_[tap_id] == empty_tap_bb_) {
@ -386,7 +387,8 @@ size_t ClockNetwork::tap_y(const ClockTapId& tap_id) const {
return tap_bbs_[tap_id].ymin(); return tap_bbs_[tap_id].ymin();
} }
vtr::Rect<size_t> ClockNetwork::tap_bounding_box(const ClockTapId& tap_id) const { vtr::Rect<size_t> ClockNetwork::tap_bounding_box(
const ClockTapId& tap_id) const {
VTR_ASSERT(tap_type(tap_id) == ClockNetwork::e_tap_type::REGION); VTR_ASSERT(tap_type(tap_id) == ClockNetwork::e_tap_type::REGION);
return tap_bbs_[tap_id]; return tap_bbs_[tap_id];
} }
@ -401,18 +403,22 @@ size_t ClockNetwork::tap_step_y(const ClockTapId& tap_id) const {
return tap_bb_steps_[tap_id].y(); return tap_bb_steps_[tap_id].y();
} }
bool ClockNetwork::valid_tap_coord_in_bb(const ClockTapId& tap_id, const vtr::Point<size_t>& tap_coord) const { bool ClockNetwork::valid_tap_coord_in_bb(
const ClockTapId& tap_id, const vtr::Point<size_t>& tap_coord) const {
VTR_ASSERT(valid_tap_id(tap_id)); VTR_ASSERT(valid_tap_id(tap_id));
if (tap_type(tap_id) == ClockNetwork::e_tap_type::ALL) { if (tap_type(tap_id) == ClockNetwork::e_tap_type::ALL) {
return true; return true;
} }
if (tap_type(tap_id) == ClockNetwork::e_tap_type::SINGLE && tap_bbs_[tap_id].strictly_contains(tap_coord)) { if (tap_type(tap_id) == ClockNetwork::e_tap_type::SINGLE &&
tap_bbs_[tap_id].strictly_contains(tap_coord)) {
return true; return true;
} }
if (tap_type(tap_id) == ClockNetwork::e_tap_type::REGION && tap_bbs_[tap_id].strictly_contains(tap_coord)) { if (tap_type(tap_id) == ClockNetwork::e_tap_type::REGION &&
tap_bbs_[tap_id].strictly_contains(tap_coord)) {
/* Check if steps are considered, coords still matches */ /* Check if steps are considered, coords still matches */
bool x_in_bb = false; bool x_in_bb = false;
for (size_t ix = tap_bbs_[tap_id].xmin(); ix < tap_bbs_[tap_id].xmax(); ix = ix + tap_bb_steps_[tap_id].x()) { for (size_t ix = tap_bbs_[tap_id].xmin(); ix < tap_bbs_[tap_id].xmax();
ix = ix + tap_bb_steps_[tap_id].x()) {
if (tap_coord.x() == ix) { if (tap_coord.x() == ix) {
x_in_bb = true; x_in_bb = true;
break; break;
@ -423,7 +429,8 @@ bool ClockNetwork::valid_tap_coord_in_bb(const ClockTapId& tap_id, const vtr::Po
return false; return false;
} }
bool y_in_bb = false; bool y_in_bb = false;
for (size_t iy = tap_bbs_[tap_id].ymin(); iy < tap_bbs_[tap_id].ymax(); iy = iy + tap_bb_steps_[tap_id].y()) { for (size_t iy = tap_bbs_[tap_id].ymin(); iy < tap_bbs_[tap_id].ymax();
iy = iy + tap_bb_steps_[tap_id].y()) {
if (tap_coord.y() == iy) { if (tap_coord.y() == iy) {
y_in_bb = true; y_in_bb = true;
break; break;
@ -437,7 +444,8 @@ bool ClockNetwork::valid_tap_coord_in_bb(const ClockTapId& tap_id, const vtr::Po
} }
std::vector<std::string> ClockNetwork::tree_flatten_tap_to_ports( std::vector<std::string> ClockNetwork::tree_flatten_tap_to_ports(
const ClockTreeId& tree_id, const ClockTreePinId& clk_pin_id, const vtr::Point<size_t>& tap_coord) const { const ClockTreeId& tree_id, const ClockTreePinId& clk_pin_id,
const vtr::Point<size_t>& tap_coord) const {
VTR_ASSERT(valid_tree_id(tree_id)); VTR_ASSERT(valid_tree_id(tree_id));
std::vector<std::string> flatten_taps; std::vector<std::string> flatten_taps;
for (ClockTapId tap_id : tree_taps_[tree_id]) { for (ClockTapId tap_id : tree_taps_[tree_id]) {
@ -761,7 +769,8 @@ ClockTapId ClockNetwork::add_tree_tap(const ClockTreeId& tree_id,
const std::string& from_port, const std::string& from_port,
const std::string& to_port) { const std::string& to_port) {
VTR_ASSERT(valid_tree_id(tree_id)); VTR_ASSERT(valid_tree_id(tree_id));
/* TODO: Consider find existing tap template and avoid duplication in storage */ /* TODO: Consider find existing tap template and avoid duplication in storage
*/
ClockTapId tap_id = ClockTapId(tap_ids_.size()); ClockTapId tap_id = ClockTapId(tap_ids_.size());
tap_ids_.push_back(tap_id); tap_ids_.push_back(tap_id);
tap_from_ports_.push_back(from_port); tap_from_ports_.push_back(from_port);
@ -772,33 +781,45 @@ ClockTapId ClockNetwork::add_tree_tap(const ClockTreeId& tree_id,
return tap_id; return tap_id;
} }
bool ClockNetwork::set_tap_bounding_box(const ClockTapId& tap_id, const vtr::Rect<size_t>& bb) { bool ClockNetwork::set_tap_bounding_box(const ClockTapId& tap_id,
const vtr::Rect<size_t>& bb) {
VTR_ASSERT(valid_tap_id(tap_id)); VTR_ASSERT(valid_tap_id(tap_id));
/* Check the bounding box, ensure it must be valid */ /* Check the bounding box, ensure it must be valid */
if (bb.xmax() < bb.xmin() || bb.ymax() < bb.ymin()) { if (bb.xmax() < bb.xmin() || bb.ymax() < bb.ymin()) {
VTR_LOG_ERROR("Invalid bounding box (xlow=%lu, ylow=%lu) -> (xhigh=%lu, yhigh=%lu)! Must follow: xlow <= xhigh, ylow <= yhigh!\n", bb.xmin(), bb.ymin(), bb.xmax(), bb.ymax()); VTR_LOG_ERROR(
"Invalid bounding box (xlow=%lu, ylow=%lu) -> (xhigh=%lu, yhigh=%lu)! "
"Must follow: xlow <= xhigh, ylow <= yhigh!\n",
bb.xmin(), bb.ymin(), bb.xmax(), bb.ymax());
return false; return false;
} }
tap_bbs_[tap_id] = bb; tap_bbs_[tap_id] = bb;
return true; return true;
} }
bool ClockNetwork::set_tap_step_x(const ClockTapId& tap_id, const size_t& step) { bool ClockNetwork::set_tap_step_x(const ClockTapId& tap_id,
const size_t& step) {
VTR_ASSERT(valid_tap_id(tap_id)); VTR_ASSERT(valid_tap_id(tap_id));
/* Must be a valid step >= 1 */ /* Must be a valid step >= 1 */
if (step == 0) { if (step == 0) {
VTR_LOG_ERROR("Invalid x-direction step (=%lu) for any bounding box! Expect an integer >= 1!\n", step); VTR_LOG_ERROR(
"Invalid x-direction step (=%lu) for any bounding box! Expect an integer "
">= 1!\n",
step);
return false; return false;
} }
tap_bb_steps_[tap_id].set_x(step); tap_bb_steps_[tap_id].set_x(step);
return true; return true;
} }
bool ClockNetwork::set_tap_step_y(const ClockTapId& tap_id, const size_t& step) { bool ClockNetwork::set_tap_step_y(const ClockTapId& tap_id,
const size_t& step) {
VTR_ASSERT(valid_tap_id(tap_id)); VTR_ASSERT(valid_tap_id(tap_id));
/* Must be a valid step >= 1 */ /* Must be a valid step >= 1 */
if (step == 0) { if (step == 0) {
VTR_LOG_ERROR("Invalid y-direction step (=%lu) for any bounding box! Expect an integer >= 1!\n", step); VTR_LOG_ERROR(
"Invalid y-direction step (=%lu) for any bounding box! Expect an integer "
">= 1!\n",
step);
return false; return false;
} }
tap_bb_steps_[tap_id].set_y(step); tap_bb_steps_[tap_id].set_y(step);
@ -957,10 +978,8 @@ bool ClockNetwork::valid_internal_driver_id(
(int_driver_id == internal_driver_ids_[int_driver_id]); (int_driver_id == internal_driver_ids_[int_driver_id]);
} }
bool ClockNetwork::valid_tap_id( bool ClockNetwork::valid_tap_id(const ClockTapId& tap_id) const {
const ClockTapId& tap_id) const { return (size_t(tap_id) < tap_ids_.size()) && (tap_id == tap_ids_[tap_id]);
return (size_t(tap_id) < tap_ids_.size()) &&
(tap_id == tap_ids_[tap_id]);
} }
bool ClockNetwork::valid_level_id(const ClockTreeId& tree_id, bool ClockNetwork::valid_level_id(const ClockTreeId& tree_id,

View File

@ -49,12 +49,7 @@ class ClockNetwork {
typedef vtr::Range<clock_internal_driver_iterator> typedef vtr::Range<clock_internal_driver_iterator>
clock_internal_driver_range; clock_internal_driver_range;
/* Type of tap points */ /* Type of tap points */
enum class e_tap_type : unsigned char { enum class e_tap_type : unsigned char { ALL = 0, SINGLE, REGION, NUM_TYPES };
ALL = 0,
SINGLE,
REGION,
NUM_TYPES
};
public: /* Constructors */ public: /* Constructors */
ClockNetwork(); ClockNetwork();
@ -148,7 +143,8 @@ class ClockNetwork {
/* Find the type of tap point: /* Find the type of tap point:
* all -> all coordinates in efpga are required to tap * all -> all coordinates in efpga are required to tap
* single -> only 1 coordinate is required to tap * single -> only 1 coordinate is required to tap
* region -> coordinates in a region required to tap. Steps in region may be required * region -> coordinates in a region required to tap. Steps in region may be
* required
*/ */
e_tap_type tap_type(const ClockTapId& tap_id) const; e_tap_type tap_type(const ClockTapId& tap_id) const;
/* Require the type of single */ /* Require the type of single */
@ -164,7 +160,8 @@ class ClockNetwork {
* resource graph Note that the clk_pin_id limits only 1 clock to be accessed * resource graph Note that the clk_pin_id limits only 1 clock to be accessed
*/ */
std::vector<std::string> tree_flatten_tap_to_ports( std::vector<std::string> tree_flatten_tap_to_ports(
const ClockTreeId& tree_id, const ClockTreePinId& clk_pin_id, const vtr::Point<size_t>& tap_coord) const; const ClockTreeId& tree_id, const ClockTreePinId& clk_pin_id,
const vtr::Point<size_t>& tap_coord) const;
/* Find a spine with a given name, if not found, return an valid id, otherwise /* Find a spine with a given name, if not found, return an valid id, otherwise
* return an invalid one */ * return an invalid one */
ClockSpineId find_spine(const std::string& name) const; ClockSpineId find_spine(const std::string& name) const;
@ -218,8 +215,11 @@ class ClockNetwork {
ClockInternalDriverId add_spine_switch_point_internal_driver( ClockInternalDriverId add_spine_switch_point_internal_driver(
const ClockSpineId& spine_id, const ClockSwitchPointId& switch_point_id, const ClockSpineId& spine_id, const ClockSwitchPointId& switch_point_id,
const std::string& internal_driver_port); const std::string& internal_driver_port);
ClockTapId add_tree_tap(const ClockTreeId& tree_id, const std::string& from_port, const std::string& to_port); ClockTapId add_tree_tap(const ClockTreeId& tree_id,
bool set_tap_bounding_box(const ClockTapId& tap_id, const vtr::Rect<size_t>& bb); const std::string& from_port,
const std::string& to_port);
bool set_tap_bounding_box(const ClockTapId& tap_id,
const vtr::Rect<size_t>& bb);
bool set_tap_step_x(const ClockTapId& tap_id, const size_t& step); bool set_tap_step_x(const ClockTapId& tap_id, const size_t& step);
bool set_tap_step_y(const ClockTapId& tap_id, const size_t& step); bool set_tap_step_y(const ClockTapId& tap_id, const size_t& step);
/* Build internal links between clock tree, spines etc. This is also an /* Build internal links between clock tree, spines etc. This is also an
@ -265,7 +265,8 @@ class ClockNetwork {
/* Show if the tap id is a valid for data queries */ /* Show if the tap id is a valid for data queries */
bool valid_tap_id(const ClockTapId& tap_id) const; bool valid_tap_id(const ClockTapId& tap_id) const;
/* Check if a given coordinate matches the requirements for a tap point */ /* Check if a given coordinate matches the requirements for a tap point */
bool valid_tap_coord_in_bb(const ClockTapId& tap_id, const vtr::Point<size_t>& tap_coord) const; bool valid_tap_coord_in_bb(const ClockTapId& tap_id,
const vtr::Point<size_t>& tap_coord) const;
private: /* Private mutators */ private: /* Private mutators */
/* Build internal links between spines under a given tree */ /* Build internal links between spines under a given tree */
@ -312,8 +313,10 @@ class ClockNetwork {
vtr::vector<ClockTapId, ClockTapId> tap_ids_; vtr::vector<ClockTapId, ClockTapId> tap_ids_;
vtr::vector<ClockTapId, std::string> tap_from_ports_; vtr::vector<ClockTapId, std::string> tap_from_ports_;
vtr::vector<ClockTapId, std::string> tap_to_ports_; vtr::vector<ClockTapId, std::string> tap_to_ports_;
vtr::vector<ClockTapId, vtr::Rect<size_t>> tap_bbs_; /* Bounding box for tap points, (xlow, ylow) -> (xhigh, yhigh) */ vtr::vector<ClockTapId, vtr::Rect<size_t>>
vtr::vector<ClockTapId, vtr::Point<size_t>> tap_bb_steps_; /* x() -> x-direction step, y() -> y-direction step */ tap_bbs_; /* Bounding box for tap points, (xlow, ylow) -> (xhigh, yhigh) */
vtr::vector<ClockTapId, vtr::Point<size_t>>
tap_bb_steps_; /* x() -> x-direction step, y() -> y-direction step */
/* Default routing resource */ /* Default routing resource */
std::string default_segment_name_; /* The routing segment representing the std::string default_segment_name_; /* The routing segment representing the

View File

@ -48,10 +48,9 @@ static void read_xml_clock_tree_tap_type_all(pugi::xml_node& xml_tap,
/******************************************************************** /********************************************************************
* Parse XML codes of a <single> to an object of ClockNetwork * Parse XML codes of a <single> to an object of ClockNetwork
*******************************************************************/ *******************************************************************/
static void read_xml_clock_tree_tap_type_single(pugi::xml_node& xml_tap, static void read_xml_clock_tree_tap_type_single(
const pugiutil::loc_data& loc_data, pugi::xml_node& xml_tap, const pugiutil::loc_data& loc_data,
ClockNetwork& clk_ntwk, ClockNetwork& clk_ntwk, const ClockTreeId& tree_id) {
const ClockTreeId& tree_id) {
if (!clk_ntwk.valid_tree_id(tree_id)) { if (!clk_ntwk.valid_tree_id(tree_id)) {
archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_tap), archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_tap),
"Invalid id of a clock tree!\n"); "Invalid id of a clock tree!\n");
@ -63,25 +62,26 @@ static void read_xml_clock_tree_tap_type_single(pugi::xml_node& xml_tap,
std::string to_pin_name = std::string to_pin_name =
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_TO_PIN, loc_data) get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_TO_PIN, loc_data)
.as_string(); .as_string();
ClockTapId tap_id = clk_ntwk.add_tree_tap(tree_id, from_pin_name, to_pin_name); ClockTapId tap_id =
clk_ntwk.add_tree_tap(tree_id, from_pin_name, to_pin_name);
/* Single tap only require a coordinate */ /* Single tap only require a coordinate */
size_t tap_x = size_t tap_x = get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_X,
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_X, loc_data, pugiutil::ReqOpt::REQUIRED) loc_data, pugiutil::ReqOpt::REQUIRED)
.as_int(); .as_int();
size_t tap_y = size_t tap_y = get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_Y,
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_Y, loc_data, pugiutil::ReqOpt::REQUIRED) loc_data, pugiutil::ReqOpt::REQUIRED)
.as_int(); .as_int();
clk_ntwk.set_tap_bounding_box(tap_id, vtr::Rect<size_t>(tap_x, tap_y, tap_x, tap_y)); clk_ntwk.set_tap_bounding_box(tap_id,
vtr::Rect<size_t>(tap_x, tap_y, tap_x, tap_y));
} }
/******************************************************************** /********************************************************************
* Parse XML codes of a <region> to an object of ClockNetwork * Parse XML codes of a <region> to an object of ClockNetwork
*******************************************************************/ *******************************************************************/
static void read_xml_clock_tree_tap_type_region(pugi::xml_node& xml_tap, static void read_xml_clock_tree_tap_type_region(
const pugiutil::loc_data& loc_data, pugi::xml_node& xml_tap, const pugiutil::loc_data& loc_data,
ClockNetwork& clk_ntwk, ClockNetwork& clk_ntwk, const ClockTreeId& tree_id) {
const ClockTreeId& tree_id) {
if (!clk_ntwk.valid_tree_id(tree_id)) { if (!clk_ntwk.valid_tree_id(tree_id)) {
archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_tap), archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_tap),
"Invalid id of a clock tree!\n"); "Invalid id of a clock tree!\n");
@ -93,22 +93,26 @@ static void read_xml_clock_tree_tap_type_region(pugi::xml_node& xml_tap,
std::string to_pin_name = std::string to_pin_name =
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_TO_PIN, loc_data) get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_TO_PIN, loc_data)
.as_string(); .as_string();
ClockTapId tap_id = clk_ntwk.add_tree_tap(tree_id, from_pin_name, to_pin_name); ClockTapId tap_id =
clk_ntwk.add_tree_tap(tree_id, from_pin_name, to_pin_name);
/* Region require a bounding box */ /* Region require a bounding box */
size_t tap_start_x = size_t tap_start_x =
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_STARTX, loc_data, pugiutil::ReqOpt::REQUIRED) get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_STARTX, loc_data,
pugiutil::ReqOpt::REQUIRED)
.as_int(); .as_int();
size_t tap_start_y = size_t tap_start_y =
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_STARTY, loc_data, pugiutil::ReqOpt::REQUIRED) get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_STARTY, loc_data,
pugiutil::ReqOpt::REQUIRED)
.as_int(); .as_int();
size_t tap_end_x = size_t tap_end_x = get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_ENDX,
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_ENDX, loc_data, pugiutil::ReqOpt::REQUIRED) loc_data, pugiutil::ReqOpt::REQUIRED)
.as_int(); .as_int();
size_t tap_end_y = size_t tap_end_y = get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_ENDY,
get_attribute(xml_tap, XML_CLOCK_TREE_TAP_ATTRIBUTE_ENDY, loc_data, pugiutil::ReqOpt::REQUIRED) loc_data, pugiutil::ReqOpt::REQUIRED)
.as_int(); .as_int();
clk_ntwk.set_tap_bounding_box(tap_id, vtr::Rect<size_t>(tap_start_x, tap_start_y, tap_end_x, tap_end_y)); clk_ntwk.set_tap_bounding_box(
tap_id, vtr::Rect<size_t>(tap_start_x, tap_start_y, tap_end_x, tap_end_y));
/* Default step is all 1 */ /* Default step is all 1 */
size_t tap_step_x = size_t tap_step_x =
@ -129,12 +133,17 @@ static void read_xml_clock_tree_taps(pugi::xml_node& xml_taps,
/* Error out if the XML child has an invalid name! */ /* Error out if the XML child has an invalid name! */
if (xml_tap.name() == std::string(XML_CLOCK_TREE_TAP_ALL_NODE_NAME)) { if (xml_tap.name() == std::string(XML_CLOCK_TREE_TAP_ALL_NODE_NAME)) {
read_xml_clock_tree_tap_type_all(xml_tap, loc_data, clk_ntwk, tree_id); read_xml_clock_tree_tap_type_all(xml_tap, loc_data, clk_ntwk, tree_id);
} else if (xml_tap.name() == std::string(XML_CLOCK_TREE_TAP_REGION_NODE_NAME)) { } else if (xml_tap.name() ==
std::string(XML_CLOCK_TREE_TAP_REGION_NODE_NAME)) {
read_xml_clock_tree_tap_type_region(xml_tap, loc_data, clk_ntwk, tree_id); read_xml_clock_tree_tap_type_region(xml_tap, loc_data, clk_ntwk, tree_id);
} else if (xml_tap.name() == std::string(XML_CLOCK_TREE_TAP_SINGLE_NODE_NAME)) { } else if (xml_tap.name() ==
std::string(XML_CLOCK_TREE_TAP_SINGLE_NODE_NAME)) {
read_xml_clock_tree_tap_type_single(xml_tap, loc_data, clk_ntwk, tree_id); read_xml_clock_tree_tap_type_single(xml_tap, loc_data, clk_ntwk, tree_id);
} else { } else {
bad_tag(xml_taps, loc_data, xml_tap, {XML_CLOCK_TREE_TAP_ALL_NODE_NAME, XML_CLOCK_TREE_TAP_REGION_NODE_NAME, XML_CLOCK_TREE_TAP_SINGLE_NODE_NAME}); bad_tag(
xml_taps, loc_data, xml_tap,
{XML_CLOCK_TREE_TAP_ALL_NODE_NAME, XML_CLOCK_TREE_TAP_REGION_NODE_NAME,
XML_CLOCK_TREE_TAP_SINGLE_NODE_NAME});
} }
} }
} }

View File

@ -172,14 +172,16 @@ static int route_clock_tree_rr_graph(
RRNodeId des_node = rr_graph.edge_sink_node(edge); RRNodeId des_node = rr_graph.edge_sink_node(edge);
if (rr_graph.node_type(des_node) == IPIN) { if (rr_graph.node_type(des_node) == IPIN) {
/* Check if the IPIN is mapped, if not, do not connect */ /* Check if the IPIN is mapped, if not, do not connect */
/* if the IPIN is mapped, only connect when net mapping is expected */ /* if the IPIN is mapped, only connect when net mapping is
* expected */
if (tree2clk_pin_map.find(ipin) == tree2clk_pin_map.end()) { if (tree2clk_pin_map.find(ipin) == tree2clk_pin_map.end()) {
continue; continue;
} }
if (!vpr_routing_annotation.rr_node_net(des_node)) { if (!vpr_routing_annotation.rr_node_net(des_node)) {
continue; continue;
} }
if (vpr_routing_annotation.rr_node_net(des_node) != tree2clk_pin_map.at(ipin)) { if (vpr_routing_annotation.rr_node_net(des_node) !=
tree2clk_pin_map.at(ipin)) {
continue; continue;
} }
VTR_ASSERT(rr_graph.valid_node(src_node)); VTR_ASSERT(rr_graph.valid_node(src_node));