Skip to content

Commit a2dc76c

Browse files
remove clock_fwd.h
1 parent 08507dc commit a2dc76c

File tree

6 files changed

+36
-46
lines changed

6 files changed

+36
-46
lines changed

vpr/src/route/route_utils.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "place_and_route.h"
1515
#include "route_common.h"
1616
#include "route_debug.h"
17+
#include "stats.h"
1718

1819
#include "VprTimingGraphResolver.h"
1920
#include "route_tree.h"
@@ -31,7 +32,7 @@ bool check_net_delays(const Netlist<>& net_list, NetPinsMatrix<float>& net_delay
3132

3233
load_net_delay_from_routing(net_list, net_delay_check);
3334

34-
for (auto net_id : net_list.nets()) {
35+
for (ParentNetId net_id : net_list.nets()) {
3536
for (size_t ipin = 1; ipin < net_list.net_pins(net_id).size(); ipin++) {
3637
if (net_delay_check[net_id][ipin] == 0.) { /* Should be only GLOBAL nets */
3738
if (fabs(net_delay[net_id][ipin]) > ERROR_TOL) {
@@ -77,7 +78,8 @@ bool check_net_delays(const Netlist<>& net_list, NetPinsMatrix<float>& net_delay
7778
//
7879
// Typically, only a small minority of nets (typically > 10%) have their BBs updated
7980
// each routing iteration.
80-
void dynamic_update_bounding_boxes(const std::vector<ParentNetId>& rerouted_nets, std::vector<ParentNetId> out_bb_updated_nets) {
81+
void dynamic_update_bounding_boxes(const std::vector<ParentNetId>& rerouted_nets,
82+
std::vector<ParentNetId> out_bb_updated_nets) {
8183
auto& device_ctx = g_vpr_ctx.device();
8284
auto& route_ctx = g_vpr_ctx.mutable_routing();
8385

vpr/src/route/rr_graph_generation/clock_connection_builders.cpp

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void RoutingToClockConnection::set_clock_switch_point_name(std::string clock_swi
2424
void RoutingToClockConnection::set_switch_location(int x, int y, int layer /* =0 */) {
2525
switch_location.x = x;
2626
switch_location.y = y;
27-
switch_location.layer = layer;
27+
switch_location.layer_num = layer;
2828
}
2929

3030
void RoutingToClockConnection::set_switch(int arch_switch_index) {
@@ -55,12 +55,12 @@ void RoutingToClockConnection::create_switches(const ClockRRGraphBuilder& clock_
5555
auto& rr_graph_builder = device_ctx.rr_graph_builder;
5656
const auto& node_lookup = device_ctx.rr_graph.node_lookup();
5757

58-
RRNodeId virtual_clock_network_root_idx = create_virtual_clock_network_sink_node(switch_location.layer, switch_location.x, switch_location.y);
58+
RRNodeId virtual_clock_network_root_idx = create_virtual_clock_network_sink_node(switch_location.layer_num, switch_location.x, switch_location.y);
5959
rr_graph_builder.set_virtual_clock_network_root_idx(virtual_clock_network_root_idx);
6060

6161
// rr_node indices for x and y channel routing wires and clock wires to connect to
62-
auto x_wire_indices = node_lookup.find_channel_nodes(switch_location.layer, switch_location.x, switch_location.y, e_rr_type::CHANX);
63-
auto y_wire_indices = node_lookup.find_channel_nodes(switch_location.layer, switch_location.x, switch_location.y, e_rr_type::CHANY);
62+
auto x_wire_indices = node_lookup.find_channel_nodes(switch_location.layer_num, switch_location.x, switch_location.y, e_rr_type::CHANX);
63+
auto y_wire_indices = node_lookup.find_channel_nodes(switch_location.layer_num, switch_location.x, switch_location.y, e_rr_type::CHANY);
6464
auto clock_indices = clock_graph.get_rr_node_indices_at_switch_location(
6565
clock_to_connect_to, switch_point_name, switch_location.x, switch_location.y);
6666

@@ -168,13 +168,12 @@ size_t ClockToClockConneciton::estimate_additional_nodes() {
168168
void ClockToClockConneciton::create_switches(const ClockRRGraphBuilder& clock_graph, t_rr_edge_info_set* rr_edges_to_create) {
169169
auto& grid = clock_graph.grid();
170170

171-
auto to_locations = clock_graph.get_switch_locations(to_clock, to_switch);
171+
std::set<std::pair<int, int>> to_locations = clock_graph.get_switch_locations(to_clock, to_switch);
172172

173-
for (auto location : to_locations) {
174-
auto x = location.first;
175-
auto y = location.second;
173+
for (auto [x, y] : to_locations) {
176174

177-
auto to_rr_node_indices = clock_graph.get_rr_node_indices_at_switch_location(
175+
176+
std::vector<int> to_rr_node_indices = clock_graph.get_rr_node_indices_at_switch_location(
178177
to_clock,
179178
to_switch,
180179
x,
@@ -257,20 +256,20 @@ void ClockToPinsConnection::create_switches(const ClockRRGraphBuilder& clock_gra
257256
continue;
258257
}
259258

260-
auto type = grid.get_physical_type({x, y, layer_num});
259+
t_physical_tile_type_ptr type = grid.get_physical_type({x, y, layer_num});
261260

262261
// Skip EMPTY type
263262
if (is_empty_type(type)) {
264263
continue;
265264
}
266265

267-
auto width_offset = grid.get_width_offset({x, y, layer_num});
268-
auto height_offset = grid.get_height_offset({x, y, layer_num});
266+
int width_offset = grid.get_width_offset({x, y, layer_num});
267+
int height_offset = grid.get_height_offset({x, y, layer_num});
269268

270269
// Ignore grid locations that do not have blocks
271270
bool has_pb_type = false;
272-
auto equivalent_sites = get_equivalent_sites_set(type);
273-
for (auto logical_block : equivalent_sites) {
271+
std::unordered_set<t_logical_block_type_ptr> equivalent_sites = get_equivalent_sites_set(type);
272+
for (t_logical_block_type_ptr logical_block : equivalent_sites) {
274273
if (logical_block->pb_type) {
275274
has_pb_type = true;
276275
break;
@@ -287,7 +286,7 @@ void ClockToPinsConnection::create_switches(const ClockRRGraphBuilder& clock_gra
287286
continue;
288287
}
289288

290-
for (auto clock_pin_idx : type->get_clock_pins_indices()) {
289+
for (int clock_pin_idx : type->get_clock_pins_indices()) {
291290
//Can't do anything if pin isn't at this location
292291
if (0 == type->pinloc[width_offset][height_offset][side][clock_pin_idx]) {
293292
continue;
@@ -308,14 +307,14 @@ void ClockToPinsConnection::create_switches(const ClockRRGraphBuilder& clock_gra
308307
clock_y_offset = -1; // pick the chanx below the block
309308
}
310309

311-
auto clock_pin_node_idx = node_lookup.find_node(layer_num,
312-
x,
313-
y,
314-
e_rr_type::IPIN,
315-
clock_pin_idx,
316-
side);
310+
RRNodeId clock_pin_node_idx = node_lookup.find_node(layer_num,
311+
x,
312+
y,
313+
e_rr_type::IPIN,
314+
clock_pin_idx,
315+
side);
317316

318-
auto clock_network_indices = clock_graph.get_rr_node_indices_at_switch_location(
317+
std::vector<int> clock_network_indices = clock_graph.get_rr_node_indices_at_switch_location(
319318
clock_to_connect_from,
320319
switch_point_name,
321320
x + clock_x_offset,

vpr/src/route/rr_graph_generation/clock_connection_builders.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
#include <string>
44

5-
#include "clock_fwd.h"
6-
5+
#include "physical_types.h"
76
#include "rr_graph2.h"
87
#include "rr_graph_clock.h"
98

@@ -34,7 +33,7 @@ class RoutingToClockConnection : public ClockConnection {
3433
private:
3534
std::string clock_to_connect_to;
3635
std::string switch_point_name;
37-
Coordinates switch_location;
36+
t_physical_tile_loc switch_location;
3837
int arch_switch_idx = OPEN;
3938
float fc = 0.;
4039

vpr/src/route/rr_graph_generation/clock_fwd.h

Lines changed: 0 additions & 7 deletions
This file was deleted.

vpr/src/route/rr_graph_generation/clock_network_builders.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include <string>
44
#include <vector>
55

6-
#include "clock_fwd.h"
7-
86
#include "vpr_types.h"
97

108
#include "rr_graph_builder.h"
@@ -63,14 +61,14 @@ struct SpineTaps {
6361

6462
struct HtreeDrive {
6563
std::string name;
66-
Coordinates offset;
64+
t_physical_tile_loc offset;
6765
int switch_idx = OPEN;
6866
};
6967

7068
struct HtreeTaps {
7169
std::string name;
72-
Coordinates offset;
73-
Coordinates increment;
70+
t_physical_tile_loc offset;
71+
t_physical_tile_loc increment;
7472
};
7573

7674
class ClockNetwork {

vpr/src/route/rr_graph_generation/rr_graph_clock.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <utility>
99

1010
#include "rr_graph_builder.h"
11-
#include "clock_fwd.h"
1211

1312
#include "clock_network_builders.h"
1413
#include "clock_connection_builders.h"
@@ -18,15 +17,15 @@ class ClockConnection;
1817
class t_rr_graph_storage;
1918

2019
class SwitchPoint {
21-
/* A switch point object: keeps information on the location and and rr_node indices
20+
/* A switch point object: keeps information on the location and rr_node indices
2221
* for a certain clock switch. clock connections are grouped with their own unique
2322
* name; this object holds information for only one such grouping.
2423
* Examples of SwitchPoint(s) are rib-to-spine, driver-to-spine. */
2524
public:
2625
// [grid_width][grid_height][0..nodes_at_this_location-1]
2726
std::vector<std::vector<std::vector<int>>> rr_node_indices;
2827
// Set of all the locations for this switch point. Used to quickly find
29-
// if the switch point exists at a certian location.
28+
// if the switch point exists at a certain location.
3029
std::set<std::pair<int, int>> locations; // x,y
3130
public:
3231
/** Accessors **/
@@ -50,7 +49,7 @@ class SwitchPoints {
5049

5150
/* Example: x,y = middle of the chip, switch_point_name == name of main drive
5251
* of global clock spine, returns the rr_nodes of all the clock spines that
53-
* start the newtork there*/
52+
* start the network there*/
5453
std::vector<int> get_rr_node_indices_at_location(std::string switch_point_name,
5554
int x,
5655
int y) const;
@@ -70,7 +69,7 @@ class ClockRRGraphBuilder {
7069
int get_and_increment_chany_ptc_num();
7170

7271
/* Reverse lookup for to find the clock source and tap locations for each clock_network
73-
* The map key is the the clock network name and value are all the switch points*/
72+
* The map key is the clock network name and value are all the switch points*/
7473
std::unordered_map<std::string, SwitchPoints> clock_name_to_switch_points;
7574

7675
public:
@@ -113,7 +112,7 @@ class ClockRRGraphBuilder {
113112
static size_t estimate_additional_nodes(const DeviceGrid& grid);
114113

115114
/* AA: map the segment indices in all networks to corresponding indices in axis based segment vectors as defined in build_rr_graph
116-
* Reffer to clock_network_builders.h: map_relative_seg_indices*/
115+
* Refer to clock_network_builders.h: map_relative_seg_indices*/
117116

118117
static void map_relative_seg_indices(const t_unified_to_parallel_seg_index& indices_map);
119118

@@ -132,7 +131,7 @@ class ClockRRGraphBuilder {
132131
bool edge_remapped) const;
133132

134133
public:
135-
/* Creates the routing resourse (rr) graph of the clock network and appends it to the
134+
/* Creates the routing resource (rr) graph of the clock network and appends it to the
136135
* existing rr graph created in build_rr_graph for inter-block and intra-block routing. */
137136
void create_and_append_clock_rr_graph(int num_segments_x,
138137
t_rr_edge_info_set* rr_edges_to_create);

0 commit comments

Comments
 (0)