-
Notifications
You must be signed in to change notification settings - Fork 755
CTS techChar: add max wl constraint #9145
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
base: master
Are you sure you want to change the base?
Changes from all commits
3d41598
dff02c7
c10411b
97b4b1f
06c17e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
|
|
||
| #include "Clustering.h" | ||
| #include "SinkClustering.h" | ||
| #include "TechChar.h" | ||
| #include "Util.h" | ||
| #include "odb/db.h" | ||
| #include "odb/isotropy.h" | ||
|
|
@@ -1407,23 +1408,44 @@ void HTreeBuilder::computeLevelTopology(const unsigned level, | |
| = options_->getVertexBufferDistance() / (techChar_->getLengthUnit() * 2); | ||
| int remainingLength | ||
| = options_->getBufferDistance() / (techChar_->getLengthUnit()); | ||
| int currWl = 0; | ||
| unsigned inputCap = minInputCap_; | ||
| unsigned inputSlew = 1; | ||
| if (level > 1) { | ||
| const LevelTopology& previousLevel = topologyForEachLevel_[level - 2]; | ||
| inputCap = previousLevel.getOutputCap(); | ||
| inputSlew = previousLevel.getOutputSlew(); | ||
| remainingLength = previousLevel.getRemainingLength(); | ||
| currWl = previousLevel.getCurrWl(); | ||
| } | ||
|
|
||
| const unsigned SLEW_THRESHOLD = options_->getMaxSlew(); | ||
| const unsigned INIT_TOLERANCE = 1; | ||
|
|
||
| int WIRELENGTH_THRESHOLD; | ||
|
Member
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. This is an ordinary variable so use lower case naming. |
||
| // If max wirelength is 0, set it as slew threshold * maximum topology | ||
| // wirelength. This will behave as if there was no max wirelength threshold. | ||
| if (!options_->getMaxWl()) { | ||
| WIRELENGTH_THRESHOLD = SLEW_THRESHOLD * techChar_->getMaxSegmentLength(); | ||
| } else { | ||
| WIRELENGTH_THRESHOLD = options_->getMaxWl() / techChar_->getLengthUnit(); | ||
| } | ||
|
|
||
| debugPrint( | ||
| logger_, CTS, "tech char", 1, "slew threshold = {}", SLEW_THRESHOLD); | ||
| debugPrint(logger_, | ||
| CTS, | ||
| "tech char", | ||
| 1, | ||
| "wirelength threshold = {}", | ||
| WIRELENGTH_THRESHOLD); | ||
| unsigned length = 0; | ||
| for (int charSegLength = techChar_->getMaxSegmentLength(); charSegLength >= 1; | ||
| --charSegLength) { | ||
| const unsigned numWires = (segmentLength - length) / charSegLength; | ||
|
|
||
| if (numWires >= 1) { | ||
| debugPrint(logger_, CTS, "tech char", 1, "curr wl = {}", currWl); | ||
| for (int wireCount = 0; wireCount < numWires; ++wireCount) { | ||
| unsigned outCap = 0, outSlew = 0; | ||
| unsigned key = 0; | ||
|
|
@@ -1474,9 +1496,11 @@ void HTreeBuilder::computeLevelTopology(const unsigned level, | |
| inputSlew, | ||
| inputCap, | ||
| SLEW_THRESHOLD, | ||
| WIRELENGTH_THRESHOLD, | ||
| INIT_TOLERANCE, | ||
| outSlew, | ||
| outCap); | ||
| outCap, | ||
| currWl); | ||
| } | ||
|
|
||
| if (key == std::numeric_limits<unsigned>::max()) { | ||
|
|
@@ -1501,6 +1525,7 @@ void HTreeBuilder::computeLevelTopology(const unsigned level, | |
|
|
||
| topology.setOutputSlew(inputSlew); | ||
| topology.setOutputCap(inputCap); | ||
| topology.setCurrWl(currWl); | ||
|
|
||
| computeBranchingPoints(level, topology); | ||
| topologyForEachLevel_.push_back(topology); | ||
|
|
@@ -1529,9 +1554,11 @@ unsigned HTreeBuilder::computeMinDelaySegment(const unsigned length, | |
| const unsigned inputSlew, | ||
| const unsigned inputCap, | ||
| const unsigned slewThreshold, | ||
| const int wirelengthThreshold, | ||
| const unsigned tolerance, | ||
| unsigned& outputSlew, | ||
| unsigned& outputCap) const | ||
| unsigned& outputCap, | ||
| int& currWl) const | ||
| { | ||
| unsigned minKey = std::numeric_limits<unsigned>::max(); | ||
| unsigned minDelay = std::numeric_limits<unsigned>::max(); | ||
|
|
@@ -1548,6 +1575,17 @@ unsigned HTreeBuilder::computeMinDelaySegment(const unsigned length, | |
| return; | ||
| } | ||
|
|
||
| if (seg.isBuffered() | ||
| && (currWl + seg.getWl2FisrtBuffer() > wirelengthThreshold)) { | ||
|
Member
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. Please fix the typo in getWl2FisrtBuffer -> getWl2FirstBuffer |
||
| return; | ||
| } | ||
|
|
||
| if (!seg.isBuffered() | ||
| && (currWl + seg.getWl2FisrtBuffer() | ||
| > wirelengthThreshold - techChar_->getMinSegmentLength())) { | ||
| return; | ||
| } | ||
|
Comment on lines
+1578
to
+1587
Contributor
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. If if (wirelengthThreshold > 0) {
if (seg.isBuffered()
&& (currWl + seg.getWl2FisrtBuffer() > wirelengthThreshold)) {
return;
}
if (!seg.isBuffered()
&& (currWl + seg.getWl2FisrtBuffer()
> wirelengthThreshold - techChar_->getMinSegmentLength())) {
return;
}
} |
||
|
|
||
| if (seg.getDelay() < minDelay) { | ||
| minDelay = seg.getDelay(); | ||
| minKey = key; | ||
|
|
@@ -1567,6 +1605,7 @@ unsigned HTreeBuilder::computeMinDelaySegment(const unsigned length, | |
| const WireSegment& bestBufSegment = techChar_->getWireSegment(minBufKey); | ||
| outputSlew = bestBufSegment.getOutputSlew(); | ||
| outputCap = bestBufSegment.getLoad(); | ||
| currWl = bestBufSegment.getLastWl(); | ||
| return minBufKey; | ||
| } | ||
| if (tolerance < MAX_TOLERANCE) { | ||
|
|
@@ -1575,9 +1614,11 @@ unsigned HTreeBuilder::computeMinDelaySegment(const unsigned length, | |
| inputSlew, | ||
| inputCap, | ||
| slewThreshold, | ||
| wirelengthThreshold, | ||
| tolerance + 1, | ||
| outputSlew, | ||
| outputCap); | ||
| outputCap, | ||
| currWl); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -1590,13 +1631,22 @@ unsigned HTreeBuilder::computeMinDelaySegment(const unsigned length, | |
| inputSlew, | ||
| inputCap, | ||
| slewThreshold, | ||
| wirelengthThreshold, | ||
| tolerance + 1, | ||
| outputSlew, | ||
| outputCap); | ||
| outputCap, | ||
| currWl); | ||
| } | ||
|
|
||
| const WireSegment& bestSegment = techChar_->getWireSegment(minKey); | ||
| outputSlew = std::max((unsigned) bestSegment.getOutputSlew(), inputSlew + 1); | ||
| if (bestSegment.isBuffered()) { | ||
| outputSlew = bestSegment.getOutputSlew(); | ||
| currWl = bestSegment.getLastWl(); | ||
| } else { | ||
| outputSlew | ||
| = std::max((unsigned) bestSegment.getOutputSlew(), inputSlew + 1); | ||
| currWl += bestSegment.getLastWl(); | ||
| } | ||
| outputCap = bestSegment.getLoad(); | ||
|
|
||
| return minKey; | ||
|
|
||
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.