-
Notifications
You must be signed in to change notification settings - Fork 414
Remove usage of atom to pb lookup from packing #2932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AmirhosseinPoolad
merged 19 commits into
verilog-to-routing:master
from
AmirhosseinPoolad:refactor_atom_pb_from_packing
Mar 20, 2025
Merged
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2934ebd
Remove usage of atom to pb lookup from packing
AmirhosseinPoolad 02e4f1e
Merge branch 'master' into refactor_atom_pb_from_packing
AmirhosseinPoolad 00aad1b
Remove unused variables in cluster_legalizer.cpp
AmirhosseinPoolad 14cff91
Remove code duplication between global context and AtomPBBimap
AmirhosseinPoolad f482530
Remove pb_free code duplication
AmirhosseinPoolad 1741f76
Merge remote-tracking branch 'origin' into refactor_atom_pb_from_packing
AmirhosseinPoolad 2b9179a
Merge remote-tracking branch 'origin' into refactor_atom_pb_from_packing
AmirhosseinPoolad 7f3b274
Remove unused variable from update_connection_gain_values
AmirhosseinPoolad c8fe4e0
Add atom_pb_bimap locking
AmirhosseinPoolad 6128622
Add documentation to atom_pb_bimap and general cleanup
AmirhosseinPoolad 8d801d7
Add documentation and clean up AtomPBBimap
AmirhosseinPoolad 4571d72
Add doxygen comments to atom_pb_bimap getter functions
AmirhosseinPoolad e2ac829
Fix styling regressions
AmirhosseinPoolad 9e0d48a
Add reset_bimap helper method to AtomPBBimap
AmirhosseinPoolad 4c61867
Remove copying empty bimap from global context to cluster legalizer
AmirhosseinPoolad 624f251
Refactor is_atom_blk_in_pb function to get two t_pb* arguments
AmirhosseinPoolad 0e6f62a
Merge branch 'master' into refactor_atom_pb_from_packing
AmirhosseinPoolad dfb6462
Fix minor styling issues
AmirhosseinPoolad f77c3c7
Merge branch 'master' into refactor_atom_pb_from_packing
AmirhosseinPoolad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
|
||
#include "vtr_optional.h" | ||
|
||
#include "atom_pb_bimap.h" | ||
|
||
/** | ||
* @brief The AtomLookup class describes the mapping between components in the AtomNetlist | ||
* and other netlists/entities (i.e. atom block <-> t_pb, atom block <-> clb) | ||
|
@@ -25,29 +27,49 @@ class AtomLookup { | |
|
||
typedef vtr::Range<pin_tnode_iterator> pin_tnode_range; | ||
|
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: extra spaces. |
||
public: | ||
/* | ||
* PBs | ||
*/ | ||
|
||
|
||
/** | ||
* @brief Returns the leaf pb associated with the atom blk_id | ||
* @note this is the lowest level pb which corresponds directly to the atom block | ||
* @brief Sets the atom to pb bimap access lock to value. | ||
* If set to true, access to the bimap is prohibited and will result in failing assertions. | ||
* | ||
* @param value Value to set to lock to | ||
*/ | ||
const t_pb* atom_pb(const AtomBlockId blk_id) const; | ||
inline void set_atom_pb_bimap_lock(bool value) { | ||
VTR_ASSERT_SAFE_MSG(lock_atom_pb_bimap_ != value, "Double locking or unlocking the atom pb bimap lock"); | ||
lock_atom_pb_bimap_ = value; | ||
} | ||
|
||
/// @brief Gets the current atom to pb bimap lock value. | ||
inline bool atom_pb_bimap_islocked() const {return lock_atom_pb_bimap_;} | ||
|
||
///@brief Returns the atom block id associated with pb | ||
AtomBlockId pb_atom(const t_pb* pb) const; | ||
|
||
///@brief Conveneince wrapper around atom_pb to access the associated graph node | ||
const t_pb_graph_node* atom_pb_graph_node(const AtomBlockId blk_id) const; | ||
// All accesses, mutable or immutable, to the atom to pb bimap | ||
// will result in failing assertions if the lock is set to true. | ||
// This is done to make sure there is only a single source of | ||
// data in places that are supposed to use a local data structure | ||
// instead of the global context. | ||
|
||
/// @brief Returns a mutable reference to the atom to pb bimap, provided that access to it is unlocked. It will result in a crash otherwise. | ||
/// @return Mutable reference to the atom pb bimap. | ||
inline AtomPBBimap &mutable_atom_pb_bimap() {VTR_ASSERT(!lock_atom_pb_bimap_); return atom_to_pb_bimap_;} | ||
|
||
/// @brief Returns an immutable reference to the atom to pb bimap, provided that access to it is unlocked. It will result in a crash otherwise. | ||
/// @return Immutable reference to the atom pb bimap. | ||
inline const AtomPBBimap &atom_pb_bimap() const {VTR_ASSERT(!lock_atom_pb_bimap_); return atom_to_pb_bimap_;} | ||
|
||
/** | ||
* @brief Sets the bidirectional mapping between an atom and pb | ||
* | ||
* If either blk_id or pb are not valid any, existing mapping is removed | ||
* @brief Set atom to pb bimap | ||
* | ||
* @param atom_to_pb Reference to AtomPBBimab to be copied from | ||
*/ | ||
void set_atom_pb(const AtomBlockId blk_id, const t_pb* pb); | ||
void set_atom_to_pb_bimap(const AtomPBBimap& atom_to_pb){atom_to_pb_bimap_ = atom_to_pb;} | ||
AlexandreSinger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/* | ||
* PB Pins | ||
|
@@ -112,7 +134,13 @@ class AtomLookup { | |
|
||
private: //Types | ||
private: | ||
vtr::bimap<AtomBlockId, const t_pb*, vtr::linear_map, std::unordered_map> atom_to_pb_; | ||
|
||
/** | ||
* @brief Allows or disallows access to the AtomPBBimap data. | ||
* Useful to make sure global context is not accessed in places you don't want it to. | ||
*/ | ||
bool lock_atom_pb_bimap_ = false; | ||
AtomPBBimap atom_to_pb_bimap_; | ||
|
||
vtr::vector_map<AtomPinId, const t_pb_graph_pin*> atom_pin_to_pb_graph_pin_; | ||
|
||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.