Skip to content

Commit 30c4ad9

Browse files
committed
Merge branch 'master' of https://github.com/The-OpenROAD-Project-private/OpenROAD into secure-default_logger-for-test
2 parents dad8cf8 + 6db0147 commit 30c4ad9

22 files changed

+257
-68
lines changed

src/gpl/src/nesterovPlace.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,11 +1209,12 @@ nesterovDbCbk::nesterovDbCbk(NesterovPlace* nesterov_place)
12091209
void NesterovPlace::createCbkGCell(odb::dbInst* db_inst)
12101210
{
12111211
auto gcell_index = nbc_->createCbkGCell(db_inst);
1212-
for (auto& nesterov : nbVec_) {
1213-
// TODO: manage regions, not every NB should create a
1214-
// gcell.
1215-
nesterov->createCbkGCell(db_inst, gcell_index);
1216-
}
1212+
// Always create gcell on top-level
1213+
nbVec_[0]->createCbkGCell(db_inst, gcell_index);
1214+
// TODO: create new gcell in its proper region
1215+
// for (auto& nesterov : nbVec_) {
1216+
// nesterov->createCbkGCell(db_inst, gcell_index);
1217+
// }
12171218
}
12181219

12191220
void NesterovPlace::destroyCbkGCell(odb::dbInst* db_inst)

src/grt/src/GlobalRouter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ std::vector<int> GlobalRouter::routeLayerLengths(odb::dbNet* db_net)
574574
// dbu wirelength for wires, via count for vias
575575
std::vector<int> layer_lengths(tech->getLayerCount());
576576

577-
if (!db_net->getSigType().isSupply()) {
577+
if (!db_net->getSigType().isSupply() && !db_net->isSpecial()
578+
&& db_net->getSWires().empty() && !db_net->isConnectedByAbutment()) {
578579
GRoute& route = routes[db_net];
579580
std::set<RoutePt> route_pts;
580581
// Compute wirelengths from route segments

src/gui/src/heatMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void HeatMapDataSource::dumpToFile(const std::string& file)
9797

9898
const double dbu_to_micron = block_->getDbUnitsPerMicron();
9999

100-
csv << "x0,y0,x1,y1,value" << std::endl;
100+
csv << "x0,y0,x1,y1,value (" << getValueUnits() << ")" << '\n';
101101
for (const auto& map_col : map_) {
102102
for (const auto& map_value : map_col) {
103103
if (!map_value->has_value) {

src/mpl/src/SimulatedAnnealingCore.cpp

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -263,62 +263,68 @@ void SimulatedAnnealingCore<T>::calOutlinePenalty()
263263
template <class T>
264264
void SimulatedAnnealingCore<T>::calWirelength()
265265
{
266-
// Initialization
267-
wirelength_ = 0.0;
268266
if (core_weights_.wirelength <= 0.0) {
269267
return;
270268
}
271269

272-
// calculate the total net weight
273-
float tot_net_weight = 0.0;
274-
for (const auto& net : nets_) {
275-
tot_net_weight += net.weight;
276-
}
270+
wirelength_ = computeNetsWireLength(nets_);
277271

278-
if (tot_net_weight <= 0.0) {
279-
return;
272+
if (graphics_) {
273+
graphics_->setWirelengthPenalty({.name = "Wire Length",
274+
.weight = core_weights_.wirelength,
275+
.value = wirelength_,
276+
.normalization_factor = norm_wirelength_});
280277
}
278+
}
279+
280+
template <class T>
281+
float SimulatedAnnealingCore<T>::computeNetsWireLength(
282+
const std::vector<BundledNet>& nets) const
283+
{
284+
float nets_wire_length = 0.0;
285+
float nets_weight_sum = 0.0;
281286

282287
for (const auto& net : nets_) {
283-
T& source = macros_[net.terminals.first];
284-
T& target = macros_[net.terminals.second];
288+
nets_weight_sum += net.weight;
289+
}
285290

286-
if (target.isClusterOfUnplacedIOPins()) {
287-
computeWLForClusterOfUnplacedIOPins(source, target, net.weight);
288-
continue;
289-
}
291+
if (nets_weight_sum != 0.0) {
292+
for (const auto& net : nets) {
293+
const T& source = macros_[net.terminals.first];
294+
const T& target = macros_[net.terminals.second];
290295

291-
const float x1 = source.getPinX();
292-
const float y1 = source.getPinY();
293-
const float x2 = target.getPinX();
294-
const float y2 = target.getPinY();
295-
wirelength_ += net.weight * (std::abs(x2 - x1) + std::abs(y2 - y1));
296-
}
296+
if (target.isClusterOfUnplacedIOPins()) {
297+
nets_wire_length
298+
+= computeWLForClusterOfUnplacedIOPins(source, target, net.weight);
299+
} else {
300+
const float x1 = source.getPinX();
301+
const float y1 = source.getPinY();
302+
const float x2 = target.getPinX();
303+
const float y2 = target.getPinY();
297304

298-
// normalization
299-
wirelength_ = wirelength_ / tot_net_weight
300-
/ (outline_.getHeight() + outline_.getWidth());
305+
nets_wire_length
306+
+= net.weight * (std::abs(x2 - x1) + std::abs(y2 - y1));
307+
}
308+
}
301309

302-
if (graphics_) {
303-
graphics_->setWirelengthPenalty({"Wire Length",
304-
core_weights_.wirelength,
305-
wirelength_,
306-
norm_wirelength_});
310+
nets_wire_length = nets_wire_length / nets_weight_sum
311+
/ (outline_.getHeight() + outline_.getWidth());
307312
}
313+
314+
return nets_wire_length;
308315
}
309316

310317
template <class T>
311-
void SimulatedAnnealingCore<T>::computeWLForClusterOfUnplacedIOPins(
318+
double SimulatedAnnealingCore<T>::computeWLForClusterOfUnplacedIOPins(
312319
const T& macro,
313320
const T& unplaced_ios,
314-
const float net_weight)
321+
const float net_weight) const
315322
{
316323
// To generate maximum cost.
317324
const float max_dist = die_area_.getPerimeter() / 2;
318325

319326
if (isOutsideTheOutline(macro)) {
320-
wirelength_ += net_weight * max_dist;
321-
return;
327+
return net_weight * max_dist;
322328
}
323329

324330
const odb::Point macro_location(block_->micronsToDbu(macro.getPinX()),
@@ -341,7 +347,7 @@ void SimulatedAnnealingCore<T>::computeWLForClusterOfUnplacedIOPins(
341347
= computeDistToNearestRegion(macro_location, {constraint}, nullptr);
342348
}
343349

344-
wirelength_ += net_weight * block_->dbuToMicrons(smallest_distance);
350+
return net_weight * block_->dbuToMicrons(smallest_distance);
345351
}
346352

347353
// We consider the macro outside the outline based on the location of

src/mpl/src/SimulatedAnnealingCore.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ class SimulatedAnnealingCore
116116
virtual void calPenalty() = 0;
117117
void calOutlinePenalty();
118118
void calWirelength();
119-
void computeWLForClusterOfUnplacedIOPins(const T& macro,
120-
const T& unplaced_ios,
121-
float net_weight);
119+
float computeNetsWireLength(const std::vector<BundledNet>& nets) const;
120+
double computeWLForClusterOfUnplacedIOPins(const T& macro,
121+
const T& unplaced_ios,
122+
float net_weight) const;
122123
bool isOutsideTheOutline(const T& macro) const;
123124
void calGuidancePenalty();
124125
void calFencePenalty();

src/odb/include/odb/dbId.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class dbId
2020
dbId(unsigned int id) : id_(id) {}
2121

2222
operator unsigned int() const { return id_; }
23-
unsigned int& id() { return id_; }
23+
unsigned int id() const { return id_; }
2424

2525
bool isValid() const { return id_ != invalid; }
2626
void clear() { id_ = invalid; }

src/odb/src/db/dbJournal.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,9 @@ void dbJournal::redo_updateNetField()
10101010
case _dbNet::kNonDefaultRule: {
10111011
uint prev_rule;
10121012
log_.pop(prev_rule);
1013-
log_.pop(net->non_default_rule_.id());
1013+
unsigned int id;
1014+
log_.pop(id);
1015+
net->non_default_rule_ = id;
10141016
bool prev_block_rule;
10151017
bool cur_block_rule;
10161018
log_.pop(prev_block_rule);

src/psm/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ set_pdnsim_source_settings
145145
[-bump_size size]
146146
[-bump_interval interval]
147147
[-strap_track_pitch pitch]
148+
[-external_resistance resistance]
148149
```
149150

150151
#### Options
@@ -154,7 +155,8 @@ set_pdnsim_source_settings
154155
| `-bump_dx`,`-bump_dy` | Set the bump pitch to decide the voltage source location. The default bump pitch is 140um. |
155156
| `-bump_size` | Set the bump size. The default bump size is 70um. |
156157
| `-bump_interval` | Set the bump population interval, this is used to depopulate the bump grid to emulate signals and other power connections. The default bump pitch is 3. |
157-
| `-strap_track_pitch` | Sets the track pitck to use for moduling voltage sources as straps. The default is 10x. |
158+
| `-strap_track_pitch` | Sets the track pitch to use for modeling voltage sources as straps. The default is 10x. |
159+
| `-external_resistance` | Set to model the resistance of the package or power network outside the chip/block. The default value is 0.0. |
158160

159161
### Insert Decap Cells
160162
The `insert_decap` command inserts decap cells in the areas with the highest

src/psm/include/psm/pdnsim.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ class PDNSim : public odb::dbBlockCallBackObj
5656

5757
// Straps
5858
int strap_track_pitch = 10;
59+
60+
// Source resistance
61+
float resistance = 0.0; // Ohms
5962
};
6063

6164
using IRDropByPoint = std::map<odb::Point, double>;

src/psm/src/connection.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,23 @@ TermConnection::TermConnection(Node* node0, Node* node1)
204204
{
205205
}
206206

207-
Connection::Resistance TermConnection::getResistance(
208-
const ResistanceMap& res_map) const
207+
std::string TermConnection::describe() const
209208
{
210-
return kResistance;
209+
return "Terminal Connection";
211210
}
212211

213-
std::string TermConnection::describe() const
212+
/////////////////////////////
213+
214+
FixedResistanceConnection::FixedResistanceConnection(Node* node0,
215+
Node* node1,
216+
Resistance resistance)
217+
: Connection(node0, node1), res_(resistance)
214218
{
215-
return "Terminal Connection";
219+
}
220+
221+
std::string FixedResistanceConnection::describe() const
222+
{
223+
return "Fixed Resistance Connection";
216224
}
217225

218226
} // namespace psm

0 commit comments

Comments
 (0)