[Engine] Bug fix in fabric key parser on identifying invalid coordinate

This commit is contained in:
tangxifan 2021-09-21 16:45:14 -07:00
parent ab42239b94
commit e09ab2298e
1 changed files with 1 additions and 6 deletions

View File

@ -65,12 +65,7 @@ void read_xml_region_key(pugi::xml_node& xml_component_key,
vtr::Point<int> coord; vtr::Point<int> coord;
coord.set_x(get_attribute(xml_component_key, "column", loc_data, pugiutil::ReqOpt::OPTIONAL).as_int(-1)); coord.set_x(get_attribute(xml_component_key, "column", loc_data, pugiutil::ReqOpt::OPTIONAL).as_int(-1));
coord.set_y(get_attribute(xml_component_key, "row", loc_data, pugiutil::ReqOpt::OPTIONAL).as_int(-1)); coord.set_y(get_attribute(xml_component_key, "row", loc_data, pugiutil::ReqOpt::OPTIONAL).as_int(-1));
/* Require positive coordinate all the time */ if (fabric_key.valid_key_coordinate(coord)) {
if (!fabric_key.valid_key_coordinate(coord)) {
archfpga_throw(loc_data.filename_c_str(), loc_data.line(xml_component_key),
"Invalid coordinate '(%d, %d)' which contain negative numbers\n",
coord.x(), coord.y());
} else {
fabric_key.set_key_coordinate(FabricKeyId(id), coord); fabric_key.set_key_coordinate(FabricKeyId(id), coord);
} }
} }