Skip to content

Commit caf2561

Browse files
committed
Merge remote-tracking branch 'origin/master' into bmap
2 parents 81baed1 + 8c911c4 commit caf2561

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

src/gui/src/mainWindow.cpp

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,17 @@ void MainWindow::showGlobalConnect()
18701870

18711871
void MainWindow::openDesign()
18721872
{
1873-
const QString filefilter = "OpenDB (*.odb *.ODB)";
1873+
const std::vector<QString> exts{".odb", ".odb.gz", ".db", ".db.gz"};
1874+
1875+
QString filefilter = "OpenDB (";
1876+
for (const auto& ext : exts) {
1877+
if (filefilter.length() != 8) {
1878+
filefilter += " ";
1879+
}
1880+
filefilter += "*" + ext;
1881+
filefilter += " *" + ext.toUpper();
1882+
}
1883+
filefilter += ")";
18741884
const QString file = QFileDialog::getOpenFileName(
18751885
this, "Open Design", QString(), filefilter);
18761886

@@ -1879,15 +1889,21 @@ void MainWindow::openDesign()
18791889
}
18801890

18811891
try {
1882-
if (file.endsWith(".odb", Qt::CaseInsensitive)) {
1883-
open_->setEnabled(false);
1884-
ord::OpenRoad::openRoad()->readDb(file.toStdString().c_str());
1885-
logger_->warn(utl::GUI,
1886-
77,
1887-
"Timing data is not stored in {} and must be loaded "
1888-
"separately, if needed.",
1889-
file.toStdString());
1890-
} else {
1892+
bool found = false;
1893+
for (const auto& ext : exts) {
1894+
if (file.endsWith(ext, Qt::CaseInsensitive)) {
1895+
open_->setEnabled(false);
1896+
ord::OpenRoad::openRoad()->readDb(file.toStdString().c_str());
1897+
logger_->warn(utl::GUI,
1898+
77,
1899+
"Timing data is not stored in {} and must be loaded "
1900+
"separately, if needed.",
1901+
file.toStdString());
1902+
found = true;
1903+
break;
1904+
}
1905+
}
1906+
if (!found) {
18911907
logger_->error(utl::GUI, 76, "Unknown filetype: {}", file.toStdString());
18921908
}
18931909
} catch (const std::exception&) {
@@ -1898,7 +1914,17 @@ void MainWindow::openDesign()
18981914

18991915
void MainWindow::saveDesign()
19001916
{
1901-
const QString filefilter = "OpenDB (*.odb *.ODB)";
1917+
const std::vector<QString> exts{".odb", ".odb.gz"};
1918+
1919+
QString filefilter = "OpenDB (";
1920+
for (const auto& ext : exts) {
1921+
if (filefilter.length() != 8) {
1922+
filefilter += " ";
1923+
}
1924+
filefilter += "*" + ext;
1925+
filefilter += " *" + ext.toUpper();
1926+
}
1927+
filefilter += ")";
19021928
const QString file = QFileDialog::getSaveFileName(
19031929
this, "Save Design", QString(), filefilter);
19041930

src/pad/src/PadPlacer.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ void PlacerPadPlacer::placeInstanceSimple(odb::dbInst* inst,
912912

913913
std::map<odb::dbInst*, int> PlacerPadPlacer::initialPoolMapping() const
914914
{
915-
const auto insts = getInsts();
915+
const auto& insts = getInsts();
916916

917917
std::vector<float> position(insts.size());
918918
for (int i = 0; i < insts.size(); i++) {
@@ -1076,7 +1076,7 @@ std::map<odb::dbInst*, int> PlacerPadPlacer::poolAdjacentViolators(
10761076
const std::map<odb::dbInst*, int>& initial_positions) const
10771077
{
10781078
const double dbus = getBlock()->getDbUnitsPerMicron();
1079-
const auto insts = getInsts();
1079+
const auto& insts = getInsts();
10801080
std::vector<float> weights(insts.size());
10811081
std::fill(weights.begin(), weights.end(), 1.0);
10821082

@@ -1201,8 +1201,7 @@ bool PlacerPadPlacer::padSpreading(
12011201
{
12021202
bool has_violations = false;
12031203

1204-
const auto insts = getInsts();
1205-
const auto inst_widths = getInstWidths();
1204+
const auto& insts = getInsts();
12061205
const double dbus = getBlock()->getDbUnitsPerMicron();
12071206
const int site_width = getRow()->getSpacing();
12081207

@@ -1351,8 +1350,7 @@ bool PlacerPadPlacer::padSpreading(
13511350
std::map<odb::dbInst*, int> PlacerPadPlacer::padSpreading(
13521351
const std::map<odb::dbInst*, int>& initial_positions) const
13531352
{
1354-
const auto insts = getInsts();
1355-
const auto inst_widths = getInstWidths();
1353+
const auto& inst_widths = getInstWidths();
13561354

13571355
// Snap all positions to row index
13581356
std::map<odb::dbInst*, std::unique_ptr<InstAnchors>> positions;

0 commit comments

Comments
 (0)