Skip to content

Commit c426002

Browse files
committed
Merge branch 'master' of https://github.com/The-OpenROAD-Project-private/OpenROAD into secure-store-hier-flag-in-odb
Signed-off-by: Jaehyun Kim <[email protected]>
2 parents f161cf9 + 88a8f4c commit c426002

File tree

99 files changed

+2017
-1702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2017
-1702
lines changed

.gemini/config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
memory_config:
2+
disabled: false
3+
code_review:
4+
pull_request_opened:
5+
help: false
6+
summary: false
7+
code_review: true
8+
include_drafts: true

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ bazel_dep(name = "bazel-orfs")
146146
# To bump version, run: bazelisk run @bazel-orfs//:bump
147147
git_override(
148148
module_name = "bazel-orfs",
149-
commit = "e96d7d2a4405a99fc689b4f2f676d3bda7b9430b",
149+
commit = "1e862b169d97dc0fec5db106559640886e7fd7d0",
150150
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
151151
)
152152

@@ -155,10 +155,10 @@ orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
155155
# To bump version, run: bazelisk run @bazel-orfs//:bump
156156
orfs.default(
157157
# Official image https://hub.docker.com/r/openroad/orfs/tags
158-
image = "docker.io/openroad/orfs:v3.0-4362-gaec1d8d35",
158+
image = "docker.io/openroad/orfs:v3.0-4367-g79b6a48ab",
159159
# Use OpenROAD of this repo instead of from the docker image
160160
openroad = "//:openroad",
161-
sha256 = "5f94f0481d1339493918208060be116da101405251bce22691ac4b2d662d276e",
161+
sha256 = "0d0dd3d8d346360a71f6325ce776a984c5a6296fc6e51956b53f136e1dd13462",
162162
)
163163
use_repo(orfs, "com_github_nixos_patchelf_download")
164164
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cts/src/TechChar.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
950950
odb::dbNet* net = nullptr;
951951
// clang-format off
952952
debugPrint(logger_, CTS, "tech char", 1, "*createPatterns for #nodes = {}"
953-
" #topologies = {}", setupWirelength, numberOfNodes, numberOfTopologies);
953+
" #topologies = {}", numberOfNodes, numberOfTopologies);
954954
// clang-format on
955955
// For each possible topology...
956956
for (unsigned solutionCounterInt = 0; solutionCounterInt < numberOfTopologies;
@@ -1051,9 +1051,6 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
10511051
tmp << "OUT";
10521052
debugPrint(logger_, CTS, "tech char", 1, tmp.str());
10531053
topology.outPort = outPortPin;
1054-
if (isPureWire) {
1055-
topology.instVector.push_back(nullptr);
1056-
}
10571054
topology.isPureWire = isPureWire;
10581055
topology.netVector.push_back(net);
10591056
topology.nodesWithoutBufVector.push_back(nodesWithoutBuf);
@@ -1478,6 +1475,7 @@ std::vector<TechChar::ResultData> TechChar::characterizationPostProcess()
14781475
unsigned maxResultCapacitance = 0;
14791476
unsigned minResultSlew = std::numeric_limits<unsigned>::max();
14801477
unsigned maxResultSlew = 0;
1478+
14811479
std::vector<ResultData> convertedSolutions;
14821480
for (ResultData solution : selectedSolutions) {
14831481
if (solution.pinSlew <= options_->getMaxCharSlew()) {
@@ -1530,6 +1528,7 @@ std::vector<TechChar::ResultData> TechChar::characterizationPostProcess()
15301528
convertedSolutions.push_back(convertedResult);
15311529
}
15321530
}
1531+
15331532
// Sets the min and max values and returns the result vector.
15341533
minSlew_ = minResultSlew;
15351534
maxSlew_ = maxResultSlew;
@@ -1631,10 +1630,10 @@ void TechChar::create()
16311630
masterNames_.size(), solution.instVector.size());
16321631
// clang-format on
16331632
// For each possible buffer combination (different sizes).
1634-
unsigned buffersUpdate
1633+
unsigned buffersCombinations
16351634
= getBufferingCombo(masterNames_.size(), solution.instVector.size());
16361635

1637-
if (buffersUpdate == 0) {
1636+
if (buffersCombinations == 0) {
16381637
continue;
16391638
}
16401639

@@ -1697,12 +1696,13 @@ void TechChar::create()
16971696
}
16981697
}
16991698
// If the solution is not a pure-wire, update the buffer topologies.
1700-
if (!solution.isPureWire) {
1699+
if (!solution.isPureWire && buffersCombinations > 1) {
17011700
updateBufferTopologies(solution);
17021701
}
1703-
// For pure-wire solution buffersUpdate == 1, so it only runs once.
1704-
buffersUpdate--;
1705-
} while (buffersUpdate != 0);
1702+
// For pure-wire solution buffersCombinations == 1, so it only runs
1703+
// once.
1704+
buffersCombinations--;
1705+
} while (buffersCombinations != 0);
17061706
}
17071707
openStaChar_.reset(nullptr);
17081708
}

src/mpl/src/MplObserver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MplObserver
4444
const std::vector<odb::Rect>& placement_blockages)
4545
{
4646
}
47-
virtual void setBundledNets(const std::vector<BundledNet>& bundled_nets) {}
47+
virtual void setNets(const BundledNetList& nets) {}
4848
virtual void setShowBundledNets(bool show_bundled_nets) {}
4949
virtual void setShowClustersIds(bool show_clusters_ids) {}
5050
virtual void setSkipSteps(bool skip_steps) {}

src/mpl/src/SimulatedAnnealingCore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void SimulatedAnnealingCore<T>::initSequencePair()
118118

119119
// access functions
120120
template <class T>
121-
void SimulatedAnnealingCore<T>::setNets(const std::vector<BundledNet>& nets)
121+
void SimulatedAnnealingCore<T>::setNets(const BundledNetList& nets)
122122
{
123123
nets_ = nets;
124124
}
@@ -286,7 +286,7 @@ void SimulatedAnnealingCore<T>::calWirelength()
286286

287287
template <class T>
288288
float SimulatedAnnealingCore<T>::computeNetsWireLength(
289-
const std::vector<BundledNet>& nets) const
289+
const BundledNetList& nets) const
290290
{
291291
float nets_wire_length = 0.0;
292292
float nets_weight_sum = 0.0;

src/mpl/src/SimulatedAnnealingCore.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class SimulatedAnnealingCore
6464
{
6565
number_of_sequence_pair_macros_ = number_of_sequence_pair_macros;
6666
};
67-
void setNets(const std::vector<BundledNet>& nets);
67+
void setNets(const BundledNetList& nets);
6868
void setFences(const std::map<int, odb::Rect>& fences);
6969
void setGuides(const std::map<int, odb::Rect>& guides);
7070
void setInitialSequencePair(const SequencePair& sequence_pair);
@@ -118,7 +118,7 @@ class SimulatedAnnealingCore
118118
virtual void calPenalty() = 0;
119119
void calOutlinePenalty();
120120
void calWirelength();
121-
float computeNetsWireLength(const std::vector<BundledNet>& nets) const;
121+
float computeNetsWireLength(const BundledNetList& nets) const;
122122
int64_t computeWLForClusterOfUnplacedIOPins(const T& macro,
123123
const T& unplaced_ios,
124124
float net_weight) const;
@@ -154,7 +154,7 @@ class SimulatedAnnealingCore
154154

155155
int number_of_sequence_pair_macros_ = 0;
156156

157-
std::vector<BundledNet> nets_;
157+
BundledNetList nets_;
158158
std::map<int, odb::Rect> fences_; // Macro Id -> Fence
159159
std::map<int, odb::Rect> guides_; // Macro Id -> Guide
160160

src/mpl/src/clusterEngine.cpp

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ ClusteringEngine::ClusteringEngine(odb::dbBlock* block,
4242

4343
void ClusteringEngine::run()
4444
{
45-
design_metrics_ = computeModuleMetrics(block_->getTopModule());
4645
init();
4746

4847
if (!tree_->has_unfixed_macros) {
@@ -88,17 +87,18 @@ void ClusteringEngine::setTree(PhysicalHierarchy* tree)
8887
// initialize the tree with data from the design.
8988
void ClusteringEngine::init()
9089
{
90+
setDieArea();
91+
setFloorplanShape();
92+
93+
design_metrics_ = computeModuleMetrics(block_->getTopModule());
94+
9195
const std::vector<odb::dbInst*> unfixed_macros = getUnfixedMacros();
9296
if (unfixed_macros.empty()) {
9397
tree_->has_unfixed_macros = false;
9498
logger_->info(MPL, 17, "No unfixed macros.");
9599
return;
96100
}
97101

98-
setDieArea();
99-
setFloorplanShape();
100-
searchForFixedInstsInsideFloorplanShape();
101-
102102
tree_->macro_with_halo_area = computeMacroWithHaloArea(unfixed_macros);
103103
const float inst_area_with_halos
104104
= tree_->macro_with_halo_area + design_metrics_->getStdCellArea();
@@ -154,25 +154,6 @@ void ClusteringEngine::setFloorplanShape()
154154
tree_->floorplan_shape = block_->getCoreArea().intersect(tree_->global_fence);
155155
}
156156

157-
void ClusteringEngine::searchForFixedInstsInsideFloorplanShape()
158-
{
159-
for (odb::dbInst* inst : block_->getInsts()) {
160-
odb::dbMaster* master = inst->getMaster();
161-
162-
if (master->isBlock() || master->isCover()) {
163-
continue;
164-
}
165-
166-
if (inst->isFixed()
167-
&& inst->getBBox()->getBox().overlaps(tree_->floorplan_shape)) {
168-
logger_->error(MPL,
169-
50,
170-
"Found fixed instance {} inside the floorplan area.",
171-
inst->getName());
172-
}
173-
}
174-
}
175-
176157
Metrics* ClusteringEngine::computeModuleMetrics(odb::dbModule* module)
177158
{
178159
unsigned int num_std_cell = 0;
@@ -183,15 +164,25 @@ Metrics* ClusteringEngine::computeModuleMetrics(odb::dbModule* module)
183164
const odb::Rect& core = block_->getCoreArea();
184165

185166
for (odb::dbInst* inst : module->getInsts()) {
186-
if (isIgnoredInst(inst)) {
187-
continue;
188-
}
189-
190-
int64_t inst_area = computeArea(inst);
191-
192-
if (inst->isBlock()) { // a macro
167+
if (inst->isBlock()) {
193168
num_macro += 1;
194-
macro_area += inst_area;
169+
macro_area += computeArea(inst);
170+
171+
if (inst->isFixed()) {
172+
logger_->info(MPL, 62, "Found fixed macro {}.", inst->getName());
173+
174+
if (!inst->getBBox()->getBox().overlaps(tree_->floorplan_shape)) {
175+
ignorable_macros_.insert(inst);
176+
logger_->info(MPL,
177+
63,
178+
"{} is outside the macro placement area and will be "
179+
"ignored.",
180+
inst->getName());
181+
continue;
182+
}
183+
184+
tree_->has_fixed_macros = true;
185+
}
195186

196187
auto macro = std::make_unique<HardMacro>(
197188
inst, tree_->halo_width, tree_->halo_height);
@@ -205,14 +196,17 @@ Metrics* ClusteringEngine::computeModuleMetrics(odb::dbModule* module)
205196
generateMacroAndCoreDimensionsTable(macro.get(), core));
206197
}
207198

208-
if (macro->isFixed()) {
209-
tree_->has_fixed_macros = true;
210-
}
211-
212199
tree_->maps.inst_to_hard[inst] = std::move(macro);
213-
} else {
200+
} else if (inst->isFixed() && !inst->getMaster()->isCover()
201+
&& inst->getBBox()->getBox().overlaps(tree_->floorplan_shape)) {
202+
logger_->error(MPL,
203+
50,
204+
"Found fixed non-macro instance {} inside the macro "
205+
"placement area.",
206+
inst->getName());
207+
} else if (!isIgnoredInst(inst)) {
214208
num_std_cell += 1;
215-
std_cell_area += inst_area;
209+
std_cell_area += computeArea(inst);
216210
}
217211
}
218212

@@ -856,12 +850,15 @@ DataFlowHypergraph ClusteringEngine::computeHypergraph(
856850
return graph;
857851
}
858852

859-
/* static */
860853
bool ClusteringEngine::isIgnoredInst(odb::dbInst* inst)
861854
{
855+
if (inst->isBlock()
856+
&& (ignorable_macros_.find(inst) != ignorable_macros_.end())) {
857+
return true;
858+
}
859+
862860
odb::dbMaster* master = inst->getMaster();
863-
return master->isPad() || master->isCover() || master->isEndCap()
864-
|| inst->getITerms().empty();
861+
return master->isPad() || master->isCover() || master->isEndCap();
865862
}
866863

867864
// Forward or Backward DFS search to find sequential paths from/to IO pins based

src/mpl/src/clusterEngine.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <set>
1111
#include <string>
1212
#include <unordered_map>
13+
#include <unordered_set>
1314
#include <utility>
1415
#include <vector>
1516

@@ -161,7 +162,7 @@ class ClusteringEngine
161162

162163
int getNumberOfIOs(Cluster* target) const;
163164

164-
static bool isIgnoredInst(odb::dbInst* inst);
165+
bool isIgnoredInst(odb::dbInst* inst);
165166

166167
private:
167168
using UniqueClusterQueue = std::queue<std::unique_ptr<Cluster>>;
@@ -179,7 +180,6 @@ class ClusteringEngine
179180
std::vector<odb::dbInst*> getUnfixedMacros();
180181
void setDieArea();
181182
void setFloorplanShape();
182-
void searchForFixedInstsInsideFloorplanShape();
183183
int64_t computeMacroWithHaloArea(
184184
const std::vector<odb::dbInst*>& unfixed_macros);
185185
std::vector<odb::dbInst*> getIOPads() const;
@@ -316,11 +316,12 @@ class ClusteringEngine
316316
// The register distance between two macros for
317317
// them to be considered connected when creating data flow.
318318
const int max_num_of_hops_ = 5;
319-
320319
const float minimum_connection_ratio_{0.08};
321320

322321
int first_io_bundle_id_{-1};
323322
IOBundleSpans io_bundle_spans_;
323+
324+
std::unordered_set<odb::dbInst*> ignorable_macros_;
324325
};
325326

326327
} // namespace mpl

0 commit comments

Comments
 (0)