Skip to content

Commit b64afde

Browse files
committed
[libs][archfpga] comment parse_pin_name
1 parent f4ae24a commit b64afde

File tree

1 file changed

+71
-71
lines changed

1 file changed

+71
-71
lines changed

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static void ProcessVib(pugi::xml_node Vib_node, std::vector<t_physical_tile_type
416416
static void ProcessFirstStage(pugi::xml_node Stage_node, std::vector<t_physical_tile_type>& PhysicalTileTypes, std::vector<t_first_stage_mux_inf>& first_stages, const pugiutil::loc_data& loc_data);
417417
static void ProcessSecondStage(pugi::xml_node Stage_node, std::vector<t_physical_tile_type>& PhysicalTileTypes, std::vector<t_second_stage_mux_inf>& second_stages, const pugiutil::loc_data& loc_data);
418418
// static void ProcessFromOrToTokens(const std::vector<std::string> Tokens, std::vector<t_physical_tile_type>& PhysicalTileTypes, std::vector<t_from_or_to_inf>& froms);
419-
void parse_pin_name(char* src_string, int* start_pin_index, int* end_pin_index, char* pb_type_name, char* port_name);
419+
// static void parse_pin_name(char* src_string, int* start_pin_index, int* end_pin_index, char* pb_type_name, char* port_name);
420420

421421
/*
422422
*
@@ -5671,81 +5671,81 @@ static void ProcessSecondStage(pugi::xml_node Stage_node, std::vector<t_physical
56715671
// }
56725672
// }
56735673

5674-
void parse_pin_name(char* src_string, int* start_pin_index, int* end_pin_index, char* pb_type_name, char* port_name) {
5675-
/* Parses out the pb_type_name and port_name *
5676-
* If the start_pin_index and end_pin_index is specified, parse them too. *
5677-
* Return the values parsed by reference. */
5674+
// void parse_pin_name(char* src_string, int* start_pin_index, int* end_pin_index, char* pb_type_name, char* port_name) {
5675+
// /* Parses out the pb_type_name and port_name *
5676+
// * If the start_pin_index and end_pin_index is specified, parse them too. *
5677+
// * Return the values parsed by reference. */
56785678

5679-
char* source_string = nullptr;
5680-
char* find_format = nullptr;
5681-
int ichar, match_count;
5679+
// char* source_string = nullptr;
5680+
// char* find_format = nullptr;
5681+
// int ichar, match_count;
56825682

5683-
// parse out the pb_type and port name, possibly pin_indices
5684-
find_format = strstr(src_string, "[");
5685-
if (find_format == nullptr) {
5686-
/* Format "pb_type_name.port_name" */
5687-
*start_pin_index = *end_pin_index = -1;
5683+
// // parse out the pb_type and port name, possibly pin_indices
5684+
// find_format = strstr(src_string, "[");
5685+
// if (find_format == nullptr) {
5686+
// /* Format "pb_type_name.port_name" */
5687+
// *start_pin_index = *end_pin_index = -1;
56885688

5689-
strcpy(source_string, src_string);
5689+
// strcpy(source_string, src_string);
56905690

5691-
for (ichar = 0; ichar < (int)(strlen(source_string)); ichar++) {
5692-
if (source_string[ichar] == '.')
5693-
source_string[ichar] = ' ';
5694-
}
5691+
// for (ichar = 0; ichar < (int)(strlen(source_string)); ichar++) {
5692+
// if (source_string[ichar] == '.')
5693+
// source_string[ichar] = ' ';
5694+
// }
56955695

5696-
match_count = sscanf(source_string, "%s %s", pb_type_name, port_name);
5697-
if (match_count != 2) {
5698-
VTR_LOG_ERROR(
5699-
"Invalid pin - %s, name should be in the format "
5700-
"\"pb_type_name\".\"port_name\" or \"pb_type_name\".\"port_name[end_pin_index:start_pin_index]\". "
5701-
"The end_pin_index and start_pin_index can be the same.\n",
5702-
src_string);
5703-
exit(1);
5704-
}
5705-
} else {
5706-
/* Format "pb_type_name.port_name[end_pin_index:start_pin_index]" */
5707-
strcpy(source_string, src_string);
5708-
for (ichar = 0; ichar < (int)(strlen(source_string)); ichar++) {
5709-
//Need white space between the components when using %s with
5710-
//sscanf
5711-
if (source_string[ichar] == '.')
5712-
source_string[ichar] = ' ';
5713-
if (source_string[ichar] == '[')
5714-
source_string[ichar] = ' ';
5715-
}
5716-
5717-
match_count = sscanf(source_string, "%s %s %d:%d]",
5718-
pb_type_name, port_name,
5719-
end_pin_index, start_pin_index);
5720-
if (match_count != 4) {
5721-
match_count = sscanf(source_string, "%s %s %d]",
5722-
pb_type_name, port_name,
5723-
end_pin_index);
5724-
*start_pin_index = *end_pin_index;
5725-
if (match_count != 3) {
5726-
VTR_LOG_ERROR(
5727-
"Invalid pin - %s, name should be in the format "
5728-
"\"pb_type_name\".\"port_name\" or \"pb_type_name\".\"port_name[end_pin_index:start_pin_index]\". "
5729-
"The end_pin_index and start_pin_index can be the same.\n",
5730-
src_string);
5731-
exit(1);
5732-
}
5733-
}
5734-
if (*end_pin_index < 0 || *start_pin_index < 0) {
5735-
VTR_LOG_ERROR(
5736-
"Invalid pin - %s, the pin_index in "
5737-
"[end_pin_index:start_pin_index] should not be a negative value.\n",
5738-
src_string);
5739-
exit(1);
5740-
}
5741-
if (*end_pin_index < *start_pin_index) {
5742-
int temp;
5743-
temp = *end_pin_index;
5744-
*end_pin_index = *start_pin_index;
5745-
*start_pin_index = temp;
5746-
}
5747-
}
5748-
}
5696+
// match_count = sscanf(source_string, "%s %s", pb_type_name, port_name);
5697+
// if (match_count != 2) {
5698+
// VTR_LOG_ERROR(
5699+
// "Invalid pin - %s, name should be in the format "
5700+
// "\"pb_type_name\".\"port_name\" or \"pb_type_name\".\"port_name[end_pin_index:start_pin_index]\". "
5701+
// "The end_pin_index and start_pin_index can be the same.\n",
5702+
// src_string);
5703+
// exit(1);
5704+
// }
5705+
// } else {
5706+
// /* Format "pb_type_name.port_name[end_pin_index:start_pin_index]" */
5707+
// strcpy(source_string, src_string);
5708+
// for (ichar = 0; ichar < (int)(strlen(source_string)); ichar++) {
5709+
// //Need white space between the components when using %s with
5710+
// //sscanf
5711+
// if (source_string[ichar] == '.')
5712+
// source_string[ichar] = ' ';
5713+
// if (source_string[ichar] == '[')
5714+
// source_string[ichar] = ' ';
5715+
// }
5716+
5717+
// match_count = sscanf(source_string, "%s %s %d:%d]",
5718+
// pb_type_name, port_name,
5719+
// end_pin_index, start_pin_index);
5720+
// if (match_count != 4) {
5721+
// match_count = sscanf(source_string, "%s %s %d]",
5722+
// pb_type_name, port_name,
5723+
// end_pin_index);
5724+
// *start_pin_index = *end_pin_index;
5725+
// if (match_count != 3) {
5726+
// VTR_LOG_ERROR(
5727+
// "Invalid pin - %s, name should be in the format "
5728+
// "\"pb_type_name\".\"port_name\" or \"pb_type_name\".\"port_name[end_pin_index:start_pin_index]\". "
5729+
// "The end_pin_index and start_pin_index can be the same.\n",
5730+
// src_string);
5731+
// exit(1);
5732+
// }
5733+
// }
5734+
// if (*end_pin_index < 0 || *start_pin_index < 0) {
5735+
// VTR_LOG_ERROR(
5736+
// "Invalid pin - %s, the pin_index in "
5737+
// "[end_pin_index:start_pin_index] should not be a negative value.\n",
5738+
// src_string);
5739+
// exit(1);
5740+
// }
5741+
// if (*end_pin_index < *start_pin_index) {
5742+
// int temp;
5743+
// temp = *end_pin_index;
5744+
// *end_pin_index = *start_pin_index;
5745+
// *start_pin_index = temp;
5746+
// }
5747+
// }
5748+
// }
57495749

57505750
/* Process vib layout */
57515751
static void ProcessVibLayout(pugi::xml_node vib_layout_tag, t_arch* arch, const pugiutil::loc_data& loc_data) {

0 commit comments

Comments
 (0)