Skip to content

Commit 5a141a0

Browse files
[Infra] Updated Header Files Based on Comments
Moved to pragma once symantics and cleaned up some less than ideal code.
1 parent 93aba7c commit 5a141a0

6 files changed

+10
-24
lines changed

vpr/src/route/multi_queue_d_ary_heap.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
* Modified: February 2025
1818
********************************************************************/
1919

20-
#ifndef _MULTI_QUEUE_D_ARY_HEAP_H
21-
#define _MULTI_QUEUE_D_ARY_HEAP_H
20+
#pragma once
2221

2322
#include "device_grid.h"
2423
#include "heap_type.h"
@@ -129,5 +128,3 @@ class MultiQueueDAryHeap {
129128
private:
130129
std::unique_ptr<MQ_IO> pq_;
131130
};
132-
133-
#endif

vpr/src/route/route_path_manager.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _PATH_MANAGER_H
2-
#define _PATH_MANAGER_H
1+
#pragma once
32

43
#include "rr_graph_fwd.h"
54

@@ -113,5 +112,3 @@ class PathManager {
113112
// Required by RCV so the router doesn't expand already visited nodes
114113
std::set<RRNodeId> route_tree_nodes_;
115114
};
116-
117-
#endif

vpr/src/route/route_utilization.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef VPR_ROUTE_UTIL_H
2-
#define VPR_ROUTE_UTIL_H
1+
#pragma once
32

43
#include "rr_node_types.h"
54
#include "vtr_ndmatrix.h"
@@ -17,5 +16,3 @@ vtr::Matrix<float> calculate_routing_avail(e_rr_type rr_type);
1716
*/
1817
vtr::Matrix<float> calculate_routing_usage(e_rr_type rr_type, bool is_flat, bool is_print);
1918
float routing_util(float used, float avail);
20-
21-
#endif

vpr/src/route/route_utils.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "route_debug.h"
1717

1818
#include "VprTimingGraphResolver.h"
19+
#include "route_tree.h"
1920
#include "rr_graph.h"
2021
#include "tatum/TimingReporter.hpp"
2122

@@ -525,7 +526,7 @@ size_t calculate_wirelength_available() {
525526

526527
size_t available_wirelength = 0;
527528
// But really what's happening is that this for loop iterates over every node and determines the available wirelength
528-
for (const RRNodeId& rr_id : device_ctx.rr_graph.nodes()) {
529+
for (RRNodeId rr_id : device_ctx.rr_graph.nodes()) {
529530
const e_rr_type channel_type = rr_graph.node_type(rr_id);
530531
if (channel_type == e_rr_type::CHANX || channel_type == e_rr_type::CHANY) {
531532
available_wirelength += rr_graph.node_capacity(rr_id) * rr_graph.node_length(rr_id);
@@ -586,7 +587,7 @@ t_bb calc_current_bb(const RouteTree& tree) {
586587
bb.ymax = 0;
587588
bb.layer_max = 0;
588589

589-
for (auto& rt_node : tree.all_nodes()) {
590+
for (const RouteTreeNode& rt_node : tree.all_nodes()) {
590591
//The router interprets RR nodes which cross the boundary as being
591592
//'within' of the BB. Only those which are *strictly* out side the
592593
//box are excluded, hence we use the nodes xhigh/yhigh for xmin/xmax,
@@ -615,7 +616,7 @@ void init_net_delay_from_lookahead(const RouterLookahead& router_lookahead,
615616
t_conn_cost_params cost_params;
616617
cost_params.criticality = 1.; // Ensures lookahead returns delay value
617618

618-
for (auto net_id : net_list.nets()) {
619+
for (ParentNetId net_id : net_list.nets()) {
619620
if (net_list.net_is_ignored(net_id)) continue;
620621

621622
RRNodeId source_rr = net_rr_terminals[net_id][0];
@@ -627,7 +628,7 @@ void init_net_delay_from_lookahead(const RouterLookahead& router_lookahead,
627628
rr_graph,
628629
source_rr,
629630
sink_rr,
630-
0.,
631+
0.0f /* R_upstream */,
631632
cost_params,
632633
is_flat);
633634
VTR_ASSERT(std::isfinite(est_delay) && est_delay < std::numeric_limits<float>::max());

vpr/src/route/router_delay_profiling.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef ROUTER_DELAY_PROFILING_H_
2-
#define ROUTER_DELAY_PROFILING_H_
1+
#pragma once
32

43
#include "d_ary_heap.h"
54
#include "netlist.h"
@@ -63,5 +62,3 @@ void alloc_routing_structs(const t_chan_width& chan_width,
6362
bool is_flat);
6463

6564
void free_routing_structs();
66-
67-
#endif /* ROUTER_DELAY_PROFILING_H_ */

vpr/src/route/spatial_route_tree_lookup.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef VPR_SPATIAL_ROUTE_TREE_LOOKUP_H
2-
#define VPR_SPATIAL_ROUTE_TREE_LOOKUP_H
1+
#pragma once
32

43
#include <vector>
54

@@ -23,5 +22,3 @@ size_t grid_to_bin_x(size_t grid_x, const SpatialRouteTreeLookup& spatial_lookup
2322
size_t grid_to_bin_y(size_t grid_y, const SpatialRouteTreeLookup& spatial_lookup);
2423

2524
bool validate_route_tree_spatial_lookup(const RouteTreeNode& rt_node, const SpatialRouteTreeLookup& spatial_lookup);
26-
27-
#endif

0 commit comments

Comments
 (0)