Skip to content

Commit ba55efb

Browse files
committed
Conforming to formating standard for clock router
1 parent e3539e2 commit ba55efb

File tree

5 files changed

+37
-41
lines changed

5 files changed

+37
-41
lines changed

vpr/src/base/vpr_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ struct t_router_opts {
939939
float congested_routing_iteration_threshold_frac;
940940
e_route_bb_update route_bb_update;
941941
enum e_clock_modeling clock_modeling; //How clock pins and nets should be handled
942-
bool two_stage_clock_routing; //How clock nets on dedicated networks should be routed
942+
bool two_stage_clock_routing; //How clock nets on dedicated networks should be routed
943943
int high_fanout_threshold;
944944
int router_debug_net;
945945
int router_debug_sink_rr;
@@ -1293,7 +1293,7 @@ struct t_vpr_setup {
12931293
std::string device_layout;
12941294
e_constant_net_method constant_net_method; //How constant nets should be handled
12951295
e_clock_modeling clock_modeling; //How clocks should be handled
1296-
bool two_stage_clock_routing; //How clocks should be routed in the presence of a dedicated clock network
1296+
bool two_stage_clock_routing; //How clocks should be routed in the presence of a dedicated clock network
12971297
bool exit_before_pack; //Exits early before starting packing (useful for collecting statistics without running/loading any stages)
12981298
};
12991299

vpr/src/route/check_route.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static bool check_adjacent(int from_node, int to_node) {
443443
num_adj += chanx_chany_adjacent(from_node, to_node);
444444
} else {
445445
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
446-
"in check_adjacent: %d and %d are not adjacent", from_node, to_node);
446+
"in check_adjacent: %d and %d are not adjacent", from_node, to_node);
447447
}
448448
break;
449449

@@ -475,7 +475,7 @@ static bool check_adjacent(int from_node, int to_node) {
475475
num_adj += chanx_chany_adjacent(to_node, from_node);
476476
} else {
477477
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
478-
"in check_adjacent: %d and %d are not adjacent", from_node, to_node);
478+
"in check_adjacent: %d and %d are not adjacent", from_node, to_node);
479479
}
480480
break;
481481

vpr/src/route/clock_connection_builders.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ void RoutingToClockConnection::create_switches(const ClockRRGraphBuilder& clock_
4949
auto& rr_nodes = device_ctx.rr_nodes;
5050
auto& rr_node_indices = device_ctx.rr_node_indices;
5151

52-
int virtual_clock_network_root_idx =
53-
create_virtual_clock_network_sink_node(switch_location.x, switch_location.y);
52+
int virtual_clock_network_root_idx = create_virtual_clock_network_sink_node(switch_location.x, switch_location.y);
5453
device_ctx.virtual_clock_network_root_idx = virtual_clock_network_root_idx;
5554

5655
// rr_node indices for x and y channel routing wires and clock wires to connect to
@@ -86,8 +85,7 @@ void RoutingToClockConnection::create_switches(const ClockRRGraphBuilder& clock_
8685

8786
int RoutingToClockConnection::create_virtual_clock_network_sink_node(
8887
int x,
89-
int y)
90-
{
88+
int y) {
9189
auto& device_ctx = g_vpr_ctx.mutable_device();
9290
auto& rr_nodes = device_ctx.rr_nodes;
9391
rr_nodes.emplace_back();
@@ -104,7 +102,6 @@ int RoutingToClockConnection::create_virtual_clock_network_sink_node(
104102
return node_index;
105103
}
106104

107-
108105
/*
109106
* ClockToClockConneciton (setters)
110107
*/

vpr/src/route/route_common.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -801,17 +801,17 @@ void node_to_heap(int inode, float total_cost, int prev_node, int prev_edge, flo
801801

802802
void drop_traceback_tail(ClusterNetId net_id) {
803803
/* Removes the tail node from the routing traceback and updates
804-
it with the previous node from the traceback.
805-
This funtion is primarily called to remove the virtual clock
806-
sink from the routing traceback and replace it with the clock
807-
network root. */
804+
* it with the previous node from the traceback.
805+
* This funtion is primarily called to remove the virtual clock
806+
* sink from the routing traceback and replace it with the clock
807+
* network root. */
808808
auto& route_ctx = g_vpr_ctx.mutable_routing();
809809

810810
auto* tail_ptr = route_ctx.trace[net_id].tail;
811811
auto node = tail_ptr->index;
812812
route_ctx.trace_nodes[net_id].erase(node);
813813
auto* trace_ptr = route_ctx.trace[net_id].head;
814-
while (trace_ptr!= nullptr) {
814+
while (trace_ptr != nullptr) {
815815
t_trace* next_ptr = trace_ptr->next;
816816
if (next_ptr == tail_ptr) {
817817
trace_ptr->iswitch = tail_ptr->iswitch;

vpr/src/route/route_timing.cpp

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ static bool timing_driven_route_sink(ClusterNetId net_id,
147147
RouterStats& router_stats);
148148

149149
static bool timing_driven_pre_route_to_clock_root(
150-
ClusterNetId net_id,
151-
int sink_node,
152-
const t_conn_cost_params cost_params,
153-
float pres_fac,
154-
int high_fanout_threshold,
155-
t_rt_node* rt_root,
156-
const RouterLookahead& router_lookahead,
157-
SpatialRouteTreeLookup& spatial_rt_lookup,
158-
RouterStats& router_stats);
150+
ClusterNetId net_id,
151+
int sink_node,
152+
const t_conn_cost_params cost_params,
153+
float pres_fac,
154+
int high_fanout_threshold,
155+
t_rt_node* rt_root,
156+
const RouterLookahead& router_lookahead,
157+
SpatialRouteTreeLookup& spatial_rt_lookup,
158+
RouterStats& router_stats);
159159

160160
static t_heap* timing_driven_route_connection_from_route_tree_high_fanout(t_rt_node* rt_root,
161161
int sink_node,
@@ -1006,14 +1006,14 @@ bool timing_driven_route_net(ClusterNetId net_id,
10061006
cost_params.delay_budget = ((budgeting_inf.if_set()) ? &conn_delay_budget : nullptr);
10071007

10081008
// Pre-route to clock source for clock nets (marked as global nets)
1009-
if (cluster_ctx.clb_nlist.net_is_global(net_id) && router_opts.two_stage_clock_routing){
1009+
if (cluster_ctx.clb_nlist.net_is_global(net_id) && router_opts.two_stage_clock_routing) {
10101010
VTR_ASSERT(router_opts.clock_modeling == DEDICATED_NETWORK);
10111011
int sink_node = device_ctx.virtual_clock_network_root_idx;
10121012
enable_router_debug(router_opts, net_id, sink_node);
10131013
// Set to the max timing criticality which should intern minimize clock insertion
10141014
// delay by selecting a direct route from the clock source to the virtual sink
10151015
cost_params.criticality = router_opts.max_criticality;
1016-
if(!timing_driven_pre_route_to_clock_root(
1016+
if (!timing_driven_pre_route_to_clock_root(
10171017
net_id,
10181018
sink_node,
10191019
cost_params,
@@ -1083,16 +1083,15 @@ bool timing_driven_route_net(ClusterNetId net_id,
10831083
}
10841084

10851085
static bool timing_driven_pre_route_to_clock_root(
1086-
ClusterNetId net_id,
1087-
int sink_node,
1088-
const t_conn_cost_params cost_params,
1089-
float pres_fac,
1090-
int high_fanout_threshold,
1091-
t_rt_node* rt_root,
1092-
const RouterLookahead& router_lookahead,
1093-
SpatialRouteTreeLookup& spatial_rt_lookup,
1094-
RouterStats& router_stats) {
1095-
1086+
ClusterNetId net_id,
1087+
int sink_node,
1088+
const t_conn_cost_params cost_params,
1089+
float pres_fac,
1090+
int high_fanout_threshold,
1091+
t_rt_node* rt_root,
1092+
const RouterLookahead& router_lookahead,
1093+
SpatialRouteTreeLookup& spatial_rt_lookup,
1094+
RouterStats& router_stats) {
10961095
auto& route_ctx = g_vpr_ctx.mutable_routing();
10971096
auto& cluster_ctx = g_vpr_ctx.clustering();
10981097
auto& m_route_ctx = g_vpr_ctx.mutable_routing();
@@ -1171,10 +1170,10 @@ static bool timing_driven_pre_route_to_clock_root(
11711170
// - free up vitual sink occupancy
11721171
disable_expansion_and_remove_sink_from_route_tree_nodes(rt_root);
11731172
VTR_LOGV_DEBUG(f_router_debug, "Traceback tail before update %d \n",
1174-
route_ctx.trace[net_id].tail->index);
1173+
route_ctx.trace[net_id].tail->index);
11751174
drop_traceback_tail(net_id);
11761175
VTR_LOGV_DEBUG(f_router_debug, "Updated traceback ptrs: %d %d \n",
1177-
route_ctx.trace[net_id].head->index, route_ctx.trace[net_id].tail->index);
1176+
route_ctx.trace[net_id].head->index, route_ctx.trace[net_id].tail->index);
11781177
m_route_ctx.rr_node_route_inf[sink_node].set_occ(0);
11791178

11801179
// routed to a sink successfully
@@ -1765,7 +1764,7 @@ static t_rt_node* setup_routing_resources(int itry,
17651764
return rt_root;
17661765
}
17671766

1768-
void disable_expansion_and_remove_sink_from_route_tree_nodes(t_rt_node* rt_node){
1767+
void disable_expansion_and_remove_sink_from_route_tree_nodes(t_rt_node* rt_node) {
17691768
/* Remove sink in route tree and mark all nodes
17701769
* leading to the sink as unexpandable.
17711770
*/
@@ -1776,17 +1775,17 @@ void disable_expansion_and_remove_sink_from_route_tree_nodes(t_rt_node* rt_node)
17761775

17771776
while (linked_rt_edge != nullptr) {
17781777
child_node = linked_rt_edge->child;
1779-
if (device_ctx.rr_nodes[child_node->inode].type() == SINK){
1778+
if (device_ctx.rr_nodes[child_node->inode].type() == SINK) {
17801779
VTR_LOGV_DEBUG(f_router_debug,
1781-
"Removing sink %d from route tree\n", child_node->inode);
1780+
"Removing sink %d from route tree\n", child_node->inode);
17821781
rt_node->u.child_list = nullptr;
17831782
rt_node->u.next = nullptr;
17841783
free(child_node);
17851784
break;
17861785
} else {
17871786
rt_node->re_expand = false;
17881787
VTR_LOGV_DEBUG(f_router_debug,
1789-
"unexpanding: %d in route tree\n", rt_node->inode);
1788+
"unexpanding: %d in route tree\n", rt_node->inode);
17901789
}
17911790
disable_expansion_and_remove_sink_from_route_tree_nodes(child_node);
17921791
linked_rt_edge = linked_rt_edge->next;

0 commit comments

Comments
 (0)