Skip to content

Commit 5315f52

Browse files
authored
Merge branch 'master' into add_tests
2 parents 7715a8a + f81a1bf commit 5315f52

15 files changed

+310
-351
lines changed

doc/src/vpr/command_line_usage.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,14 @@ Analytical Placement is generally split into three stages:
13241324

13251325
**Default:** ``auto``
13261326

1327+
.. option:: --ap_high_fanout_threshold <int>
1328+
1329+
Defines the threshold for high fanout nets within AP flow.
1330+
1331+
Ignores the nets that have higher fanouts than the threshold for the analytical solver.
1332+
1333+
**Default:** ``256``
1334+
13271335
.. option:: --ap_verbosity <int>
13281336

13291337
Controls the verbosity of the AP flow output.

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ static void LoadPinLoc(pugi::xml_node Locations,
698698
for (int width = 0; width < type->width; ++width) {
699699
for (int height = 0; height < type->height; ++height) {
700700
for (e_side side : TOTAL_2D_SIDES) {
701-
for (auto token : pin_locs->assignments[sub_tile_index][width][height][layer][side]) {
701+
for (const std::string& token : pin_locs->assignments[sub_tile_index][width][height][layer][side]) {
702702
auto pin_range = ProcessPinString<t_sub_tile*>(Locations,
703703
&sub_tile,
704704
token.c_str(),
@@ -741,109 +741,97 @@ static std::pair<int, int> ProcessPinString(pugi::xml_node Locations,
741741
T type,
742742
const char* pin_loc_string,
743743
const pugiutil::loc_data& loc_data) {
744-
int num_tokens;
745-
auto tokens = GetTokensFromString(pin_loc_string, &num_tokens);
744+
Tokens tokens(pin_loc_string);
746745

747-
int token_index = 0;
748-
auto token = tokens[token_index];
746+
size_t token_index = 0;
749747

750-
if (token.type != TOKEN_STRING || token.data != type->name) {
748+
if (tokens[token_index].type != e_token_type::STRING || tokens[token_index].data != type->name) {
751749
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
752750
"Wrong physical type name of the port: %s\n", pin_loc_string);
753751
}
754752

755753
token_index++;
756-
token = tokens[token_index];
757754

758-
if (token.type != TOKEN_DOT) {
755+
if (tokens[token_index].type != e_token_type::DOT) {
759756
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
760757
"No dot is present to separate type name and port name: %s\n", pin_loc_string);
761758
}
762759

763760
token_index++;
764-
token = tokens[token_index];
765761

766-
if (token.type != TOKEN_STRING) {
762+
if (tokens[token_index].type != e_token_type::STRING) {
767763
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
768764
"No port name is present: %s\n", pin_loc_string);
769765
}
770766

771-
auto port = type->get_port(token.data);
767+
auto port = type->get_port(tokens[token_index].data);
772768
if (port == nullptr) {
773769
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
774770
"Port %s for %s could not be found: %s\n",
775-
type->name.c_str(), token.data,
771+
type->name.c_str(), tokens[token_index].data.c_str(),
776772
pin_loc_string);
777773
}
778774
int abs_first_pin_idx = port->absolute_first_pin_index;
779775

780776
token_index++;
781777

782778
// All the pins of the port are taken or the port has a single pin
783-
if (token_index == num_tokens) {
784-
freeTokens(tokens, num_tokens);
779+
if (token_index == tokens.size()) {
785780
return std::make_pair(abs_first_pin_idx, abs_first_pin_idx + port->num_pins);
786781
}
787782

788-
token = tokens[token_index];
789-
790-
if (token.type != TOKEN_OPEN_SQUARE_BRACKET) {
783+
if (tokens[token_index].type != e_token_type::OPEN_SQUARE_BRACKET) {
791784
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
792785
"No open square bracket present: %s\n", pin_loc_string);
793786
}
794787

795788
token_index++;
796-
token = tokens[token_index];
797789

798-
if (token.type != TOKEN_INT) {
790+
if (tokens[token_index].type != e_token_type::INT) {
799791
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
800792
"No integer to indicate least significant pin index: %s\n", pin_loc_string);
801793
}
802794

803-
int first_pin = vtr::atoi(token.data);
795+
int first_pin = vtr::atoi(tokens[token_index].data);
804796

805797
token_index++;
806-
token = tokens[token_index];
807798

808799
// Single pin is specified
809-
if (token.type != TOKEN_COLON) {
810-
if (token.type != TOKEN_CLOSE_SQUARE_BRACKET) {
800+
if (tokens[token_index].type != e_token_type::COLON) {
801+
if (tokens[token_index].type != e_token_type::CLOSE_SQUARE_BRACKET) {
811802
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
812803
"No closing bracket: %s\n", pin_loc_string);
813804
}
814805

815806
token_index++;
816807

817-
if (token_index != num_tokens) {
808+
if (token_index != tokens.size()) {
818809
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
819810
"pin location should be completed, but more tokens are present: %s\n", pin_loc_string);
820811
}
821812

822-
freeTokens(tokens, num_tokens);
823813
return std::make_pair(abs_first_pin_idx + first_pin, abs_first_pin_idx + first_pin + 1);
824814
}
825815

826816
token_index++;
827-
token = tokens[token_index];
828817

829-
if (token.type != TOKEN_INT) {
818+
if (tokens[token_index].type != e_token_type::INT) {
830819
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
831820
"No integer to indicate most significant pin index: %s\n", pin_loc_string);
832821
}
833822

834-
int last_pin = vtr::atoi(token.data);
823+
int last_pin = vtr::atoi(tokens[token_index].data);
835824

836825
token_index++;
837-
token = tokens[token_index];
838826

839-
if (token.type != TOKEN_CLOSE_SQUARE_BRACKET) {
827+
if (tokens[token_index].type != e_token_type::CLOSE_SQUARE_BRACKET) {
840828
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
841829
"No closed square bracket: %s\n", pin_loc_string);
842830
}
843831

844832
token_index++;
845833

846-
if (token_index != num_tokens) {
834+
if (token_index != tokens.size()) {
847835
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
848836
"pin location should be completed, but more tokens are present: %s\n", pin_loc_string);
849837
}
@@ -852,7 +840,6 @@ static std::pair<int, int> ProcessPinString(pugi::xml_node Locations,
852840
std::swap(first_pin, last_pin);
853841
}
854842

855-
freeTokens(tokens, num_tokens);
856843
return std::make_pair(abs_first_pin_idx + first_pin, abs_first_pin_idx + last_pin + 1);
857844
}
858845

0 commit comments

Comments
 (0)