Skip to content

Commit 0a230da

Browse files
committed
Merge remote-tracking branch 'parallax/master'
2 parents 05b292c + 1a22c68 commit 0a230da

18 files changed

+116
-16
lines changed

doc/CodingGuidelines.txt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Naming conventions
44
directory - lowercase (directory)
55
filename - corresponding class name without prefix (Filename)
66
class - upper camel case (ClassName)
7-
member function - upper camel case (memberFunction)
7+
member function - lower camel case (memberFunction)
88
member variable - snake case with trailing underscore (member_variable_)
99
Trailing underscore prevents conflict with accessor
1010
member function name.
@@ -105,6 +105,9 @@ private order.
105105
friend class Frobulator;
106106
}
107107

108+
Class member functions should not be defined inside the class unless they
109+
are simple accessors that return a member variable.
110+
108111
Avoid using [] to lookup a map value because it creates a key/null value
109112
pair if the lookup fails. Use map::find or sta::Map::findKey instead.
110113

@@ -114,6 +117,11 @@ Avoid all use of global variables as "caches", even if they are thread local.
114117
OpenSTA goes to great lengths to minimize global state variable that prevent
115118
multiple instances of the Sta class from coexisting.
116119

120+
Do not use thread_local variables. They are essentially global
121+
variables so they prevent multiple instances of an Sta object from
122+
existing concurrently, so they sbould also be avoided. Use stack state
123+
in each thread instead.
124+
117125
Regression Tests
118126
................
119127

@@ -129,11 +137,17 @@ Tests log files and results are in test/results. The result/test.log
129137
is compared to test.ok to determine if a test passes.
130138

131139
Test scripts are written in tcl and live in the /test directory.
132-
Compress large liberty, verilog, and spef, files and use existing
133-
libraries to prevent repository bloat.
140+
Compress large liberty, verilog, and spef, files., Use small or
141+
existing verilog and liberty files to prevent repository bloat.
134142

135143
The test script should use a one line comment at the beginning of the
136144
file so head -1 can show what it is for. Use file names to roughly
137145
group regressions and use numeric suffixes to distinguish them.
138146

139147
The script test/save_ok saves a test/results/<test>.log to test/<test>.okfile.
148+
149+
To add a new regression:
150+
add <test>.tcl to /tcl
151+
add <test> name to test/regression_vars.tcl
152+
run <test> with test/regression <test>
153+
use save_ok <test> to save the log file to >test>.log

include/sta/Delay.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "StaConfig.hh"
2828

29+
// IWYU pragma: begin_exports
2930
#if (SSTA == 1)
3031
// Delays are Normal PDFs.
3132
#include "DelayNormal1.hh"
@@ -36,6 +37,7 @@
3637
// Delays are floats.
3738
#include "DelayFloat.hh"
3839
#endif
40+
// IWYU pragma: end_exports
3941

4042
namespace sta {
4143

search/ClkInfo.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,10 @@ ClkInfo::to_string(const StaState *sta) const
166166
const Pin *crpr_clk_pin = crpr_clk_path_.vertex(sta)->pin();
167167
result += " crpr ";
168168
result += network->pathName(crpr_clk_pin);
169-
result += "/";
169+
result += " ";
170170
result += std::to_string(crpr_clk_path_.tag(sta)->index());
171+
result += "/";
172+
result += crpr_clk_path_.minMax(sta)->to_string();
171173
}
172174

173175
if (is_gen_clk_src_path_)

search/Crpr.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,21 @@ CheckCrpr::findCrpr(const Path *src_clk_path,
221221
int level_diff = src_level - tgt_level;
222222
if (level_diff >= 0) {
223223
src_clk_path2 = src_clk_path2->prevPath();
224-
if (src_clk_path2 == nullptr)
224+
if (src_clk_path2 == nullptr
225+
|| src_clk_path2->isNull())
225226
break;
226227
src_level = src_clk_path2->vertex(this)->level();
227228
}
228229
if (level_diff <= 0) {
229230
tgt_clk_path2 = tgt_clk_path2->prevPath();
230-
if (tgt_clk_path2 == nullptr)
231+
if (tgt_clk_path2 == nullptr
232+
|| tgt_clk_path2->isNull())
231233
break;
232234
tgt_level = tgt_clk_path2->vertex(this)->level();
233235
}
234236
}
235-
if (src_clk_path2 && tgt_clk_path2
237+
if (src_clk_path2 && !src_clk_path2->isNull()
238+
&& tgt_clk_path2 && !tgt_clk_path2->isNull()
236239
&& (src_clk_path2->transition(this) == tgt_clk_path2->transition(this)
237240
|| same_pin)) {
238241
debugPrint(debug_, "crpr", 2, "crpr pin %s",

search/Latches.cc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ Latches::latchRequired(const Path *data_path,
7575
time_given_to_startpoint = 0.0;
7676
}
7777
else if (enable_path && disable_path) {
78+
debugPrint(debug_, "latch", 1, "latch %s",
79+
sdc_network_->pathName(data_path->pin(this)));
7880
Delay open_latency, latency_diff, max_borrow;
7981
float nom_pulse_width, open_uncertainty;
8082
Crpr open_crpr, crpr_diff;
@@ -102,8 +104,7 @@ Latches::latchRequired(const Path *data_path,
102104
+ PathEnd::checkSetupMcpAdjustment(data_clk_edge, enable_clk_edge, mcp,
103105
1, sdc_)
104106
+ open_crpr;
105-
debugPrint(debug_, "latch", 1, "latch data %s %s enable %s",
106-
network_->pathName(data_path->pin(this)),
107+
debugPrint(debug_, "latch", 1, "data %s enable %s",
107108
delayAsString(data_arrival, this),
108109
delayAsString(enable_arrival, this));
109110
if (delayLessEqual(data_arrival, enable_arrival, this)) {
@@ -145,6 +146,11 @@ Latches::latchRequired(const Path *data_path,
145146
adjusted_data_arrival = data_arrival;
146147
time_given_to_startpoint = 0.0;
147148
}
149+
debugPrint(debug_, "latch", 2, "req %s borrow %s time_given %s adj_arrival %s",
150+
delayAsString(required, this),
151+
delayAsString(borrow, this),
152+
delayAsString(time_given_to_startpoint, this),
153+
delayAsString(adjusted_data_arrival, this));
148154
}
149155

150156
void
@@ -209,6 +215,16 @@ Latches::latchBorrowInfo(const Path *data_path,
209215
open_crpr = 0.0;
210216
crpr_diff = 0.0;
211217
}
218+
debugPrint(debug_, "latch", 2, "nom_width %s open_lat %s lat_diff %s open_uncert %s",
219+
delayAsString(nom_pulse_width, this),
220+
delayAsString(open_latency, this),
221+
delayAsString(latency_diff, this),
222+
delayAsString(open_uncertainty, this));
223+
debugPrint(debug_, "latch", 2, "open_crpr %s crpr_diff %s open_uncert %s max_borrow %s",
224+
delayAsString(open_crpr, this),
225+
delayAsString(crpr_diff, this),
226+
delayAsString(open_uncertainty, this),
227+
borrow_limit_exists ? delayAsString(max_borrow, this) : "none");
212228
}
213229

214230
void

search/Search.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,11 @@ ArrivalVisitor::pruneCrprArrivals()
13821382
delayAsString(max_crpr, this),
13831383
delayAsString(max_arrival_max_crpr, this));
13841384
Arrival arrival = tag_bldr_->arrival(path_index);
1385-
if (delayGreater(max_arrival_max_crpr, arrival, min_max, this)) {
1385+
// Latch D->Q path uses enable min so crpr clk path min/max
1386+
// does not match the path min/max.
1387+
if (delayGreater(max_arrival_max_crpr, arrival, min_max, this)
1388+
&& clk_info_no_crpr->crprClkPath(this)->minMax(this)
1389+
== clk_info->crprClkPath(this)->minMax(this)) {
13861390
debugPrint(debug_, "search", 3, " pruned %s",
13871391
tag->to_string(this).c_str());
13881392
path_itr = path_index_map.erase(path_itr);

search/Search.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ define_cmd_args "report_checks" \
421421
[-sort_by_slack]\
422422
[-path_group group_name]\
423423
[-format full|full_clock|full_clock_expanded|short|end|slack_only|summary|json]\
424-
[-fields capacitance|slew|input_pin|net|src_attr]\
424+
[-fields capacitance|slew|fanout|input_pin|net|src_attr]\
425425
[-digits digits]\
426426
[-no_line_splits]\
427427
[> filename] [>> filename]}

search/Tag.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,15 @@ Tag::to_string(bool report_index,
138138
result += network->pathName(clk_src);
139139
}
140140

141+
result += " crpr_pin ";
141142
const Path *crpr_clk_path = clk_info_->crprClkPath(sta);
142-
if (crpr_clk_path != nullptr) {
143-
result += " crpr_pin ";
143+
if (crpr_clk_path) {
144144
result += network->pathName(crpr_clk_path->pin(sta));
145+
result += " ";
146+
result += crpr_clk_path->minMax(sta)->to_string();
145147
}
148+
else
149+
result += "null";
146150

147151
if (input_delay_) {
148152
result += " input ";

test/package_require.ok

Whitespace-only changes.

test/package_require.tcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package require http
2+
package require msgcat
3+
package require opt

0 commit comments

Comments
 (0)