Skip to content

Commit e70f43c

Browse files
add PlacementContext& arg to copy_locs_to_global_state && use pragma once in header files
1 parent 6193a77 commit e70f43c

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

vpr/src/place/place.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void try_place(const Netlist<>& net_list,
9898

9999
free_placement_structs();
100100

101-
placer.copy_locs_to_global_state();
101+
placer.copy_locs_to_global_state(place_ctx);
102102
}
103103

104104
static bool is_cube_bb(const e_place_bounding_box_mode place_bb_mode,

vpr/src/place/place_log_util.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

2-
#ifndef VTR_PLACE_LOG_UTIL_H
3-
#define VTR_PLACE_LOG_UTIL_H
2+
#pragma once
43

54
#include <cstddef>
65
#include <vector>
@@ -40,5 +39,3 @@ void generate_post_place_timing_reports(const t_placer_opts& placer_opts,
4039
const PlacementDelayCalculator& delay_calc,
4140
bool is_flat,
4241
const BlkLocRegistry& blk_loc_registry);
43-
44-
#endif //VTR_PLACE_LOG_UTIL_H

vpr/src/place/placer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,7 @@ void Placer::place() {
386386
log_printer_.print_post_placement_stats();
387387
}
388388

389-
void Placer::copy_locs_to_global_state() {
390-
auto& place_ctx = g_vpr_ctx.mutable_placement();
391-
389+
void Placer::copy_locs_to_global_state(PlacementContext& place_ctx) {
392390
// the placement location variables should be unlocked before being accessed
393391
place_ctx.unlock_loc_vars();
394392

vpr/src/place/placer.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11

2-
3-
#ifndef VTR_PLACER_H
4-
#define VTR_PLACER_H
2+
#pragma once
53

64
#include <memory>
75
#include <optional>
@@ -34,9 +32,10 @@ class Placer {
3432
void place();
3533

3634
/**
37-
* @brief Copies the placement location variables into the global placement context.
35+
* @brief Copies the placement location variables into the given global placement context.
36+
* @param place_ctx The placement context to which location information will be copied.
3837
*/
39-
void copy_locs_to_global_state();
38+
void copy_locs_to_global_state(PlacementContext& place_ctx);
4039

4140
/*
4241
* Getters
@@ -126,4 +125,3 @@ class Placer {
126125
int check_placement_costs_();
127126
};
128127

129-
#endif //VTR_PLACER_H

0 commit comments

Comments
 (0)