Skip to content

Commit 11e3b5a

Browse files
committed
2 parents 2f82dd7 + d2be1c8 commit 11e3b5a

File tree

90 files changed

+4887
-3919
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+4887
-3919
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,4 @@ tags
153153
.idea
154154
cmake-build-debug
155155
cmake-build-release
156-
/.metadata/
156+
/.metadata/

doc/src/api/vprinternals/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ VPR INTERNALS
1010
vpr_ui
1111
draw_files
1212
vpr_noc
13+
vpr_router
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
==============
2+
Router Heap
3+
==============
4+
5+
t_heap
6+
----------
7+
.. doxygenstruct:: t_heap
8+
:project: vpr
9+
:members:
10+
11+
HeapInterface
12+
----------
13+
.. doxygenclass:: HeapInterface
14+
:project: vpr
15+
:members:
16+
17+
HeapStorage
18+
----------
19+
.. doxygenclass:: HeapStorage
20+
:project: vpr
21+
:members:
22+
23+
KAryHeap
24+
----------
25+
.. doxygenclass:: KAryHeap
26+
:project: vpr
27+
28+
FourAryHeap
29+
----------
30+
.. doxygenclass:: FourAryHeap
31+
:project: vpr
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _router:
2+
3+
=======
4+
VPR Router
5+
=======
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
router_heap

libs/libarchfpga/src/arch_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const char* get_arch_file_name() {
3535
return arch_file_name;
3636
}
3737

38-
InstPort::InstPort(std::string str) {
38+
InstPort::InstPort(const std::string& str) {
3939
std::vector<std::string> inst_port = vtr::split(str, ".");
4040

4141
if (inst_port.size() == 1) {

libs/libarchfpga/src/arch_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class InstPort {
2222
static constexpr int UNSPECIFIED = -1;
2323

2424
InstPort() = default;
25-
InstPort(std::string str);
25+
InstPort(const std::string& str);
2626
std::string instance_name() const { return instance_.name; }
2727
std::string port_name() const { return port_.name; }
2828

libs/libarchfpga/src/physical_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,6 +2009,7 @@ struct t_arch {
20092009

20102010
/* Xifan Tang: options for tileable routing architectures */
20112011
bool tileable;
2012+
bool perimeter_cb;
20122013
bool shrink_boundary;
20132014
bool through_channel;
20142015
bool opin2all_sides;

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static void ProcessEquivalentSiteCustomConnection(pugi::xml_node Parent,
168168
t_sub_tile* SubTile,
169169
t_physical_tile_type* PhysicalTileType,
170170
t_logical_block_type* LogicalBlockType,
171-
std::string site_name,
171+
const std::string& site_name,
172172
const pugiutil::loc_data& loc_data);
173173
static void ProcessPinLocations(pugi::xml_node Locations,
174174
t_physical_tile_type* PhysicalTileType,
@@ -374,7 +374,7 @@ static bool attribute_to_bool(const pugi::xml_node node,
374374

375375
static int find_switch_by_name(const t_arch& arch, const std::string& switch_name);
376376

377-
e_side string_to_side(const std::string& side_str);
377+
static e_side string_to_side(const std::string& side_str);
378378

379379
template<typename T>
380380
static T* get_type_by_name(const char* type_name, std::vector<T>& types);
@@ -1668,10 +1668,10 @@ static void ProcessPb_TypePort_Power(pugi::xml_node Parent, t_port* port, e_powe
16681668
static void ProcessPb_TypePort(pugi::xml_node Parent, t_port* port, e_power_estimation_method power_method, const bool is_root_pb_type, const pugiutil::loc_data& loc_data) {
16691669
std::vector<std::string> expected_attributes = {"name", "num_pins", "port_class"};
16701670
if (is_root_pb_type) {
1671-
expected_attributes.push_back("equivalent");
1671+
expected_attributes.emplace_back("equivalent");
16721672

16731673
if (Parent.name() == "input"s || Parent.name() == "clock"s) {
1674-
expected_attributes.push_back("is_non_clock_global");
1674+
expected_attributes.emplace_back("is_non_clock_global");
16751675
}
16761676
}
16771677

@@ -2535,6 +2535,7 @@ static void ProcessLayout(pugi::xml_node layout_tag, t_arch* arch, const pugiuti
25352535
//expect_only_attributes(layout_tag, {}, loc_data);
25362536

25372537
arch->tileable = get_attribute(layout_tag, "tileable", loc_data, ReqOpt::OPTIONAL).as_bool(false);
2538+
arch->perimeter_cb = get_attribute(layout_tag, "perimeter_cb", loc_data, ReqOpt::OPTIONAL).as_bool(false);
25382539
arch->shrink_boundary = get_attribute(layout_tag, "shrink_boundary", loc_data, ReqOpt::OPTIONAL).as_bool(false);
25392540
arch->through_channel = get_attribute(layout_tag, "through_channel", loc_data, ReqOpt::OPTIONAL).as_bool(false);
25402541
arch->opin2all_sides = get_attribute(layout_tag, "opin2all_sides", loc_data, ReqOpt::OPTIONAL).as_bool(false);
@@ -2939,7 +2940,7 @@ static void ProcessDevice(pugi::xml_node Node, t_arch* arch, t_default_fc_spec&
29392940
//<connection_block> tag
29402941
Cur = get_single_child(Node, "connection_block", loc_data);
29412942
expect_only_attributes(Cur, {"input_switch_name", "input_inter_die_switch_name"}, loc_data);
2942-
arch->ipin_cblock_switch_name.push_back(get_attribute(Cur, "input_switch_name", loc_data).as_string());
2943+
arch->ipin_cblock_switch_name.emplace_back(get_attribute(Cur, "input_switch_name", loc_data).as_string());
29432944
std::string inter_die_conn = get_attribute(Cur, "input_inter_die_switch_name", loc_data, ReqOpt::OPTIONAL).as_string("");
29442945
if (inter_die_conn != "") {
29452946
arch->ipin_cblock_switch_name.push_back(inter_die_conn);
@@ -3359,7 +3360,7 @@ static void ProcessEquivalentSiteCustomConnection(pugi::xml_node Parent,
33593360
t_sub_tile* SubTile,
33603361
t_physical_tile_type* PhysicalTileType,
33613362
t_logical_block_type* LogicalBlockType,
3362-
std::string site_name,
3363+
const std::string& site_name,
33633364
const pugiutil::loc_data& loc_data) {
33643365
pugi::xml_node CurDirect;
33653366

@@ -3542,7 +3543,7 @@ static void ProcessPinLocations(pugi::xml_node Locations,
35423543
for (int h = 0; h < PhysicalTileType->height; ++h) {
35433544
for (e_side side : {TOP, RIGHT, BOTTOM, LEFT}) {
35443545
for (const auto& token : pin_locs->assignments[sub_tile_index][w][h][l][side]) {
3545-
InstPort inst_port(token.c_str());
3546+
InstPort inst_port(token);
35463547

35473548
//A pin specification should contain only the block name, and not any instance count information
35483549
//A pin specification may contain instance count, but should be in the range of capacity
@@ -3909,8 +3910,8 @@ static void ProcessSegments(pugi::xml_node Parent,
39093910

39103911
if (!Segs[i].longline) {
39113912
//Long line doesn't accpet <sb> or <cb> since it assumes full population
3912-
expected_subtags.push_back("sb");
3913-
expected_subtags.push_back("cb");
3913+
expected_subtags.emplace_back("sb");
3914+
expected_subtags.emplace_back("cb");
39143915
}
39153916

39163917
/* Get the type */
@@ -3919,16 +3920,16 @@ static void ProcessSegments(pugi::xml_node Parent,
39193920
Segs[i].directionality = BI_DIRECTIONAL;
39203921

39213922
//Bidir requires the following tags
3922-
expected_subtags.push_back("wire_switch");
3923-
expected_subtags.push_back("opin_switch");
3923+
expected_subtags.emplace_back("wire_switch");
3924+
expected_subtags.emplace_back("opin_switch");
39243925
}
39253926

39263927
else if (0 == strcmp(tmp, "unidir")) {
39273928
Segs[i].directionality = UNI_DIRECTIONAL;
39283929

39293930
//Unidir requires the following tags
3930-
expected_subtags.push_back("mux");
3931-
expected_subtags.push_back("mux_inter_die");
3931+
expected_subtags.emplace_back("mux");
3932+
expected_subtags.emplace_back("mux_inter_die");
39323933
}
39333934

39343935
else {
@@ -4114,8 +4115,6 @@ static void ProcessSwitchblocks(pugi::xml_node Parent, t_arch* arch, const pugiu
41144115

41154116
Node = Node.next_sibling(Node.name());
41164117
}
4117-
4118-
return;
41194118
}
41204119

41214120
static void ProcessCB_SB(pugi::xml_node Node, std::vector<bool>& list, const pugiutil::loc_data& loc_data) {
@@ -4876,7 +4875,7 @@ static int find_switch_by_name(const t_arch& arch, const std::string& switch_nam
48764875
return OPEN;
48774876
}
48784877

4879-
e_side string_to_side(const std::string& side_str) {
4878+
static e_side string_to_side(const std::string& side_str) {
48804879
e_side side = NUM_SIDES;
48814880
if (side_str.empty()) {
48824881
side = NUM_SIDES;
@@ -4905,4 +4904,4 @@ static T* get_type_by_name(const char* type_name, std::vector<T>& types) {
49054904

49064905
archfpga_throw(__FILE__, __LINE__,
49074906
"Could not find type: %s\n", type_name);
4908-
}
4907+
}

libs/librrgraph/src/base/check_rr_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ void check_rr_node(const RRGraphView& rr_graph,
412412
break;
413413

414414
case CHANX:
415-
if (xlow < 1 || xhigh > int(grid.width()) - 2 || yhigh > int(grid.height()) - 2 || yhigh != ylow) {
415+
if (xhigh > int(grid.width()) - 1 || yhigh > int(grid.height()) - 2 || yhigh != ylow) {
416416
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
417417
"in check_rr_node: CHANX out of range for endpoints (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh);
418418
}
@@ -423,7 +423,7 @@ void check_rr_node(const RRGraphView& rr_graph,
423423
break;
424424

425425
case CHANY:
426-
if (xhigh > int(grid.width()) - 2 || ylow < 1 || yhigh > int(grid.height()) - 2 || xlow != xhigh) {
426+
if (xhigh > int(grid.width()) - 2 || yhigh > int(grid.height()) - 1 || xlow != xhigh) {
427427
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
428428
"Error in check_rr_node: CHANY out of range for endpoints (%d,%d) and (%d,%d)\n", xlow, ylow, xhigh, yhigh);
429429
}

utils/route_diag/src/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ static void do_one_route(const Netlist<>& net_list,
103103
segment_inf,
104104
is_flat);
105105

106-
ConnectionRouter<BinaryHeap> router(
107-
device_ctx.grid,
108-
*router_lookahead,
106+
ConnectionRouter<FourAryHeap> router(
107+
device_ctx.grid,
108+
*router_lookahead,
109109
device_ctx.rr_graph.rr_nodes(),
110110
&device_ctx.rr_graph,
111111
device_ctx.rr_rc_data,

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static void SetupRoutingArch(const t_arch& Arch,
423423

424424
/* Copy the tileable routing setting */
425425
RoutingArch->tileable = Arch.tileable;
426+
RoutingArch->perimeter_cb = Arch.perimeter_cb;
426427
RoutingArch->shrink_boundary = Arch.shrink_boundary;
427428
RoutingArch->through_channel = Arch.through_channel;
428429
RoutingArch->opin2all_sides = Arch.opin2all_sides;

0 commit comments

Comments
 (0)