Skip to content

Commit cc3d763

Browse files
committed
Merge remote-tracking branch 'origin/master' into dpl-remove-pad-fillers
2 parents 9f8f670 + 728f450 commit cc3d763

Some content is hidden

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

62 files changed

+717
-1560
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ save_flow_metrics_limits <TEST_NAME>
329329

330330
``` text
331331
openroad [-help] [-version] [-no_init] [-exit] [-gui]
332-
[-threads count|max] [-log file_name] cmd_file
332+
[-threads count|max] [-log file_name] [-db file_name] cmd_file
333333
-help show help and exit
334334
-version show version and exit
335335
-no_init do not read .openroad init file
@@ -339,6 +339,7 @@ openroad [-help] [-version] [-no_init] [-exit] [-gui]
339339
-gui start in gui mode
340340
-python start with python interpreter [limited to db operations]
341341
-log <file_name> write a log in <file_name>
342+
-db <file_name> open a .odb database at startup
342343
cmd_file source cmd_file
343344
```
344345

src/Main.cc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ int cmd_argc;
8888
char** cmd_argv;
8989
static const char* log_filename = nullptr;
9090
static const char* metrics_filename = nullptr;
91+
static const char* read_odb_filename = nullptr;
9192
static bool no_settings = false;
9293
static bool minimize = false;
9394

@@ -243,6 +244,7 @@ int main(int argc, char* argv[])
243244
std::filesystem::remove(metrics_filename, err_ignored);
244245
}
245246

247+
read_odb_filename = findCmdLineKey(argc, argv, "-db");
246248
no_settings = findCmdLineFlag(argc, argv, "-no_settings");
247249
minimize = findCmdLineFlag(argc, argv, "-minimize");
248250

@@ -449,6 +451,21 @@ static int tclAppInit(int& argc,
449451

450452
const bool gui_enabled = gui::Gui::enabled();
451453

454+
if (read_odb_filename) {
455+
std::string cmd = fmt::format("read_db {{{}}}", read_odb_filename);
456+
if (!gui_enabled) {
457+
if (Tcl_Eval(interp, cmd.c_str()) != TCL_OK) {
458+
fprintf(stderr,
459+
"Error: failed to read_db %s: %s\n",
460+
read_odb_filename,
461+
Tcl_GetStringResult(interp));
462+
exit(1);
463+
}
464+
} else {
465+
gui::Gui::get()->addRestoreStateCommand(cmd);
466+
}
467+
}
468+
452469
const char* home = getenv("HOME");
453470
if (!findCmdLineFlag(argc, argv, "-no_init") && home) {
454471
const char* restore_state_cmd = "include -echo -verbose {{{}}}";
@@ -525,7 +542,7 @@ static void showUsage(const char* prog, const char* init_filename)
525542
{
526543
printf("Usage: %s [-help] [-version] [-no_init] [-no_splash] [-exit] ", prog);
527544
printf("[-gui] [-threads count|max] [-log file_name] [-metrics file_name] ");
528-
printf("[-no_settings] [-minimize] cmd_file\n");
545+
printf("[-db file_name] [-no_settings] [-minimize] cmd_file\n");
529546
printf(" -help show help and exit\n");
530547
printf(" -version show version and exit\n");
531548
printf(" -no_init do not read %s init file\n", init_filename);
@@ -543,6 +560,7 @@ static void showUsage(const char* prog, const char* init_filename)
543560
printf(" -log <file_name> write a log in <file_name>\n");
544561
printf(
545562
" -metrics <file_name> write metrics in <file_name> in JSON format\n");
563+
printf(" -db <file_name> open a .odb database at startup\n");
546564
printf(" cmd_file source cmd_file\n");
547565
}
548566

src/cts/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ cc_library(
1919
"src/CtsObserver.h",
2020
"src/HTreeBuilder.h",
2121
"src/LatencyBalancer.h",
22-
"src/LevelBalancer.h",
2322
"src/SinkClustering.h",
2423
"src/TreeBuilder.h",
2524
"src/Util.h",
@@ -41,7 +40,6 @@ cc_library(
4140
"src/CtsOptions.cpp",
4241
"src/HTreeBuilder.cpp",
4342
"src/LatencyBalancer.cpp",
44-
"src/LevelBalancer.cpp",
4543
"src/SinkClustering.cpp",
4644
"src/TechChar.cpp",
4745
"src/TreeBuilder.cpp",

src/cts/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ set_cts_config
151151
[-sink_clustering_levels levels]
152152
[-sink_clustering_max_diameter max_diameter]
153153
[-sink_clustering_size cluster_size]
154+
[-skip_nets <list_of_clk_nets_to_skip>]
154155
[-tree_buf <buf>]
155156
[-wire_unit wire_unit]
156157
```
@@ -176,6 +177,7 @@ set_cts_config
176177
| `-sink_clustering_max_diameter` | Specifies maximum diameter (in microns) of sink cluster for the register tree. The allowed values are integers `[0, MAX_INT]`. If this is not specified the diameter will be automatically chosen between `50, 100 or 200`, based on the tree buffer max cap. |
177178
| `-sink_clustering_size` | Specifies the maximum number of sinks per cluster for the register tree. The allowed values are integers `[0, MAX_INT]`. If this is not specified the size will be automatically chosen between `10, 20 or 30` based on the tree buffer max cap. |
178179
| `-sink_clustering_levels` | ... |
180+
| `-skip_nets` | Tcl list containing the clock nets to be skipped (e.g. `{net1, net2}`). If the net is a root clock net, the whole clock is skipped, otherwise only the subnet specified is skipped. |
179181
| `-wire_unit` | Minimum unit distance between buffers for a specific wire. If this parameter is omitted, the code gets the value from ten times the height of `-root_buffer`. |
180182

181183
### Report CTS configuration
@@ -208,6 +210,7 @@ reset_cts_config
208210
[-sink_clustering_levels]
209211
[-sink_clustering_max_diameter]
210212
[-sink_clustering_size]
213+
[-skip_nets]
211214
[-tree_buf]
212215
[-wire_unit]
213216
```

src/cts/include/cts/TritonCTS.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,6 @@ class TritonCTS
208208
void setAllClocksPropagated();
209209
void repairClockNets();
210210
void balanceMacroRegisterLatencies();
211-
float getVertexClkArrival(sta::Vertex* sinkVertex,
212-
odb::dbNet* topNet,
213-
odb::dbITerm* iterm);
214-
void computeAveSinkArrivals(TreeBuilder* builder, sta::Graph* graph);
215-
void computeSinkArrivalRecur(odb::dbNet* topClokcNet,
216-
odb::dbITerm* iterm,
217-
float& sumArrivals,
218-
unsigned& numSinks,
219-
sta::Graph* graph);
220-
bool propagateClock(odb::dbITerm* input);
221-
void adjustLatencies(TreeBuilder* macroBuilder, TreeBuilder* registerBuilder);
222-
void computeTopBufferDelay(TreeBuilder* builder);
223-
odb::dbInst* insertDelayBuffer(odb::dbInst* driver,
224-
const std::string& clockName,
225-
int locX,
226-
int locY);
227211

228212
sta::dbSta* openSta_ = nullptr;
229213
sta::dbNetwork* network_ = nullptr;

src/cts/src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ add_library(cts_lib
1414
TechChar.cpp
1515
TritonCTS.cpp
1616
Clustering.cpp
17-
LevelBalancer.cpp
1817
LatencyBalancer.cpp
1918
CtsOptions.cpp
2019
)

src/cts/src/CtsOptions.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ class CtsOptions : public odb::dbBlockCallBackObj
125125
clockNetsObjs_ = nets;
126126
}
127127
std::vector<odb::dbNet*> getClockNetsObjs() const { return clockNetsObjs_; }
128+
void setSkipNets(odb::dbNet* nets) { skipNets_.push_back(nets); }
129+
std::vector<odb::dbNet*> getSkipNets() const { return skipNets_; }
130+
std::string getSkipNetsToString() const
131+
{
132+
std::ostringstream skip_nets_names;
133+
for (const odb::dbNet* db_net : skipNets_) {
134+
skip_nets_names << db_net->getConstName() << " ";
135+
}
136+
return skip_nets_names.str();
137+
}
138+
void resetSkipNets() { skipNets_.clear(); }
128139
void setMetricsFile(const std::string& metricFile)
129140
{
130141
metricFile_ = metricFile;
@@ -266,8 +277,6 @@ class CtsOptions : public odb::dbBlockCallBackObj
266277
return macroSinkClustersSizeSet_;
267278
}
268279
unsigned getNumStaticLayers() const { return numStaticLayers_; }
269-
void setBalanceLevels(bool balance) { balanceLevels_ = balance; }
270-
bool getBalanceLevels() const { return balanceLevels_; }
271280
void setNumStaticLayers(unsigned num) { numStaticLayers_ = num; }
272281
void resetNumStaticLayers() { numStaticLayers_ = 0; }
273282
void setSinkBuffer(const std::string& buffer) { sinkBuffer_ = buffer; }
@@ -389,11 +398,11 @@ class CtsOptions : public odb::dbBlockCallBackObj
389398
bool macroMaxDiameterSet_ = false;
390399
unsigned macroSinkClustersSize_ = 4;
391400
bool macroSinkClustersSizeSet_ = true;
392-
bool balanceLevels_ = false;
393401
unsigned sinkClusteringLevels_ = 0;
394402
unsigned numStaticLayers_ = 0;
395403
std::vector<std::string> bufferList_;
396404
std::vector<odb::dbNet*> clockNetsObjs_;
405+
std::vector<odb::dbNet*> skipNets_;
397406
utl::Logger* logger_ = nullptr;
398407
stt::SteinerTreeBuilder* sttBuilder_ = nullptr;
399408
bool obsAware_ = true;

src/cts/src/LatencyBalancer.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ int LatencyBalancer::run()
4545
33,
4646
"Balancing latency for clock {}",
4747
root_->getClock().getSdcName());
48-
worseDelay_ = std::numeric_limits<float>::min();
49-
delayBufIndex_ = 0;
5048
initSta();
5149
findLeafBuilders(root_);
5250
buildGraph(root_->getTopInputNet());
@@ -136,8 +134,8 @@ void LatencyBalancer::buildGraph(odb::dbNet* clkInputNet)
136134
}
137135
int builderSrcId = graph_.size();
138136
GraphNode builderSrcNode
139-
= GraphNode(builderSrcId, rootSrcName, rootOutputITerm);
140-
graph_.push_back(builderSrcNode);
137+
= GraphNode(builderSrcId, std::move(rootSrcName), rootOutputITerm);
138+
graph_.push_back(std::move(builderSrcNode));
141139

142140
std::stack<int> visitNode;
143141
visitNode.push(builderSrcId);
@@ -164,7 +162,7 @@ void LatencyBalancer::buildGraph(odb::dbNet* clkInputNet)
164162
odb::dbInst* sinkInst = sinkIterm->getInst();
165163
std::string sinkName = sinkInst->getName();
166164
GraphNode sinkNode = GraphNode(sinkId, sinkName, sinkIterm);
167-
graph_.push_back(sinkNode);
165+
graph_.push_back(std::move(sinkNode));
168166
graph_[driverId].childrenIds.push_back(sinkId);
169167

170168
if (inst2builder_.find(sinkName) != inst2builder_.end()) {
@@ -440,7 +438,7 @@ void LatencyBalancer::balanceLatencies(int nodeId)
440438
if (!previouBufToInsert) {
441439
previouBufToInsert = bufToInsert;
442440
sinksInput.clear();
443-
sinksInput = children;
441+
sinksInput = std::move(children);
444442
continue;
445443
}
446444

@@ -449,7 +447,7 @@ void LatencyBalancer::balanceLatencies(int nodeId)
449447
= insertDelayBuffers(numBuffers, srcX, srcY, sinksInput);
450448

451449
sinksInput.clear();
452-
sinksInput = children;
450+
sinksInput = std::move(children);
453451
sinksInput.push_back(delauBuffInput);
454452

455453
previouBufToInsert = bufToInsert;

src/cts/src/LatencyBalancer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ class LatencyBalancer
6666
network_(network),
6767
openSta_(sta),
6868
wireSegmentUnit_(scalingUnit),
69-
capPerDBU_(capPerDBU)
69+
capPerDBU_(capPerDBU),
70+
worseDelay_(std::numeric_limits<float>::min()),
71+
delayBufIndex_(0)
7072
{
7173
}
7274

@@ -115,9 +117,9 @@ class LatencyBalancer
115117
sta::dbSta* openSta_ = nullptr;
116118
sta::Graph* timingGraph_ = nullptr;
117119
double wireSegmentUnit_;
118-
float worseDelay_;
119120
float bufferDelay_;
120121
double capPerDBU_;
122+
float worseDelay_;
121123
int delayBufIndex_;
122124
std::vector<GraphNode> graph_;
123125
std::map<std::string, TreeBuilder*> inst2builder_;

0 commit comments

Comments
 (0)