Skip to content

Commit 205514f

Browse files
committed
[libs][arch] fix formatting
1 parent edd3617 commit 205514f

File tree

2 files changed

+28
-34
lines changed

2 files changed

+28
-34
lines changed

libs/libarchfpga/src/read_fpga_interchange_arch.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,13 +1845,13 @@ struct ArchReader {
18451845
auto site_pins = site.getBelPins();
18461846

18471847
std::string endpoint = direction == BACKWARD ? ic->input_string : ic->output_string;
1848-
auto ic_endpoints = vtr::StringToken(endpoint).split(" ");
1848+
std::vector<std::string> ic_endpoints = vtr::StringToken(endpoint).split(" ");
18491849

18501850
std::unordered_map<t_interconnect*, std::set<std::string>> pps_map;
18511851

18521852
bool is_backward = direction == BACKWARD;
18531853

1854-
for (auto ep : ic_endpoints) {
1854+
for (const std::string& ep : ic_endpoints) {
18551855
auto parts = vtr::StringToken(ep).split(".");
18561856
auto bel = parts[0];
18571857
auto pin = parts[1];
@@ -1875,7 +1875,7 @@ struct ArchReader {
18751875
if (bel_reader.getCategory() == ROUTING) {
18761876
for (auto bel_pin : bel_reader.getPins()) {
18771877
auto pin_reader = site_pins[bel_pin];
1878-
auto pin_name = str(pin_reader.getName());
1878+
std::string pin_name = str(pin_reader.getName());
18791879

18801880
if (pin_reader.getDir() != (is_backward ? INPUT : OUTPUT))
18811881
continue;
@@ -1889,7 +1889,7 @@ struct ArchReader {
18891889
std::string ic_to_find = bel + "." + pin_name;
18901890

18911891
bool found = false;
1892-
for (auto out : vtr::StringToken(is_backward ? other_ic->output_string : other_ic->input_string).split(" "))
1892+
for (const std::string& out : vtr::StringToken(is_backward ? other_ic->output_string : other_ic->input_string).split(" "))
18931893
found |= out == ic_to_find;
18941894

18951895
if (found) {
@@ -1911,7 +1911,7 @@ struct ArchReader {
19111911
t_interconnect* other_ic = &mode->interconnect[iic];
19121912

19131913
bool found = false;
1914-
for (auto other_ep : vtr::StringToken(is_backward ? other_ic->output_string : other_ic->input_string).split(" ")) {
1914+
for (const std::string& other_ep : vtr::StringToken(is_backward ? other_ic->output_string : other_ic->input_string).split(" ")) {
19151915
found |= other_ep == ep;
19161916
}
19171917

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void xml_read_arch(const char* ArchFile,
436436
Next = get_single_child(architecture, "layout", loc_data);
437437
process_layout(Next, arch, loc_data, num_of_avail_layers);
438438

439-
/* Precess vib_layout */
439+
// Precess vib_layout
440440
Next = get_single_child(architecture, "vib_layout", loc_data, ReqOpt::OPTIONAL);
441441
if (Next) {
442442
process_vib_layout(Next, arch, loc_data);
@@ -480,13 +480,13 @@ void xml_read_arch(const char* ArchFile,
480480
arch->directs = process_directs(Next, arch->switches, loc_data);
481481
}
482482

483-
/* Process vib_arch */
483+
// Process vib_arch
484484
Next = get_single_child(architecture, "vib_arch", loc_data, ReqOpt::OPTIONAL);
485485
if (Next) {
486486
process_vib_arch(Next, PhysicalTileTypes, arch, loc_data);
487487
}
488488

489-
/* Process Clock Networks */
489+
// Process Clock Networks
490490
Next = get_single_child(architecture, "clocknetworks", loc_data, ReqOpt::OPTIONAL);
491491
if (Next) {
492492
std::vector<std::string> expected_children = {"metal_layers", "clock_network", "clock_routing"};
@@ -505,11 +505,10 @@ void xml_read_arch(const char* ArchFile,
505505
loc_data);
506506
}
507507

508-
/* Process architecture power information */
508+
// Process architecture power information
509509

510-
/* If arch->power has been initialized, meaning the user has requested power estimation,
511-
* then the power architecture information is required.
512-
*/
510+
// If arch->power has been initialized, meaning the user has requested power estimation,
511+
// then the power architecture information is required.
513512
if (arch->power) {
514513
POWER_REQD = ReqOpt::REQUIRED;
515514
} else {
@@ -521,9 +520,7 @@ void xml_read_arch(const char* ArchFile,
521520
if (arch->power) {
522521
process_power(Next, arch->power, loc_data);
523522
} else {
524-
/* This information still needs to be read, even if it is just
525-
* thrown away.
526-
*/
523+
// This information still needs to be read, even if it is just thrown away.
527524
t_power_arch* power_arch_fake = new t_power_arch();
528525
process_power(Next, power_arch_fake, loc_data);
529526
delete power_arch_fake;
@@ -536,9 +533,7 @@ void xml_read_arch(const char* ArchFile,
536533
if (arch->clocks) {
537534
process_clocks(Next, *arch->clocks, loc_data);
538535
} else {
539-
/* This information still needs to be read, even if it is just
540-
* thrown away.
541-
*/
536+
// This information still needs to be read, even if it is just thrown away.
542537
std::vector<t_clock_network> clocks_fake;
543538
process_clocks(Next, clocks_fake, loc_data);
544539
}
@@ -2921,7 +2916,7 @@ static void process_device(pugi::xml_node Node, t_arch* arch, t_default_fc_spec&
29212916
Cur = get_single_child(Node, "switch_block", loc_data);
29222917
expect_only_attributes(Cur, {"type", "fs", "sub_type", "sub_fs"}, loc_data);
29232918
Prop = get_attribute(Cur, "type", loc_data).value();
2924-
/* Parse attribute 'type', representing the major connectivity pattern for switch blocks */
2919+
// Parse attribute 'type', representing the major connectivity pattern for switch blocks
29252920
if (strcmp(Prop, "wilton") == 0) {
29262921
arch->sb_type = WILTON;
29272922
} else if (strcmp(Prop, "universal") == 0) {
@@ -2935,19 +2930,18 @@ static void process_device(pugi::xml_node Node, t_arch* arch, t_default_fc_spec&
29352930
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Cur),
29362931
vtr::string_fmt("Unknown property %s for switch block type x\n", Prop).c_str());
29372932
}
2938-
/* Parse attribute 'sub_type', representing the minor connectivity pattern for switch blocks
2939-
* If not specified, the 'sub_type' is the same as major type
2940-
* This option is only valid for tileable routing resource graph builder
2941-
* Note that sub_type does not support custom switch block pattern!!!
2942-
* If 'sub_type' is specified, the custom switch block for 'type' is not allowed!
2943-
*/
2933+
// Parse attribute 'sub_type', representing the minor connectivity pattern for switch blocks
2934+
// If not specified, the 'sub_type' is the same as major type
2935+
// This option is only valid for tileable routing resource graph builder
2936+
// Note that sub_type does not support custom switch block pattern!!!
2937+
// If 'sub_type' is specified, the custom switch block for 'type' is not allowed!
29442938
std::string sub_type_str = get_attribute(Cur, "sub_type", loc_data, BoolToReqOpt(false)).as_string("");
29452939
if (!sub_type_str.empty()) {
2946-
if (sub_type_str == std::string("wilton")) {
2940+
if (sub_type_str == "wilton") {
29472941
arch->sb_sub_type = WILTON;
2948-
} else if (sub_type_str == std::string("universal")) {
2942+
} else if (sub_type_str == "universal") {
29492943
arch->sb_sub_type = UNIVERSAL;
2950-
} else if (sub_type_str == std::string("subset")) {
2944+
} else if (sub_type_str == "subset") {
29512945
arch->sb_sub_type = SUBSET;
29522946
} else {
29532947
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Cur),
@@ -2957,8 +2951,8 @@ static void process_device(pugi::xml_node Node, t_arch* arch, t_default_fc_spec&
29572951
arch->sb_sub_type = arch->sb_type;
29582952
}
29592953

2960-
ReqOpt CUSTOM_SWITCHBLOCK_REQD = BoolToReqOpt(!custom_switch_block);
2961-
arch->Fs = get_attribute(Cur, "fs", loc_data, CUSTOM_SWITCHBLOCK_REQD).as_int(3);
2954+
ReqOpt custom_switchblock_reqd = BoolToReqOpt(!custom_switch_block);
2955+
arch->Fs = get_attribute(Cur, "fs", loc_data, custom_switchblock_reqd).as_int(3);
29622956
arch->sub_fs = get_attribute(Cur, "sub_fs", loc_data, BoolToReqOpt(false)).as_int(arch->Fs);
29632957

29642958
Cur = get_single_child(Node, "default_fc", loc_data, ReqOpt::OPTIONAL);
@@ -4056,7 +4050,7 @@ static std::vector<t_segment_inf> process_segments(pugi::xml_node Parent,
40564050
process_cb_sb(SubElem, Segs[i].sb, loc_data);
40574051
}
40584052

4059-
/* Setup the bend list if they give one, otherwise use default */
4053+
// Setup the bend list if they give one, otherwise use default
40604054
if (length > 1) {
40614055
Segs[i].is_bend = false;
40624056
SubElem = get_single_child(Node, "bend", loc_data, ReqOpt::OPTIONAL);
@@ -4065,12 +4059,12 @@ static std::vector<t_segment_inf> process_segments(pugi::xml_node Parent,
40654059
}
40664060
}
40674061

4068-
/*Store the index of this segment in Segs vector*/
4062+
// Store the index of this segment in Segs vector
40694063
Segs[i].seg_index = i;
4070-
/* Get next Node */
4064+
// Get next Node
40714065
Node = Node.next_sibling(Node.name());
40724066
}
4073-
/*We need at least one type of segment that applies to each of x- and y-directed wiring.*/
4067+
// We need at least one type of segment that applies to each of x- and y-directed wiring.
40744068

40754069
if (!x_axis_seg_found || !y_axis_seg_found) {
40764070
archfpga_throw(loc_data.filename_c_str(), loc_data.line(Node),

0 commit comments

Comments
 (0)