-
Notifications
You must be signed in to change notification settings - Fork 551
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
drt: pin access split #5945
Draft
bnmfw
wants to merge
27
commits into
The-OpenROAD-Project:master
Choose a base branch
from
bnmfw:drt_pa_split
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
drt: pin access split #5945
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
10c31c3
drt: creation of drt_genAPCosted
bnmfw b46205c
drt: clang-tidy
bnmfw 0384ae2
drt: de morgan and half grid disabled
bnmfw ff1ef32
drt: getNestedIdx explicit output
bnmfw 04489f3
curr_idx name changes
bnmfw b22b872
drt: more name changing
bnmfw 4575e52
drt: name fix
bnmfw f6001ce
drt: init instance access points
bnmfw ad4a9f3
drt: better pin count info dump
bnmfw c9df50b
drt: fixed a typo
bnmfw 1bc95be
drt: name fixes
bnmfw 2142bfb
drt: backwards pattern propagation readability
bnmfw f21978c
drt: used access pattern guard
bnmfw 63dc4f8
drt: extraction of access patterns from nodes separated in its own fu…
bnmfw 60ed9ab
clang-tidy
bnmfw cf43a48
drt: flexNodes decoupled from node vector structure
bnmfw 22fa597
drt: elimination of getNestedIdx
bnmfw a3af890
drt: added comments to make offset logic more clear
bnmfw 7b58407
drt: patterns generation uses vec of vec
bnmfw 887ce70
drt: getEdgeCost minor refactoring and some other refactors
bnmfw 49bcd04
drt: nodes structure changed
bnmfw 43fb2d9
Merge remote-tracking branch 'origin/master' into drt_genAPCosted
bnmfw 5b84d06
drt: separation of drc checking in pin access
bnmfw 5f63c43
Merge branch 'drt_genAPCosted' into drt_pa_split
bnmfw 8569fc5
Merge branch 'drt_drc_separation' into drt_pa_split
bnmfw d2ec360
Merge branch 'drt_initInstAccessPoint' into drt_pa_split
bnmfw 8e7a63a
drt: PA module split in multiple files
bnmfw 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 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -137,6 +137,13 @@ class FlexPA | |||||
|
||||||
bool isStdCell(frInst* inst); | ||||||
bool isMacroCell(frInst* inst); | ||||||
/** | ||||||
* @brief initializes all access points of a single unique instance | ||||||
* | ||||||
* @param inst the unique instance | ||||||
*/ | ||||||
void initInstAccessPoints(frInst* inst); | ||||||
|
||||||
/** | ||||||
* @brief initializes all access points of all unique instances | ||||||
*/ | ||||||
|
@@ -277,11 +284,34 @@ class FlexPA | |||||
* @param rect pin rectangle to which via is bounded | ||||||
* @param layer_num number of the layer | ||||||
*/ | ||||||
|
||||||
void genAPEnclosedBoundary(std::map<frCoord, frAccessPointEnum>& coords, | ||||||
const gtl::rectangle_data<frCoord>& rect, | ||||||
frLayerNum layer_num, | ||||||
bool is_curr_layer_horz); | ||||||
|
||||||
/** | ||||||
* @brief Calls the other genAP functions according to the informed cost | ||||||
* | ||||||
* @param cost access point cost | ||||||
* @param coords access points cost map (will get at least one new entry) | ||||||
* @param track_coords coordinates of tracks on the layer | ||||||
* @param base_layer_num if two layers are being considered this is the lower, | ||||||
* if only one is being considered this is the layer | ||||||
* @param layer_num number of the current layer | ||||||
* @param rect rectangle representing pin shape | ||||||
* @param is_curr_layer_horz if the current layer is horizontal | ||||||
* @param offset TODO: not sure, something to do with macro cells | ||||||
*/ | ||||||
void genAPCosted(frAccessPointEnum cost, | ||||||
std::map<frCoord, frAccessPointEnum>& coords, | ||||||
const std::map<frCoord, frAccessPointEnum>& track_coords, | ||||||
frLayerNum base_layer_num, | ||||||
frLayerNum layer_num, | ||||||
const gtl::rectangle_data<frCoord>& rect, | ||||||
bool is_curr_layer_horz, | ||||||
int offset = 0); | ||||||
|
||||||
void gen_initializeAccessPoints( | ||||||
std::vector<std::unique_ptr<frAccessPoint>>& aps, | ||||||
std::set<std::pair<Point, frLayerNum>>& apset, | ||||||
|
@@ -373,6 +403,14 @@ class FlexPA | |||||
T* pin, | ||||||
frInstTerm* inst_term); | ||||||
|
||||||
template <typename T> | ||||||
bool isPlanarViolationFree(frAccessPoint* ap, | ||||||
T* pin, | ||||||
std::unique_ptr<frPathSeg> ps, | ||||||
frInstTerm* inst_term, | ||||||
const Point point, | ||||||
frLayer* layer); | ||||||
|
||||||
/** | ||||||
* @brief Generates an end_point given an begin_point in the direction | ||||||
* | ||||||
|
@@ -452,6 +490,14 @@ class FlexPA | |||||
const std::vector<gtl::polygon_90_data<frCoord>>& layer_polys, | ||||||
frDirEnum dir); | ||||||
|
||||||
template <typename T> | ||||||
bool isViaViolationFree(frAccessPoint* ap, | ||||||
frVia* via, | ||||||
T* pin, | ||||||
std::unique_ptr<frPathSeg> ps, | ||||||
frInstTerm* inst_term, | ||||||
const Point point); | ||||||
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. warning: parameter 'point' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
Suggested change
|
||||||
|
||||||
template <typename T> | ||||||
void updatePinStats( | ||||||
const std::vector<std::unique_ptr<frAccessPoint>>& tmp_aps, | ||||||
|
@@ -514,60 +560,66 @@ class FlexPA | |||||
int curr_unique_inst_idx, | ||||||
int max_access_point_size); | ||||||
|
||||||
void genPatternsInit(std::vector<FlexDPNode>& nodes, | ||||||
void genPatternsInit(std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
std::set<std::vector<int>>& inst_access_patterns, | ||||||
std::set<std::pair<int, int>>& used_access_points, | ||||||
std::set<std::pair<int, int>>& viol_access_points, | ||||||
int max_access_point_size); | ||||||
std::set<std::pair<int, int>>& viol_access_points); | ||||||
|
||||||
void genPatterns_reset( | ||||||
std::vector<FlexDPNode>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
int max_access_point_size); | ||||||
std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins); | ||||||
|
||||||
void genPatterns_perform( | ||||||
std::vector<FlexDPNode>& nodes, | ||||||
std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
std::vector<int>& vio_edges, | ||||||
const std::set<std::pair<int, int>>& used_access_points, | ||||||
const std::set<std::pair<int, int>>& viol_access_points, | ||||||
int curr_unique_inst_idx, | ||||||
int max_access_point_size); | ||||||
|
||||||
int getEdgeCost(int prev_node_idx, | ||||||
int curr_node_idx, | ||||||
const std::vector<FlexDPNode>& nodes, | ||||||
int getEdgeCost(FlexDPNode* prev_node_idx, | ||||||
FlexDPNode* curr_node_idx, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
std::vector<int>& vio_edges, | ||||||
const std::set<std::pair<int, int>>& used_access_points, | ||||||
const std::set<std::pair<int, int>>& viol_access_points, | ||||||
int curr_unique_inst_idx, | ||||||
int max_access_point_size); | ||||||
|
||||||
/** | ||||||
* @brief Extracts the access patterns given the graph nodes composing the | ||||||
* access points relatioship | ||||||
* | ||||||
* @param nodes {pin,access_point} nodes of the access pattern graph | ||||||
* @param pins vector os pins of the unique instance | ||||||
* @param used_access_points a set of all used access points | ||||||
* | ||||||
* @returns a vector of ints representing the access pattern in the form: | ||||||
* access_pattern[pin_idx] = access_point_idx of the pin | ||||||
*/ | ||||||
std::vector<int> extractAccessPatternFromNodes( | ||||||
const std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
std::set<std::pair<int, int>>& used_access_points); | ||||||
|
||||||
bool genPatterns_commit( | ||||||
const std::vector<FlexDPNode>& nodes, | ||||||
const std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
bool& is_valid, | ||||||
std::set<std::vector<int>>& inst_access_patterns, | ||||||
std::set<std::pair<int, int>>& used_access_points, | ||||||
std::set<std::pair<int, int>>& viol_access_points, | ||||||
int curr_unique_inst_idx, | ||||||
int max_access_point_size); | ||||||
int curr_unique_inst_idx); | ||||||
|
||||||
void genPatternsPrintDebug( | ||||||
std::vector<FlexDPNode>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
int max_access_point_size); | ||||||
std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins); | ||||||
|
||||||
void genPatterns_print( | ||||||
std::vector<FlexDPNode>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins, | ||||||
int max_access_point_size); | ||||||
|
||||||
int getFlatIdx(int idx_1, int idx_2, int idx_2_dim); | ||||||
|
||||||
void getNestedIdx(int flat_idx, int& idx_1, int& idx_2, int idx_2_dim); | ||||||
std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<std::pair<frMPin*, frInstTerm*>>& pins); | ||||||
|
||||||
int getFlatEdgeIdx(int prev_idx_1, | ||||||
int prev_idx_2, | ||||||
|
@@ -584,21 +636,20 @@ class FlexPA | |||||
|
||||||
void genInstRowPattern(std::vector<frInst*>& insts); | ||||||
|
||||||
void genInstRowPatternInit(std::vector<FlexDPNode>& nodes, | ||||||
void genInstRowPatternInit(std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<frInst*>& insts); | ||||||
|
||||||
void genInstRowPatternPerform(std::vector<FlexDPNode>& nodes, | ||||||
void genInstRowPatternPerform(std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<frInst*>& insts); | ||||||
|
||||||
void genInstRowPattern_commit(std::vector<FlexDPNode>& nodes, | ||||||
void genInstRowPattern_commit(std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<frInst*>& insts); | ||||||
|
||||||
void genInstRowPattern_print(std::vector<FlexDPNode>& nodes, | ||||||
void genInstRowPattern_print(std::vector<std::vector<FlexDPNode>>& nodes, | ||||||
const std::vector<frInst*>& insts); | ||||||
|
||||||
int getEdgeCost(int prev_node_idx, | ||||||
int curr_node_idx, | ||||||
const std::vector<FlexDPNode>& nodes, | ||||||
int getEdgeCost(FlexDPNode* prev_node_idx, | ||||||
FlexDPNode* curr_node_idx, | ||||||
const std::vector<frInst*>& insts); | ||||||
|
||||||
void revertAccessPoints(); | ||||||
|
@@ -660,16 +711,30 @@ class FlexDPNode | |||||
// getters | ||||||
int getPathCost() const { return pathCost_; } | ||||||
int getNodeCost() const { return nodeCost_; } | ||||||
int getPrevNodeIdx() const { return prev_node_idx_; } | ||||||
FlexDPNode* getPrevNode() const { return prev_node_; } | ||||||
std::pair<int, int> getIdx() const { return idx_; } | ||||||
bool isSource() const { return virtual_source_; } | ||||||
bool isDrain() const { return virtual_drain_; } | ||||||
bool isVirtual() const { return (virtual_source_ || virtual_drain_); } | ||||||
|
||||||
// setters | ||||||
void setPathCost(int in) { pathCost_ = in; } | ||||||
void setNodeCost(int in) { nodeCost_ = in; } | ||||||
void setPrevNodeIdx(int in) { prev_node_idx_ = in; } | ||||||
void setPrevNode(FlexDPNode* in) { prev_node_ = in; } | ||||||
void setIdx(std::pair<int, int> in) { idx_ = in; } | ||||||
void setAsSource() { virtual_source_ = true; } | ||||||
void setAsDrain() { virtual_drain_ = true; } | ||||||
|
||||||
bool hasPrevNode() const { return prev_node_ != nullptr; } | ||||||
|
||||||
private: | ||||||
bool virtual_source_ = false; | ||||||
bool virtual_drain_ = false; | ||||||
int pathCost_ = std::numeric_limits<int>::max(); | ||||||
int nodeCost_ = std::numeric_limits<int>::max(); | ||||||
int prev_node_idx_ = -1; | ||||||
/*either {pin_idx, acc_point_idx} or {inst_idx, acc_pattern_idx} depending on | ||||||
* context*/ | ||||||
std::pair<int, int> idx_ = {-1, -1}; | ||||||
FlexDPNode* prev_node_ = nullptr; | ||||||
}; | ||||||
} // namespace drt |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'point' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]