Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
soheilshahrouz committed Jul 29, 2024
1 parent da61fdb commit 25e803c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ class PlaceLocVars {
inline int tile_pin_index(const ClusterPinId pin) const { return physical_pins_[pin]; }

///@brief Returns the physical pin of the tile, related to the given ClusterNedId, and the net pin index.
inline int net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index) const;
int net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index) const;
};

///@brief Names of various files
Expand Down
14 changes: 14 additions & 0 deletions vpr/src/draw/draw_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,22 @@ t_draw_coords* get_draw_coords_vars();

t_draw_state* get_draw_state_vars();

/**
* @brief Set the reference to placement location variable.
*
* During the placement stage, this reference should point to a local object
* in the placement stage because the placement stage does not change the
* global stage in place_ctx until the end of placement. After the placement is
* done, the reference should point to the global state stored in place_ctx.
*
* @param place_loc_vars The PlaceLocVars that the reference will point to.
*/
void set_graphics_place_loc_vars_ref(const PlaceLocVars& place_loc_vars);

/**
* @brief Returns the reference to placement block location variables.
* @return A const reference to placement block location variables.
*/
const PlaceLocVars& get_graphics_place_loc_vars_ref();

#endif // NO_GRAPHICS
Expand Down
3 changes: 1 addition & 2 deletions vpr/src/draw/draw_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
*******************************************/
ezgl::color t_draw_state::block_color(ClusterBlockId blk) const {
if (use_default_block_color_[blk]) {

auto& cluster_ctx = g_vpr_ctx.clustering();
auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();
const auto& block_locs = get_graphics_place_loc_vars_ref().block_locs();

t_physical_tile_type_ptr tile_type = nullptr;
if (block_locs.empty()) { //No placement, pick best match
Expand Down
13 changes: 11 additions & 2 deletions vpr/src/place/RL_agent_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ enum class e_agent_state {
* This function creates 2 move generators to be used by the annealer. The type of the move generators created here depends on the
* type selected in placer_opts.
* It returns a unique pointer for each move generator in move_generator and move_generator2
* move_lim: represents the num of moves per temp.
*
* @param placer_ctx Move generators store a reference to the placer context to avoid global state access.
* @param placer_opts Contains information about the placement algorithm and its parameters.
* @param move_lim represents the num of moves per temp.
* @param noc_attraction_weight The attraction weight by which the NoC-biased centroid move adjust the computed location
* towards reachable NoC routers from the moving block.
*
* @return Two unique pointers referring to move generators. These move generators are supposed to be used
* in the first and second states of the agent.
*
*/
std::pair<std::unique_ptr<MoveGenerator>, std::unique_ptr<MoveGenerator>> create_move_generators(PlacerContext& placer_ctx,
const t_placer_opts& placer_opts,
Expand All @@ -33,7 +42,7 @@ void assign_current_move_generator(std::unique_ptr<MoveGenerator>& move_generato
std::unique_ptr<MoveGenerator>& current_move_generator);

/**
* @ brief move the updated current_move_generator to its original move_Generator structure based on he placer_options and the agent state
* @brief move the updated current_move_generator to its original move_Generator structure based on he placer_options and the agent state
*/
void update_move_generator(std::unique_ptr<MoveGenerator>& move_generator,
std::unique_ptr<MoveGenerator>& move_generator2,
Expand Down

0 comments on commit 25e803c

Please sign in to comment.