-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6ffb7b
commit 1ecf07c
Showing
9 changed files
with
101 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
#include "blk_loc_registry.h" | ||
#include "globals.h" | ||
|
||
const vtr::vector_map<ClusterBlockId, t_block_loc>& BlkLocRegistry::block_locs() const { | ||
return block_locs_; | ||
} | ||
|
||
vtr::vector_map<ClusterBlockId, t_block_loc>& BlkLocRegistry::mutable_block_locs() { | ||
return block_locs_; | ||
} | ||
|
||
const GridBlock& BlkLocRegistry::grid_blocks() const { | ||
return grid_blocks_; | ||
} | ||
|
||
GridBlock& BlkLocRegistry::mutable_grid_blocks() { | ||
return grid_blocks_; | ||
} | ||
|
||
const vtr::vector_map<ClusterPinId, int>& BlkLocRegistry::physical_pins() const { | ||
return physical_pins_; | ||
} | ||
|
||
vtr::vector_map<ClusterPinId, int>& BlkLocRegistry::mutable_physical_pins() { | ||
return physical_pins_; | ||
} | ||
|
||
int BlkLocRegistry::tile_pin_index(const ClusterPinId pin) const { | ||
return physical_pins_[pin]; | ||
} | ||
|
||
int BlkLocRegistry::net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index) const { | ||
auto& cluster_ctx = g_vpr_ctx.clustering(); | ||
|
||
// Get the logical pin index of pin within its logical block type | ||
ClusterPinId pin_id = cluster_ctx.clb_nlist.net_pin(net_id, net_pin_index); | ||
|
||
return this->tile_pin_index(pin_id); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef VTR_BLK_LOC_REGISTRY_H | ||
#define VTR_BLK_LOC_REGISTRY_H | ||
|
||
#include "clustered_netlist_fwd.h" | ||
#include "vtr_vector_map.h" | ||
#include "vpr_types.h" | ||
|
||
struct t_block_loc; | ||
|
||
class BlkLocRegistry { | ||
public: | ||
BlkLocRegistry() = default; | ||
~BlkLocRegistry() = default; | ||
BlkLocRegistry(const BlkLocRegistry&) = delete; | ||
BlkLocRegistry& operator=(const BlkLocRegistry&) = default; | ||
BlkLocRegistry(BlkLocRegistry&&) = delete; | ||
BlkLocRegistry& operator=(BlkLocRegistry&&) = delete; | ||
|
||
private: | ||
///@brief Clustered block placement locations | ||
vtr::vector_map<ClusterBlockId, t_block_loc> block_locs_; | ||
|
||
///@brief Clustered block associated with each grid location (i.e. inverse of block_locs) | ||
GridBlock grid_blocks_; | ||
|
||
///@brief Clustered pin placement mapping with physical pin | ||
vtr::vector_map<ClusterPinId, int> physical_pins_; | ||
|
||
public: | ||
const vtr::vector_map<ClusterBlockId, t_block_loc>& block_locs() const; | ||
vtr::vector_map<ClusterBlockId, t_block_loc>& mutable_block_locs(); | ||
|
||
const GridBlock& grid_blocks() const; | ||
GridBlock& mutable_grid_blocks(); | ||
|
||
const vtr::vector_map<ClusterPinId, int>& physical_pins() const; | ||
vtr::vector_map<ClusterPinId, int>& mutable_physical_pins(); | ||
|
||
///@brief Returns the physical pin of the tile, related to the given ClusterPinId | ||
int tile_pin_index(const ClusterPinId pin) const; | ||
|
||
///@brief Returns the physical pin of the tile, related to the given ClusterNedId, and the net pin index. | ||
int net_pin_to_tile_pin_index(const ClusterNetId net_id, int net_pin_index) const; | ||
}; | ||
|
||
#endif //VTR_BLK_LOC_REGISTRY_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters