Skip to content

Commit 0a6ce4d

Browse files
rw1nklerkmurray
authored andcommitted
Change API comments in VPR base to doxygen style
This commit changes the style of code comments in vpr/src/base to doxygen compatible. The changes allow for using the source files for generating Sphinx API documentation. Signed-off-by: Robert Winkler <[email protected]>
1 parent 6b5bf65 commit 0a6ce4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1907
-1321
lines changed

vpr/src/base/SetupGrid.cpp

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*
2-
* Author: Jason Luu
3-
* Date: October 8, 2008
4-
*
5-
* Initializes and allocates the physical logic block grid for VPR.
1+
/**
2+
* @file
3+
* @author Jason Luu
4+
* @date October 8, 2008
65
*
6+
* @brief Initializes and allocates the physical logic block grid for VPR.
77
*/
88

99
#include <cstdio>
@@ -36,7 +36,7 @@ static void CheckGrid(const DeviceGrid& grid);
3636

3737
static void set_grid_block_type(int priority, const t_physical_tile_type* type, size_t x_root, size_t y_root, vtr::Matrix<t_grid_tile>& grid, vtr::Matrix<int>& grid_priorities, const t_metadata_dict* meta);
3838

39-
//Create the device grid based on resource requirements
39+
///@brief Create the device grid based on resource requirements
4040
DeviceGrid create_device_grid(std::string layout_name, const std::vector<t_grid_def>& grid_layouts, const std::map<t_logical_block_type_ptr, size_t>& minimum_instance_counts, float target_device_utilization) {
4141
if (layout_name == "auto") {
4242
//Auto-size the device
@@ -68,7 +68,7 @@ DeviceGrid create_device_grid(std::string layout_name, const std::vector<t_grid_
6868
}
6969
}
7070

71-
//Create the device grid based on dimensions
71+
///@brief Create the device grid based on dimensions
7272
DeviceGrid create_device_grid(std::string layout_name, const std::vector<t_grid_def>& grid_layouts, size_t width, size_t height) {
7373
if (layout_name == "auto") {
7474
VTR_ASSERT(grid_layouts.size() > 0);
@@ -129,9 +129,12 @@ DeviceGrid create_device_grid(std::string layout_name, const std::vector<t_grid_
129129
}
130130
}
131131

132-
//Create a device grid which satisfies the minimum block counts
133-
// If a set of fixed grid layouts are specified, the smallest satisfying grid is picked
134-
// If an auto grid layouts are specified, the smallest dynamicly sized grid is picked
132+
/**
133+
* @brief Create a device grid which satisfies the minimum block counts
134+
*
135+
* If a set of fixed grid layouts are specified, the smallest satisfying grid is picked
136+
* If an auto grid layouts are specified, the smallest dynamicly sized grid is picked
137+
*/
135138
static DeviceGrid auto_size_device_grid(const std::vector<t_grid_def>& grid_layouts, const std::map<t_logical_block_type_ptr, size_t>& minimum_instance_counts, float maximum_device_utilization) {
136139
VTR_ASSERT(grid_layouts.size() > 0);
137140

@@ -223,11 +226,14 @@ static DeviceGrid auto_size_device_grid(const std::vector<t_grid_def>& grid_layo
223226
return grid; //Unreachable
224227
}
225228

229+
/**
230+
* @brief Estimates what logical block types will be unimplementable due to resource
231+
* limits in the available grid
232+
*
233+
* Performs a fast counting based estimate, allocating the least
234+
* flexible block types (those with the fewestequivalent tiles) first.
235+
*/
226236
static std::vector<t_logical_block_type_ptr> grid_overused_resources(const DeviceGrid& grid, std::map<t_logical_block_type_ptr, size_t> instance_counts) {
227-
//Estimates what logical block types will be unimplementable due to resource limits in the available grid
228-
//
229-
//Performs a fast counting based estimate, allocating the least flexible block types (those with the fewest
230-
//equivalent tiles) first.
231237
auto& device_ctx = g_vpr_ctx.device();
232238

233239
std::vector<t_logical_block_type_ptr> overused_resources;
@@ -299,7 +305,7 @@ static bool grid_satisfies_instance_counts(const DeviceGrid& grid, std::map<t_lo
299305
return true; //OK
300306
}
301307

302-
//Build the specified device grid
308+
///@brief Build the specified device grid
303309
static DeviceGrid build_device_grid(const t_grid_def& grid_def, size_t grid_width, size_t grid_height, bool warn_out_of_range, const std::vector<t_logical_block_type_ptr> limiting_resources) {
304310
if (grid_def.grid_type == GridDefType::FIXED) {
305311
if (grid_def.width != int(grid_width) || grid_def.height != int(grid_height)) {
@@ -630,8 +636,8 @@ static void set_grid_block_type(int priority, const t_physical_tile_type* type,
630636
}
631637
}
632638

639+
///@brief Check grid is valid
633640
static void CheckGrid(const DeviceGrid& grid) {
634-
/* Check grid is valid */
635641
for (size_t i = 0; i < grid.width(); ++i) {
636642
for (size_t j = 0; j < grid.height(); ++j) {
637643
auto type = grid[i][j].type;

vpr/src/base/SetupGrid.h

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
#ifndef SETUPGRID_H
22
#define SETUPGRID_H
33

4-
/*
5-
* Author: Jason Luu
6-
* Date: October 8, 2008
7-
*
8-
* Initializes and allocates the physical logic block grid for VPR.
4+
/**
5+
* @file
6+
* @author Jason Luu
7+
* @date October 8, 2008
98
*
9+
* @brief Initializes and allocates the physical logic block grid for VPR.
1010
*/
11+
1112
#include <vector>
1213
#include "physical_types.h"
1314

14-
//Find the device satisfying the specified minimum resources
15+
///@brief Find the device satisfying the specified minimum resources
1516
DeviceGrid create_device_grid(std::string layout_name,
1617
const std::vector<t_grid_def>& grid_layouts,
1718
const std::map<t_logical_block_type_ptr, size_t>& minimum_instance_counts,
1819
float target_device_utilization);
1920

20-
//Find the device close in size to the specified dimensions
21+
///@brief Find the device close in size to the specified dimensions
2122
DeviceGrid create_device_grid(std::string layout_name, const std::vector<t_grid_def>& grid_layouts, size_t min_width, size_t min_height);
2223

23-
//Calculate the device utilization (i.e. fraction of used grid tiles) for the specified grid and resource requirements
24+
/**
25+
* @brief Calculate the device utilization
26+
*
27+
* Calculate the device utilization (i.e. fraction of used grid tiles)
28+
* foor the specified grid and resource requirements
29+
*/
2430
float calculate_device_utilization(const DeviceGrid& grid, std::map<t_logical_block_type_ptr, size_t> instance_counts);
2531

26-
//Returns the effective size of the device (size of the bounding box of non-empty grid tiles)
32+
/**
33+
* @brief Returns the effective size of the device
34+
* (size of the bounding box of non-empty grid tiles)
35+
*/
2736
size_t count_grid_tiles(const DeviceGrid& grid);
2837

2938
#endif

vpr/src/base/SetupVPR.cpp

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ static void SetupAnalysisOpts(const t_options& Options, t_analysis_opts& analysi
4343
static void SetupPowerOpts(const t_options& Options, t_power_opts* power_opts, t_arch* Arch);
4444
static int find_ipin_cblock_switch_index(const t_arch& Arch);
4545

46-
/* Sets VPR parameters and defaults. Does not do any error checking
47-
* as this should have been done by the various input checkers */
46+
/**
47+
* @brief Sets VPR parameters and defaults.
48+
*
49+
* Does not do any error checking as this should have been done by
50+
* the various input checkers
51+
*/
4852
void SetupVPR(const t_options* Options,
4953
const bool TimingEnabled,
5054
const bool readArchFile,
@@ -253,8 +257,10 @@ static void SetupTiming(const t_options& Options, const bool TimingEnabled, t_ti
253257
Timing->SDCFile = Options.SDCFile;
254258
}
255259

256-
/* This loads up VPR's arch_switch_inf data by combining the switches from
257-
* the arch file with the special switches that VPR needs. */
260+
/**
261+
* @brief This loads up VPR's arch_switch_inf data by combining the switches
262+
* from the arch file with the special switches that VPR needs.
263+
*/
258264
static void SetupSwitches(const t_arch& Arch,
259265
t_det_routing_arch* RoutingArch,
260266
const t_arch_switch_inf* ArchSwitches,
@@ -301,8 +307,11 @@ static void SetupSwitches(const t_arch& Arch,
301307
}
302308
}
303309

304-
/* Sets up routing structures. Since checks are already done, this
305-
* just copies values across */
310+
/**
311+
* @brief Sets up routing structures.
312+
*
313+
* Since checks are already done, this just copies values across
314+
*/
306315
static void SetupRoutingArch(const t_arch& Arch,
307316
t_det_routing_arch* RoutingArch) {
308317
RoutingArch->switch_block_type = Arch.SBType;
@@ -414,8 +423,12 @@ static void SetupAnnealSched(const t_options& Options,
414423
AnnealSched->type = Options.anneal_sched_type;
415424
}
416425

417-
/* Sets up the s_packer_opts structure baesd on users inputs and on the architecture specified.
418-
* Error checking, such as checking for conflicting params is assumed to be done beforehand
426+
/**
427+
* @brief Sets up the s_packer_opts structure baesd on users inputs and
428+
* on the architecture specified.
429+
*
430+
* Error checking, such as checking for conflicting params is assumed
431+
* to be done beforehand
419432
*/
420433
void SetupPackerOpts(const t_options& Options,
421434
t_packer_opts* PackerOpts) {
@@ -467,8 +480,12 @@ static void SetupNetlistOpts(const t_options& Options, t_netlist_opts& NetlistOp
467480
NetlistOpts.netlist_verbosity = Options.netlist_verbosity;
468481
}
469482

470-
/* Sets up the s_placer_opts structure based on users input. Error checking,
471-
* such as checking for conflicting params is assumed to be done beforehand */
483+
/**
484+
* @brief Sets up the s_placer_opts structure based on users input.
485+
*
486+
* Error checking, such as checking for conflicting params
487+
* is assumed to be done beforehand
488+
*/
472489
static void SetupPlacerOpts(const t_options& Options, t_placer_opts* PlacerOpts) {
473490
if (Options.do_placement) {
474491
PlacerOpts->doPlacement = STAGE_DO;

vpr/src/base/atom_lookup.h

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
#include "clustered_netlist_fwd.h"
1313
#include "vpr_types.h"
1414
#include "tatum/TimingGraphFwd.hpp"
15-
/*
16-
* The AtomLookup class describes the mapping between components in the AtomNetlist
17-
* and other netlists/entities (i.e. atom block <-> t_pb, atom block <-> clb)
15+
16+
/**
17+
* @brief The AtomLookup class describes the mapping between components in the AtomNetlist
18+
* and other netlists/entities (i.e. atom block <-> t_pb, atom block <-> clb)
1819
*/
1920
class AtomLookup {
2021
public:
@@ -26,67 +27,81 @@ class AtomLookup {
2627
/*
2728
* PBs
2829
*/
29-
//Returns the leaf pb associated with the atom blk_id
30-
// Note: this is the lowest level pb which corresponds directly to the atom block
30+
31+
/**
32+
* @brief Returns the leaf pb associated with the atom blk_id
33+
* @note this is the lowest level pb which corresponds directly to the atom block
34+
*/
3135
const t_pb* atom_pb(const AtomBlockId blk_id) const;
3236

33-
//Returns the atom block id associated with pb
37+
///@brief Returns the atom block id associated with pb
3438
AtomBlockId pb_atom(const t_pb* pb) const;
3539

36-
//Conveneince wrapper around atom_pb to access the associated graph node
40+
///@brief Conveneince wrapper around atom_pb to access the associated graph node
3741
const t_pb_graph_node* atom_pb_graph_node(const AtomBlockId blk_id) const;
3842

39-
//Sets the bidirectional mapping between an atom and pb
40-
// If either blk_id or pb are not valid any, existing mapping is removed
43+
/**
44+
* @brief Sets the bidirectional mapping between an atom and pb
45+
*
46+
* If either blk_id or pb are not valid any, existing mapping is removed
47+
*/
4148
void set_atom_pb(const AtomBlockId blk_id, const t_pb* pb);
4249

4350
/*
4451
* PB Pins
4552
*/
46-
//Returns the pb graph pin associated with the specified atom pin
53+
54+
///@brief Returns the pb graph pin associated with the specified atom pin
4755
const t_pb_graph_pin* atom_pin_pb_graph_pin(AtomPinId atom_pin) const;
4856

49-
//Sets the mapping between an atom pin and pb graph pin
57+
///@brief Sets the mapping between an atom pin and pb graph pin
5058
void set_atom_pin_pb_graph_pin(AtomPinId atom_pin, const t_pb_graph_pin* gpin);
5159

5260
/*
5361
* Blocks
5462
*/
55-
//Returns the clb index associated with blk_id
63+
64+
///@brief Returns the clb index associated with blk_id
5665
ClusterBlockId atom_clb(const AtomBlockId blk_id) const;
5766

58-
//Sets the bidirectional mapping between an atom and clb
59-
// If either blk_id or clb_index are not valid any existing mapping
60-
// is removed
67+
/**
68+
* @brief Sets the bidirectional mapping between an atom and clb
69+
*
70+
* If either blk_id or clb_index are not valid any existing mapping is removed
71+
*/
6172
void set_atom_clb(const AtomBlockId blk_id, const ClusterBlockId clb);
6273

6374
/*
6475
* Nets
6576
*/
66-
//Returns the atom net id associated with the clb_net_index
77+
78+
///@brief Returns the atom net id associated with the clb_net_index
6779
AtomNetId atom_net(const ClusterNetId clb_net_index) const;
6880

69-
//Returns the clb net index associated with net_id
81+
///@brief Returns the clb net index associated with net_id
7082
ClusterNetId clb_net(const AtomNetId net_id) const;
7183

72-
//Sets the bidirectional mapping between an atom net and a clb net
73-
// If either net_id or clb_net_index are not valid any existing mapping
74-
// is removed
84+
/**
85+
* @brief Sets the bidirectional mapping between an atom net and a clb net
86+
*
87+
* If either net_id or clb_net_index are not valid any existing mapping is removed
88+
*/
7589
void set_atom_clb_net(const AtomNetId net_id, const ClusterNetId clb_net_index);
7690

7791
/*
7892
* Timing Nodes
7993
*/
80-
//Returns the timing graph node associated with the specified atom netlist pin
94+
95+
///@brief Returns the timing graph node associated with the specified atom netlist pin
8196
tatum::NodeId atom_pin_tnode(const AtomPinId pin, BlockTnode block_tnode_type = BlockTnode::EXTERNAL) const;
8297

83-
//Returns the atom netlist pin associated with the specified timing graph node
98+
///@brief Returns the atom netlist pin associated with the specified timing graph node
8499
AtomPinId tnode_atom_pin(const tatum::NodeId tnode) const;
85100

86-
//Returns a range of all pin to tnode mappingsg of the specified type
101+
///@brief Returns a range of all pin to tnode mappingsg of the specified type
87102
AtomLookup::pin_tnode_range atom_pin_tnodes(BlockTnode block_tnode_type) const;
88103

89-
//Sets the bi-directional mapping between an atom netlist pin and timing graph node
104+
///@brief Sets the bi-directional mapping between an atom netlist pin and timing graph node
90105
void set_atom_pin_tnode(const AtomPinId pin, const tatum::NodeId node, BlockTnode block_tnode_type);
91106

92107
private: //Types

vpr/src/base/atom_lookup_fwd.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
class AtomLookup;
55

66
enum class BlockTnode {
7-
INTERNAL, //tnodes corresponding to internal paths withing atom blocks
8-
EXTERNAL //tnodes corresponding to exteranl interface of atom blocks
7+
INTERNAL, ///<tnodes corresponding to internal paths withing atom blocks
8+
EXTERNAL ///<tnodes corresponding to exteranl interface of atom blocks
99
};
1010

1111
#endif

0 commit comments

Comments
 (0)