Skip to content

Commit a7c203c

Browse files
rename PlaceLocVars to BlkLocRegistry
1 parent 7bb781b commit a7c203c

34 files changed

+121
-121
lines changed

vpr/src/base/read_place.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ static void read_place_header(std::ifstream& placement_file,
2222
const DeviceGrid& grid);
2323

2424
static std::string read_place_body(std::ifstream& placement_file,
25-
PlaceLocVars& place_loc_vars,
25+
BlkLocRegistry& place_loc_vars,
2626
const char* place_file,
2727
bool is_place_file);
2828

2929
std::string read_place(const char* net_file,
3030
const char* place_file,
31-
PlaceLocVars& place_loc_vars,
31+
BlkLocRegistry& place_loc_vars,
3232
bool verify_file_digests,
3333
const DeviceGrid& grid) {
3434
std::ifstream fstream(place_file);
@@ -53,7 +53,7 @@ std::string read_place(const char* net_file,
5353
}
5454

5555
void read_constraints(const char* constraints_file,
56-
PlaceLocVars& place_loc_vars) {
56+
BlkLocRegistry& place_loc_vars) {
5757
std::ifstream fstream(constraints_file);
5858
if (!fstream) {
5959
VPR_FATAL_ERROR(VPR_ERROR_PLACE_F,
@@ -206,7 +206,7 @@ static void read_place_header(std::ifstream& placement_file,
206206
* or a constraints file (is_place_file = false).
207207
*/
208208
static std::string read_place_body(std::ifstream& placement_file,
209-
PlaceLocVars& place_loc_vars,
209+
BlkLocRegistry& place_loc_vars,
210210
const char* place_file,
211211
bool is_place_file) {
212212
auto& cluster_ctx = g_vpr_ctx.clustering();

vpr/src/base/read_place.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ struct t_block_loc;
1717
*/
1818
std::string read_place(const char* net_file,
1919
const char* place_file,
20-
PlaceLocVars& place_loc_vars,
20+
BlkLocRegistry& place_loc_vars,
2121
bool verify_file_hashes,
2222
const DeviceGrid& grid);
2323

2424
/**
2525
* This function is used to read a constraints file that specifies the desired locations of blocks.
2626
*/
2727
void read_constraints(const char* constraints_file,
28-
PlaceLocVars& place_loc_vars);
28+
BlkLocRegistry& place_loc_vars);
2929

3030
/**
3131
* This function prints out a place file.

vpr/src/base/vpr_context.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ struct PlacementContext : public Context {
396396
* @brief Stores block location information, which is subject to change during the
397397
* placement stage.
398398
*/
399-
PlaceLocVars place_loc_vars_;
399+
BlkLocRegistry place_loc_vars_;
400400

401401
public:
402402

@@ -406,8 +406,8 @@ struct PlacementContext : public Context {
406406
GridBlock& get_mutable_grid_blocks() { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return place_loc_vars_.mutable_grid_blocks(); }
407407
vtr::vector_map<ClusterPinId, int>& mutable_physical_pins() { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return place_loc_vars_.mutable_physical_pins(); }
408408
const vtr::vector_map<ClusterPinId, int>& physical_pins() const { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return place_loc_vars_.physical_pins(); }
409-
PlaceLocVars& mutable_place_loc_vars() { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return place_loc_vars_; }
410-
const PlaceLocVars& place_loc_vars() const { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return place_loc_vars_; }
409+
BlkLocRegistry& mutable_place_loc_vars() { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return place_loc_vars_; }
410+
const BlkLocRegistry& place_loc_vars() const { VTR_ASSERT_SAFE(loc_vars_are_accessible_); return place_loc_vars_; }
411411

412412
/**
413413
* @brief Makes place_loc_vars_ inaccessible through the getter methods.

vpr/src/base/vpr_types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ void t_cluster_placement_stats::free_primitives() {
559559
}
560560
}
561561

562-
int PlaceLocVars::net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index) const {
562+
int BlkLocRegistry::net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index) const {
563563
auto& cluster_ctx = g_vpr_ctx.clustering();
564564

565565
// Get the logical pin index of pin within its logical block type

vpr/src/base/vpr_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ class GridBlock {
907907
vtr::NdMatrix<t_grid_blocks, 3> grid_blocks_;
908908
};
909909

910-
class PlaceLocVars {
910+
class BlkLocRegistry {
911911
private:
912912
///@brief Clustered block placement locations
913913
vtr::vector_map<ClusterBlockId, t_block_loc> block_locs_;

vpr/src/draw/draw.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ void free_draw_structs() {
570570
#endif /* NO_GRAPHICS */
571571
}
572572

573-
void init_draw_coords(float width_val, const PlaceLocVars& place_loc_vars) {
573+
void init_draw_coords(float width_val, const BlkLocRegistry& place_loc_vars) {
574574
#ifndef NO_GRAPHICS
575575
/* Load the arrays containing the left and bottom coordinates of the clbs *
576576
* forming the FPGA. tile_width_val sets the width and height of a drawn *

vpr/src/draw/draw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
4646

4747
//Initializes the drawing locations.
4848
//FIXME: Currently broken if no rr-graph is loaded
49-
void init_draw_coords(float clb_width, const PlaceLocVars& place_loc_vars);
49+
void init_draw_coords(float clb_width, const BlkLocRegistry& place_loc_vars);
5050

5151
/* Sets the static show_graphics and gr_automode variables to the *
5252
* desired values. They control if graphics are enabled and, if so, *

vpr/src/draw/draw_global.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static t_draw_coords draw_coords;
2929
/**
3030
* @brief Stores a reference to a PlaceLocVars to be used in the graphics code.
3131
*/
32-
static std::optional<std::reference_wrapper<const PlaceLocVars>> place_loc_vars_ref;
32+
static std::optional<std::reference_wrapper<const BlkLocRegistry>> place_loc_vars_ref;
3333

3434
/*********************** Accessor Subroutines Definition ********************/
3535

@@ -45,11 +45,11 @@ t_draw_state* get_draw_state_vars() {
4545
return &draw_state;
4646
}
4747

48-
void set_graphics_place_loc_vars_ref(const PlaceLocVars& place_loc_vars) {
48+
void set_graphics_place_loc_vars_ref(const BlkLocRegistry& place_loc_vars) {
4949
place_loc_vars_ref = std::ref(place_loc_vars);
5050
}
5151

52-
const PlaceLocVars& get_graphics_place_loc_vars_ref() {
52+
const BlkLocRegistry& get_graphics_place_loc_vars_ref() {
5353
return place_loc_vars_ref->get();
5454
}
5555

vpr/src/draw/draw_global.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ t_draw_state* get_draw_state_vars();
3737
*
3838
* @param place_loc_vars The PlaceLocVars that the reference will point to.
3939
*/
40-
void set_graphics_place_loc_vars_ref(const PlaceLocVars& place_loc_vars);
40+
void set_graphics_place_loc_vars_ref(const BlkLocRegistry& place_loc_vars);
4141

4242
/**
4343
* @brief Returns the reference to placement block location variables.
4444
* @return A const reference to placement block location variables.
4545
*/
46-
const PlaceLocVars& get_graphics_place_loc_vars_ref();
46+
const BlkLocRegistry& get_graphics_place_loc_vars_ref();
4747

4848
#endif // NO_GRAPHICS
4949

vpr/src/draw/draw_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ struct t_draw_coords {
397397

398398
private:
399399
float tile_width;
400-
friend void init_draw_coords(float width_val, const PlaceLocVars& place_loc_vars);
400+
friend void init_draw_coords(float width_val, const BlkLocRegistry& place_loc_vars);
401401
};
402402

403403
#endif // NO_GRAPHICS

vpr/src/place/analytic_placer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ constexpr int HEAP_STALLED_ITERATIONS_STOP = 15;
129129
* Placement & device info is accessed via g_vpr_ctx
130130
*/
131131

132-
AnalyticPlacer::AnalyticPlacer(PlaceLocVars& place_loc_vars)
132+
AnalyticPlacer::AnalyticPlacer(BlkLocRegistry& place_loc_vars)
133133
: placer_loc_vars_ref_(place_loc_vars) {
134134
//Eigen::initParallel();
135135

vpr/src/place/analytic_placer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class AnalyticPlacer {
123123
* To tune these parameters, change directly in constructor
124124
*/
125125
AnalyticPlacer() = delete;
126-
explicit AnalyticPlacer(PlaceLocVars& place_loc_vars);
126+
explicit AnalyticPlacer(BlkLocRegistry& place_loc_vars);
127127

128128
/*
129129
* @brief main function of analytic placement
@@ -182,7 +182,7 @@ class AnalyticPlacer {
182182
vtr::vector_map<ClusterBlockId, BlockLocation> blk_locs;
183183

184184
// reference to the placement location variables
185-
PlaceLocVars& placer_loc_vars_ref_;
185+
BlkLocRegistry& placer_loc_vars_ref_;
186186

187187
/*
188188
* The set of blks of different types to be placed by AnalyticPlacement process,

vpr/src/place/directed_moves_util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "centroid_move_generator.h"
44

55
t_physical_tile_loc get_coordinate_of_pin(ClusterPinId pin,
6-
const PlaceLocVars& place_loc_vars) {
6+
const BlkLocRegistry& place_loc_vars) {
77
const auto& device_ctx = g_vpr_ctx.device();
88
const auto& grid = device_ctx.grid;
99
const auto& cluster_ctx = g_vpr_ctx.clustering();
@@ -29,7 +29,7 @@ void calculate_centroid_loc(ClusterBlockId b_from,
2929
const PlacerCriticalities* criticalities,
3030
bool noc_attraction_enabled,
3131
float noc_attraction_weight,
32-
const PlaceLocVars& place_loc_vars) {
32+
const BlkLocRegistry& place_loc_vars) {
3333
const auto& cluster_ctx = g_vpr_ctx.clustering();
3434
const auto& block_locs = place_loc_vars.block_locs();
3535

vpr/src/place/directed_moves_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ e_reward_function string_to_reward(const std::string& st);
1818

1919
///@brief Helper function that returns the x, y coordinates of a pin
2020
t_physical_tile_loc get_coordinate_of_pin(ClusterPinId pin,
21-
const PlaceLocVars& place_loc_vars);
21+
const BlkLocRegistry& place_loc_vars);
2222

2323
/**
2424
* @brief Calculates the exact centroid location
@@ -48,13 +48,13 @@ void calculate_centroid_loc(ClusterBlockId b_from,
4848
const PlacerCriticalities* criticalities,
4949
bool noc_attraction_enabled,
5050
float noc_attraction_weight,
51-
const PlaceLocVars& place_loc_vars);
51+
const BlkLocRegistry& place_loc_vars);
5252

5353
inline void calculate_centroid_loc(ClusterBlockId b_from,
5454
bool timing_weights,
5555
t_pl_loc& centroid,
5656
const PlacerCriticalities* criticalities,
57-
const PlaceLocVars& place_loc_vars) {
57+
const BlkLocRegistry& place_loc_vars) {
5858
calculate_centroid_loc(b_from, timing_weights, centroid, criticalities, false, 0.0f, place_loc_vars);
5959
}
6060

vpr/src/place/initial_noc_placement.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static bool accept_noc_swap(double delta_cost, double prob);
3535
* filled with the location where pl_macro is placed.
3636
*/
3737
static void place_constrained_noc_router(ClusterBlockId router_blk_id,
38-
PlaceLocVars& place_loc_vars);
38+
BlkLocRegistry& place_loc_vars);
3939

4040
/**
4141
* @brief Randomly places unconstrained NoC routers.
@@ -48,7 +48,7 @@ static void place_constrained_noc_router(ClusterBlockId router_blk_id,
4848
*/
4949
static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_routers,
5050
int seed,
51-
PlaceLocVars& place_loc_vars);
51+
BlkLocRegistry& place_loc_vars);
5252

5353
/**
5454
* @brief Runs a simulated annealing optimizer for NoC routers.
@@ -58,7 +58,7 @@ static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_rout
5858
* To be filled with the location where pl_macro is placed.
5959
*/
6060
static void noc_routers_anneal(const t_noc_opts& noc_opts,
61-
PlaceLocVars& place_loc_vars);
61+
BlkLocRegistry& place_loc_vars);
6262

6363
static bool accept_noc_swap(double delta_cost, double prob) {
6464
if (delta_cost <= 0.0) {
@@ -78,7 +78,7 @@ static bool accept_noc_swap(double delta_cost, double prob) {
7878
}
7979

8080
static void place_constrained_noc_router(ClusterBlockId router_blk_id,
81-
PlaceLocVars& place_loc_vars) {
81+
BlkLocRegistry& place_loc_vars) {
8282
auto& cluster_ctx = g_vpr_ctx.clustering();
8383
const auto& floorplanning_ctx = g_vpr_ctx.floorplanning();
8484

@@ -108,7 +108,7 @@ static void place_constrained_noc_router(ClusterBlockId router_blk_id,
108108

109109
static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_routers,
110110
int seed,
111-
PlaceLocVars& place_loc_vars) {
111+
BlkLocRegistry& place_loc_vars) {
112112
const auto& compressed_grids = g_vpr_ctx.placement().compressed_block_grids;
113113
const auto& noc_ctx = g_vpr_ctx.noc();
114114
const auto& cluster_ctx = g_vpr_ctx.clustering();
@@ -180,7 +180,7 @@ static void place_noc_routers_randomly(std::vector<ClusterBlockId>& unfixed_rout
180180
}
181181

182182
static void noc_routers_anneal(const t_noc_opts& noc_opts,
183-
PlaceLocVars& place_loc_vars) {
183+
BlkLocRegistry& place_loc_vars) {
184184
auto& noc_ctx = g_vpr_ctx.noc();
185185
const auto& block_locs = place_loc_vars.block_locs();
186186

@@ -272,7 +272,7 @@ static void noc_routers_anneal(const t_noc_opts& noc_opts,
272272

273273
void initial_noc_placement(const t_noc_opts& noc_opts,
274274
const t_placer_opts& placer_opts,
275-
PlaceLocVars& place_loc_vars) {
275+
BlkLocRegistry& place_loc_vars) {
276276
vtr::ScopedStartFinishTimer timer("Initial NoC Placement");
277277
auto& noc_ctx = g_vpr_ctx.noc();
278278
const auto& block_locs = place_loc_vars.block_locs();

vpr/src/place/initial_noc_placment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
*/
1717
void initial_noc_placement(const t_noc_opts& noc_opts,
1818
const t_placer_opts& placer_opts,
19-
PlaceLocVars& place_loc_vars);
19+
BlkLocRegistry& place_loc_vars);
2020

2121
#endif //VTR_INITIAL_NOC_PLACMENT_H

0 commit comments

Comments
 (0)