Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
soheilshahrouz committed Jul 1, 2024
1 parent c74ca63 commit ea6464e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion vpr/src/base/region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Region intersection(const Region& r1, const Region& r2) {
return intersect;
}

// subtile are not compatible
// subtiles are not compatible
return {};
}

Expand Down
2 changes: 1 addition & 1 deletion vpr/src/base/vpr_constraints_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class VprConstraintsSerializer final : public uxsd::VprConstraintsBase<VprConstr
report_error_->operator()("The specified region is empty.");
}
}

loaded_part_region.add_to_part_region(loaded_region);

Region clear_region;
Expand Down
1 change: 0 additions & 1 deletion vpr/src/pack/constraints_report.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "constraints_report.h"

//To-do: alter this routine to check whether whole PartitionRegions are full instead of individual Regions
bool floorplan_constraints_regions_overfull() {
GridTileLookup grid_tiles;

Expand Down
23 changes: 17 additions & 6 deletions vpr/src/pack/constraints_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@
#include "grid_tile_lookup.h"
#include "place_constraints.h"

/*
* Check if any constraints regions are overfull,
* i.e. the region contains more clusters of a certain type
* than it has room for.
* If the region is overfull, a message is printed saying which
* region is overfull, and by how many clusters.
/**
* @brief Check if any constraint partition regions are overfull,
* i.e. the partition contains more clusters of a certain type
* than it has room for. If the region is overfull, a message is
* printed saying which partition is overfull, and by how many clusters.
*
* To reduce the complexity of this function, several assumptions are made.
* 1) Regions of a partition do not overlap, meaning that the capacity of each
* partition for accommodating blocks of a specific type can be calculated by
* accumulating the capacity of its regions.
* 2) Partitions do not overlap. This means that each physical tile is in at most
* one partition.
*
* VPR can still work if these assumptions do not hold true, but for tight overlapping
* partitions, the placement engine may fail to find a legal placement.
*
* @return True if there is at least one overfull partition.
*/
bool floorplan_constraints_regions_overfull();

Expand Down
9 changes: 5 additions & 4 deletions vpr/src/place/grid_tile_lookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ class GridTileLookup {
void fill_type_matrix(t_logical_block_type_ptr block_type, vtr::NdMatrix<int, 3>& type_count);

/**
* @brief Stores the cumulative total of subtiles available at each location in the grid for each block type.
* @brief Stores the cumulative total of subtiles available at each (x, y) location in each layer
* for all block types.
*
* Therefore, the length of the vector will be the number of logical block types. To access the cumulative
* number of subtiles at a location, you would use block_type_matrices[iblock_type][x][y] - this would
* give the number of placement locations that are at, or above and to the right of the given [x,y] for
* the given block type.
* number of subtiles at a location in a specific layer, you would use block_type_matrices[iblock_type][layer][x][y].
* This would give the number of placement locations that are at, or above (larger y) and to the right of the given [x,y] for
* the given block type in the given layer.
*/
std::vector<vtr::NdMatrix<int, 3>> block_type_matrices;

Expand Down

0 comments on commit ea6464e

Please sign in to comment.