Skip to content

Commit aee42e2

Browse files
committed
Added a new attribute mix_max_period to give a min/max limit based on clock period.
`finish__timing__wns_percent_delay` rule is removed because it can be covered by `finish__timing__setup__ws`. Signed-off-by: Jaehyun Kim <[email protected]>
1 parent 917131b commit aee42e2

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

flow/util/genRuleFile.py

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ def gen_rule_file(
3939
# - Apply tighter margin on timing__setup__ws than timing__setup__tns
4040
# because WNS is more important.
4141
# - Apply the consistent margins on timing__setup__* and timing__hold__*
42-
# - Using 'period' mode for timing__setup__ws is conceptually right.
43-
# But it can cause smaller timing__setup__ws than timing__setup__tns,
44-
# which does not make sense. So we use 'mode=padding' for setup__ws now.
42+
# - 'min_max_period' is used for timing__setup__* and timing__hold__*
43+
# to give small margin to avoid failures by small violations.
4544

4645
# dict format
4746
# 'metric_name': {
@@ -102,31 +101,31 @@ def gen_rule_file(
102101
"mode": "padding",
103102
"padding": 5,
104103
"min_max": min,
105-
"min_max_direct": 0,
104+
"min_max_period": 5,
106105
"round_value": False,
107106
"compare": ">=",
108107
},
109108
"cts__timing__setup__tns": {
110109
"mode": "padding",
111110
"padding": 20,
112111
"min_max": min,
113-
"min_max_direct": 0,
112+
"min_max_period": 5,
114113
"round_value": False,
115114
"compare": ">=",
116115
},
117116
"cts__timing__hold__ws": {
118117
"mode": "padding",
119118
"padding": 5,
120119
"min_max": min,
121-
"min_max_direct": 0,
120+
"min_max_period": 5,
122121
"round_value": False,
123122
"compare": ">=",
124123
},
125124
"cts__timing__hold__tns": {
126125
"mode": "padding",
127126
"padding": 20,
128127
"min_max": min,
129-
"min_max_direct": 0,
128+
"min_max_period": 5,
130129
"round_value": False,
131130
"compare": ">=",
132131
},
@@ -144,31 +143,31 @@ def gen_rule_file(
144143
"mode": "padding",
145144
"padding": 5,
146145
"min_max": min,
147-
"min_max_direct": 0,
146+
"min_max_period": 5,
148147
"round_value": False,
149148
"compare": ">=",
150149
},
151150
"globalroute__timing__setup__tns": {
152151
"mode": "padding",
153152
"padding": 20,
154153
"min_max": min,
155-
"min_max_direct": 0,
154+
"min_max_period": 5,
156155
"round_value": False,
157156
"compare": ">=",
158157
},
159158
"globalroute__timing__hold__ws": {
160159
"mode": "padding",
161160
"padding": 5,
162161
"min_max": min,
163-
"min_max_direct": 0,
162+
"min_max_period": 5,
164163
"round_value": False,
165164
"compare": ">=",
166165
},
167166
"globalroute__timing__hold__tns": {
168167
"mode": "padding",
169168
"padding": 20,
170169
"min_max": min,
171-
"min_max_direct": 0,
170+
"min_max_period": 5,
172171
"round_value": False,
173172
"compare": ">=",
174173
},
@@ -202,31 +201,31 @@ def gen_rule_file(
202201
"mode": "padding",
203202
"padding": 5,
204203
"min_max": min,
205-
"min_max_direct": 0,
204+
"min_max_period": 5,
206205
"round_value": False,
207206
"compare": ">=",
208207
},
209208
"detailedroute__timing__setup__tns": {
210209
"mode": "padding",
211210
"padding": 20,
212211
"min_max": min,
213-
"min_max_direct": 0,
212+
"min_max_period": 5,
214213
"round_value": False,
215214
"compare": ">=",
216215
},
217216
"detailedroute__timing__hold__ws": {
218217
"mode": "padding",
219218
"padding": 5,
220219
"min_max": min,
221-
"min_max_direct": 0,
220+
"min_max_period": 5,
222221
"round_value": False,
223222
"compare": ">=",
224223
},
225224
"detailedroute__timing__hold__tns": {
226225
"mode": "padding",
227226
"padding": 20,
228227
"min_max": min,
229-
"min_max_direct": 0,
228+
"min_max_period": 5,
230229
"round_value": False,
231230
"compare": ">=",
232231
},
@@ -235,31 +234,31 @@ def gen_rule_file(
235234
"mode": "padding",
236235
"padding": 5,
237236
"min_max": min,
238-
"min_max_direct": 0,
237+
"min_max_period": 5,
239238
"round_value": False,
240239
"compare": ">=",
241240
},
242241
"finish__timing__setup__tns": {
243242
"mode": "padding",
244243
"padding": 20,
245244
"min_max": min,
246-
"min_max_direct": 0,
245+
"min_max_period": 5,
247246
"round_value": False,
248247
"compare": ">=",
249248
},
250249
"finish__timing__hold__ws": {
251250
"mode": "padding",
252251
"padding": 5,
253252
"min_max": min,
254-
"min_max_direct": 0,
253+
"min_max_period": 5,
255254
"round_value": False,
256255
"compare": ">=",
257256
},
258257
"finish__timing__hold__tns": {
259258
"mode": "padding",
260259
"padding": 20,
261260
"min_max": min,
262-
"min_max_direct": 0,
261+
"min_max_period": 5,
263262
"round_value": False,
264263
"compare": ">=",
265264
},
@@ -269,14 +268,6 @@ def gen_rule_file(
269268
"round_value": True,
270269
"compare": "<=",
271270
},
272-
"finish__timing__wns_percent_delay": {
273-
"mode": "padding",
274-
"padding": 20,
275-
"min_max": min,
276-
"min_max_sum": -10,
277-
"round_value": False,
278-
"compare": ">=",
279-
},
280271
}
281272

282273
ops = {
@@ -350,10 +341,14 @@ def gen_rule_file(
350341
rule_value = option["min_max"](
351342
rule_value + option["min_max_sum"], option["min_max_sum"]
352343
)
344+
elif "min_max_period" in option.keys():
345+
rule_value = option["min_max"](
346+
rule_value, -period * option["min_max_period"] / 100.0
347+
)
353348
else:
354349
print(
355350
f"[ERROR] Metric {field} has 'min_max' field but no "
356-
"'min_max_direct' or 'min_max_sum' field."
351+
"'min_max_direct', 'min_max_sum', or 'min_max_period' field."
357352
)
358353
sys.exit(1)
359354

0 commit comments

Comments
 (0)