Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/analytical_placement_flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static void print_ap_netlist_stats(const APNetlist& netlist) {
* @param flat_placement_info The flat placement information to be read.
* @param ap_netlist The APNetlist that used to iterate over its blocks.
* @param prepacker The Prepacker to get molecule of blocks in the ap_netlist.
* @param p_placement The partial placement to be updated which is assumend
* @param p_placement The partial placement to be updated which is assumed
* to be generated on ap_netlist or have the same blocks.
*/
static void convert_flat_to_partial_placement(const FlatPlacementInfo& flat_placement_info, const APNetlist& ap_netlist, const Prepacker& prepacker, PartialPlacement& p_placement) {
Expand Down
10 changes: 5 additions & 5 deletions vpr/src/analytical_place/analytical_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void IdentityAnalyticalSolver::solve(unsigned iteration, PartialPlacement& p_pla
// If this is the first iteration, we need to create a starting placement
// to act as the starting point.
// TODO: It may be convenient to create a class which creates the initial
// placement. That way we can use different intial placements with
// placement. That way we can use different initial placements with
// the identity solver not optimizing.
// Place all of the moveable blocks at the center of the device.
for (APBlockId blk_id : netlist_.blocks()) {
Expand Down Expand Up @@ -250,7 +250,7 @@ static inline void add_connection_to_system(size_t src_row_id,
// Verify that this is a valid block id.
VTR_ASSERT_DEBUG(target_blk_id.is_valid());
// The src_row_id is always a moveable block (rows in the matrix always
// coorespond to a moveable APBlock or a star node.
// correspond to a moveable APBlock or a star node.
if (netlist.block_mobility(target_blk_id) == APBlockMobility::MOVEABLE) {
// If the target is also moveable, update the coefficient matrix.
size_t target_row_id = (size_t)blk_id_to_row_id[target_blk_id];
Expand Down Expand Up @@ -309,7 +309,7 @@ void QPHybridSolver::init_linear_system() {
tripletList.reserve(num_nets);

// Create the connections using a hybrid connection model of the star and
// clique connnection models.
// clique connection models.
size_t star_node_offset = 0;
for (APNetId net_id : netlist_.nets()) {
if (netlist_.net_is_ignored(net_id))
Expand Down Expand Up @@ -454,7 +454,7 @@ void QPHybridSolver::solve(unsigned iteration, PartialPlacement& p_placement) {
Eigen::SparseMatrix<double> A_sparse_diff = Eigen::SparseMatrix<double>(A_sparse);
Eigen::VectorXd b_x_diff = Eigen::VectorXd(b_x);
Eigen::VectorXd b_y_diff = Eigen::VectorXd(b_y);
// In the first iteration, the orginal linear system is used.
// In the first iteration, the original linear system is used.
// In any other iteration, use the moveable APBlocks current placement as
// anchor-points (fixed block positions).
if (iteration != 0) {
Expand Down Expand Up @@ -600,7 +600,7 @@ void B2BSolver::solve(unsigned iteration, PartialPlacement& p_placement) {
}

// In the first iteration, we have no prior information.
// Run the intial placer to get a first guess.
// Run the initial placer to get a first guess.
switch (initial_placement_ty_) {
case e_initial_placement_type::LeastDense:
initialize_placement_least_dense(p_placement);
Expand Down
12 changes: 6 additions & 6 deletions vpr/src/analytical_place/analytical_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef vtr::StrongId<struct ap_row_id_tag, size_t> APRowId;
* This provides functionality that all Analytical Solvers will use.
*
* It provides a standard interface that all Analytical Solvers must implement
* so they can be used interchangably. This makes it very easy to test and
* so they can be used interchangeably. This makes it very easy to test and
* compare different solvers.
*/
class AnalyticalSolver {
Expand Down Expand Up @@ -90,7 +90,7 @@ class AnalyticalSolver {
/**
* @brief Print statistics on the analytical solver.
*
* This is expected to be called after global placement to collect cummulative
* This is expected to be called after global placement to collect cumulative
* information on how the solver performed.
*/
virtual void print_statistics() = 0;
Expand Down Expand Up @@ -178,7 +178,7 @@ std::unique_ptr<AnalyticalSolver> make_analytical_solver(e_ap_analytical_solver
int log_verbosity);

/**
* @brief An analytical solver which does not solve anthing. This solver acts
* @brief An analytical solver which does not solve anything. This solver acts
* like the identity matrix in a system of equations and just passes the
* previous solution (from the partial legalizer) along. This solver
* should only be used for testing.
Expand Down Expand Up @@ -295,7 +295,7 @@ class QPHybridSolver : public AnalyticalSolver {
void init_linear_system();

/**
* @brief Intializes the guesses which will be used in the solver.
* @brief Initializes the guesses which will be used in the solver.
*
* The guesses will be used as starting points for the CG solver. The better
* these guesses are, the faster the solver will converge.
Expand Down Expand Up @@ -473,7 +473,7 @@ class B2BSolver : public AnalyticalSolver {
/// @brief Since the weights in the B2B model divide by the distance between
/// blocks and their bounds, that distance may get very very close to
/// 0. This causes the weight matrix to become numerically unstable.
/// We can gaurd against this by clamping the distance to not be smaller
/// We can guard against this by clamping the distance to not be smaller
/// than some epsilon.
/// Decreasing this number may lead to more instability, but can yield
/// a higher quality solution.
Expand Down Expand Up @@ -703,7 +703,7 @@ class B2BSolver : public AnalyticalSolver {
* placement object.
*
* Note: The x_soln and y_soln may be modified if it is found that the
* solution is imposible (i.e. has negative positions).
* solution is impossible (i.e. has negative positions).
*/
void store_solution_into_placement(Eigen::VectorXd& x_soln,
Eigen::VectorXd& y_soln,
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/ap_argparse_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ parse_key_val_arg(const std::string& arg, unsigned expected_num_vals_per_key) {
"Error when parsing argument string");
}

// Collect the comma seperated values into a vector.
// Collect the comma separated values into a vector.
std::vector<float> vals;
vals.reserve(expected_num_vals_per_key);

Expand Down
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/ap_argparse_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @file
* @author Alex Singer
* @date June 2025
* @brief Delcarations of utility functions used to parse AP options.
* @brief Declarations of utility functions used to parse AP options.
*/

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/ap_draw_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @file
* @author Yulang (Robert) Luo
* @date October 2025
* @brief The decalarations of the AP Draw Manager class which is used
* @brief The declarations of the AP Draw Manager class which is used
* to handle graphics updates during analytical placement.
*/

Expand Down
4 changes: 2 additions & 2 deletions vpr/src/analytical_place/ap_mass_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void print_physical_tiles(std::ofstream& os,
* @brief Prints all of the non-zero dimensions of the given primitive vector.
*
* @param os
* The output file stream to print the primtive vector to.
* The output file stream to print the primitive vector to.
* @param primitive_vec
* The primitive vector to print.
* @param dim_manager
Expand Down Expand Up @@ -466,7 +466,7 @@ void print_expected_device_utilization(std::ofstream& os,
}

// Print the expected number of logical blocks and the expected block utilization.
// Note: These may be innacurate if a model appears in multiple different
// Note: These may be inaccurate if a model appears in multiple different
// logical blocks.
// TODO: Investigate resolving this issue.
os << "Expected number of logical blocks:\n";
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/flat_placement_density_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct t_physical_tile_type;
* capacity of each bin is the capacity of the tile it represents (as computed
* by the flat placement mass calculator). When AP blocks are added / removed
* from bins, this class will maintain the current utilization of the bin. Since
* these masses / capacities are repesented by M-dimensional quantities (where
* these masses / capacities are represented by M-dimensional quantities (where
* M is the number of models in the architecture), the overfill and underfill of
* each bin is given as an M-dimensional vector. For example, in an architecture
* of only LUTs and FFs, an overfill of <3, 1> means that a bin has 3 too many
Expand Down
16 changes: 8 additions & 8 deletions vpr/src/analytical_place/flat_placement_mass_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ static PrimitiveVector calc_pb_type_capacity(const t_pb_type* pb_type,
return capacity;
}
// For now, we simply mix the capacities of modes by taking the max of each
// dimension of the capcities. This provides an upper-bound on the amount of
// dimension of the capacities. This provides an upper-bound on the amount of
// primitives this pb can contain.
for (int mode = 0; mode < pb_type->num_modes; mode++) {
PrimitiveVector mode_capacity = calc_mode_capacity(pb_type->modes[mode], memory_model_dims, dim_manager);
capacity = PrimitiveVector::max(capacity, mode_capacity);
}

// A pb_type represents a heirarchy of physical blocks that can be implemented,
// with leaves of primitives at the bottom of the heirarchy. A pb_type will have
// A pb_type represents a hierarchy of physical blocks that can be implemented,
// with leaves of primitives at the bottom of the hierarchy. A pb_type will have
// many children, each with their own physical cost; however, a parent pb_type
// should not have higher cost than its children. For example, here we use
// pin counts to represent cost. The children of the pb_type cannot use more
Expand All @@ -264,7 +264,7 @@ static PrimitiveVector calc_pb_type_capacity(const t_pb_type* pb_type,
}

/**
* @brief Calculate the cpacity of the given logical block type.
* @brief Calculate the capacity of the given logical block type.
*/
static PrimitiveVector calc_logical_block_type_capacity(const t_logical_block_type& logical_block_type,
const PrimitiveDimManager& dim_manager) {
Expand Down Expand Up @@ -372,7 +372,7 @@ static PrimitiveVector calc_block_mass(APBlockId blk_id,
namespace {

/**
* @brief A struct to hold information on pb types which act like one-hot primitves.
* @brief A struct to hold information on pb types which act like one-hot primitives.
*/
struct OneHotPbType {
/// @brief The root pb type which contains the modes which act in a one-hot
Expand Down Expand Up @@ -553,13 +553,13 @@ static void initialize_dim_manager(PrimitiveDimManager& dim_manager,
}
}

// Count the number of occurences of each model in the netlist.
// Count the number of occurrences of each model in the netlist.
vtr::vector<LogicalModelId, unsigned> num_model_occurence(models.all_models().size(), 0);
for (AtomBlockId blk_id : atom_netlist.blocks()) {
LogicalModelId model_id = atom_netlist.block_model(blk_id);

// If this model is not part of a shared dimension, just accumulate its
// number of occurences.
// number of occurrences.
int one_hot_id = model_one_hot_id[model_id];
if (one_hot_id == -1) {
num_model_occurence[model_id]++;
Expand All @@ -568,7 +568,7 @@ static void initialize_dim_manager(PrimitiveDimManager& dim_manager,

// If this model is part of a shared dimension, only accumulate into the
// first shared model. This creates an accurate count of the number of
// occurences of the overall shared dimension in this first model id.
// occurrences of the overall shared dimension in this first model id.
const OneHotPbType& one_hot_pb_type = one_hot_pb_types[one_hot_id];
LogicalModelId first_model_id = *one_hot_pb_type.shared_models.begin();
num_model_occurence[first_model_id]++;
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/analytical_place/full_legalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class APClusterPlacer {

/**
* @brief Given a cluster and tile it wants to go into, try to place the
* cluster at this tile's postion.
* cluster at this tile's position.
*/
bool place_cluster(ClusterBlockId clb_blk_id,
const t_physical_tile_loc& tile_loc,
Expand Down Expand Up @@ -1312,7 +1312,7 @@ void APPack::legalize(const PartialPlacement& p_placement) {

void FullLegalizer::update_drawing_data_structures() {
#ifndef NO_GRAPHICS
// update graphic resources incase of clustering changes
// update graphic resources in case of clustering changes
if (get_draw_state_vars()) {
get_draw_state_vars()->refresh_graphic_resources_after_cluster_change();
}
Expand Down
5 changes: 1 addition & 4 deletions vpr/src/analytical_place/full_legalizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ std::unique_ptr<FullLegalizer> make_full_legalizer(e_ap_full_legalizer full_lega
*
* After cluster creation, each cluster is placed by the initial placer at the
* grid location nearest to the centroid of its atoms.
*
* TODO: Refer to the FPT 2025 Triple-AP paper if accepted.
*
*/
class FlatRecon : public FullLegalizer {
public:
Expand Down Expand Up @@ -332,7 +329,7 @@ class NaiveFullLegalizer : public FullLegalizer {
*
* In the Packer, the flat-placement can provide more context for the clusters
* to pull in atoms that want to be near the other atoms in the cluster, and
* repell atoms that are far apart. This can potentially make better clusters
* repel atoms that are far apart. This can potentially make better clusters
* than a Packer that does not know that information.
*
* In the Placer, the flat-placement can help decide where clusters of atoms
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/global_placer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ PartialPlacement SimPLGlobalPlacer::place() {
// Print the status header.
if (log_verbosity_ >= 1)
print_SimPL_status_header();
// Initialialize the partial placement object.
// Initialize the partial placement object.
PartialPlacement p_placement(ap_netlist_);

float total_time_spent_in_solver = 0.0f;
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/analytical_place/global_placer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct PartialPlacement;
*
* This declares the functionality that all Global Placers will use. This
* provides a standard interface for the global placers so they can be used
* interchangably. This makes it very easy to test and compare different global
* interchangeably. This makes it very easy to test and compare different global
* placers.
*/
class GlobalPlacer {
Expand Down Expand Up @@ -132,7 +132,7 @@ class SimPLGlobalPlacer : public GlobalPlacer {
/// @brief The solver which generates the lower-bound placement.
std::unique_ptr<AnalyticalSolver> solver_;

/// @brief The denisty manager the partial legalizer will optimize over.
/// @brief The density manager the partial legalizer will optimize over.
std::shared_ptr<FlatPlacementDensityManager> density_manager_;

/// @brief The legalizer which generates the upper-bound placement.
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/analytical_place/model_grouper.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ typedef vtr::StrongId<struct model_group_id_tag, size_t> ModelGroupId;
* group and must be legalized together.
*
* This class also manages what models each group contains and the group of each
* model, where the user can use IDs to get relavent information.
* model, where the user can use IDs to get relevant information.
*/
class ModelGrouper {
public:
Expand Down
8 changes: 4 additions & 4 deletions vpr/src/analytical_place/partial_legalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ void FlowBasedLegalizer::legalize(PartialPlacement& p_placement) {
// We take the manhattan (L1) norm here since we only care about the total
// amount of overfill in each dimension. For example, a bin that has a
// supply of <1, 1> is just as overfilled as a bin of supply <0, 2>.
// The standard L2 norm would give more weigth to <0, 2>.
// The standard L2 norm would give more weight to <0, 2>.
// NOTE: Although the supply should always be non-negative, we still
// take the absolute value in the norm for completeness.
// TODO: This is a guess. Should investigate other norms.
Expand Down Expand Up @@ -1221,7 +1221,7 @@ void BiPartitioningPartialLegalizer::merge_overlapping_windows(
// Add the lower and upper bound of the window into the map. Add a small
// epsilon to exclude the border of the window. We do not care if two
// windows share a border, only if they overlap.
// NOTE: This will add duplicates; however it ensures that the overlaping
// NOTE: This will add duplicates; however it ensures that the overlapping
// region is found in the lower algorithm.
const SpreadingWindow& window = windows[i];
x_sorted_windows.insert(std::make_pair(window.region.xmin() + epsilon, i));
Expand Down Expand Up @@ -1255,7 +1255,7 @@ void BiPartitioningPartialLegalizer::merge_overlapping_windows(
// Get the lower and upper bounds in the spatial lookup. This will
// give a list of all windows which could possibly overlap right now
// (at least in the x dimension).
// NOTE: There may be duplicates; but thats ok since these checks
// NOTE: There may be duplicates; but that's ok since these checks
// are fast.
auto lower = x_sorted_windows.lower_bound(region.xmin());
auto upper = x_sorted_windows.upper_bound(region.xmax());
Expand Down Expand Up @@ -1913,7 +1913,7 @@ void BiPartitioningPartialLegalizer::move_blocks_out_of_windows(
for (APBlockId blk_id : window.contained_blocks) {
// Note: The blocks should have been removed from their original
// bins when they were put into the windows. There are asserts
// within the denisty manager class which will verify this.
// within the density manager class which will verify this.
density_manager_->insert_block_into_bin(blk_id, bin_id);
}
}
Expand Down
Loading