Skip to content

Commit c8be807

Browse files
doxygen comments for static function in place_macro.h
1 parent 121655c commit c8be807

File tree

2 files changed

+37
-23
lines changed

2 files changed

+37
-23
lines changed

vpr/src/place/place_macro.cpp

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,36 @@
1616
#include "globals.h"
1717
#include "echo_files.h"
1818

19+
/**
20+
* @brief Determines whether a cluster net is constant.
21+
* @param clb_net The unique id of a cluster net.
22+
* @return True if the net is constant; otherwise false.
23+
*/
1924
static bool is_constant_clb_net(ClusterNetId clb_net);
2025

26+
/**
27+
* @brief Performs a sanity check on macros by making sure that
28+
* each block appears in at most one macro.
29+
* @param macros All placement macros in the netlist.
30+
*/
2131
static void validate_macros(const std::vector<t_pl_macro>& macros);
2232

23-
static bool try_combine_macros(std::vector<std::vector<ClusterBlockId>>& pl_macro_member_blk_num, int matching_macro, int latest_macro);
33+
/**
34+
* @brief Tries to combine two placement macros.
35+
* @details This function takes two placement macro ids which have a common cluster block
36+
* or more in between. The function then tries to find if the two macros could be combined
37+
* to form a larger macro. If it's impossible to combine the two macros together then
38+
* this design will never place and route.
39+
*
40+
* @param pl_macro_member_blk_num [0..num_macros-1][0..num_cluster_blocks-1]
41+
* 2D array of macros created so far.
42+
* @param matching_macro first macro id, which is a previous macro that is found to have the same block
43+
* @param latest_macro second macro id, which is the macro being created at this iteration
44+
* @return True if combining two macros was successful; otherwise false.
45+
*/
46+
static bool try_combine_macros(std::vector<std::vector<ClusterBlockId>>& pl_macro_member_blk_num,
47+
int matching_macro,
48+
int latest_macro);
2449

2550
/* Go through all the ports in all the blocks to find the port that has the same *
2651
* name as port_name and belongs to the block type that has the name pb_type_name. *
@@ -39,9 +64,10 @@ static void mark_direct_of_ports(int idirect,
3964
std::vector<std::vector<int>>& direct_type_from_blk_pin,
4065
const PortPinToBlockPinConverter& port_pin_to_block_pin);
4166

42-
/* Mark the pin entry in idirect_from_blk_pin with idirect and the pin entry in *
43-
* direct_type_from_blk_pin with direct_type from start_pin_index to *
44-
* end_pin_index. */
67+
/**
68+
* @brief Mark the pin entry in idirect_from_blk_pin with idirect and the pin entry in
69+
* direct_type_from_blk_pin with direct_type from start_pin_index to end_pin_index.
70+
*/
4571
static void mark_direct_of_pins(int start_pin_index,
4672
int end_pin_index,
4773
int itype,
@@ -257,17 +283,9 @@ int PlaceMacros::find_all_the_macro_(std::vector<int>& pl_macro_idirect,
257283
return num_macro;
258284
}
259285

260-
static bool try_combine_macros(std::vector<std::vector<ClusterBlockId>>& pl_macro_member_blk_num, int matching_macro, int latest_macro) {
261-
/* This function takes two placement macro ids which have a common cluster block
262-
* or more in between. The function then tries to find if the two macros could
263-
* be combined together to form a larger macro. If it's impossible to combine
264-
* the two macros together then this design will never place and route.
265-
* Arguments:
266-
* pl_macro_member_blk_num : [0..num_macros-1][0..num_cluster_blocks-1] 2D array
267-
* of macros created so far.
268-
* matching_macro : first macro id, which is a previous macro that is found to have the same block
269-
* latest_macro : second macro id, which is the macro being created at this iteration */
270-
286+
static bool try_combine_macros(std::vector<std::vector<ClusterBlockId>>& pl_macro_member_blk_num,
287+
int matching_macro,
288+
int latest_macro) {
271289
auto& old_macro_blocks = pl_macro_member_blk_num[matching_macro];
272290
auto& new_macro_blocks = pl_macro_member_blk_num[latest_macro];
273291

@@ -501,10 +519,7 @@ static void mark_direct_of_pins(int start_pin_index,
501519
int line,
502520
std::string_view src_string,
503521
const PortPinToBlockPinConverter& port_pin_to_block_pin) {
504-
/* Mark the pin entry in idirect_from_blk_pin with idirect and the pin entry in *
505-
* direct_type_from_blk_pin with direct_type from start_pin_index to *
506-
* end_pin_index. */
507-
auto& device_ctx = g_vpr_ctx.device();
522+
const auto& device_ctx = g_vpr_ctx.device();
508523

509524
// Mark pins with indices from start_pin_index to end_pin_index, inclusive
510525
for (int iport_pin = start_pin_index; iport_pin <= end_pin_index; iport_pin++) {

vpr/src/place/place_macro.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@
125125
#include "physical_types.h"
126126
#include "vpr_types.h"
127127

128-
/* These are the placement macro structure.
129-
* It is in the form of array of structs instead of
130-
* structs of arrays for cache efficiency.
131-
* Could have more data members for other macro type.
128+
/**
129+
* @struct t_pl_macro_member
130+
* @brief The placement macro structure.
132131
*/
133132
struct t_pl_macro_member {
134133
///@brief The cluster_ctx.blocks index of this block.

0 commit comments

Comments
 (0)