Skip to content

Commit 32154ff

Browse files
authored
Merge pull request #2393 from Pinata-Consulting/variables-formalize-machine-readable
variables: formalize variables and make metainformation machine readable
2 parents cf878af + baaa665 commit 32154ff

File tree

3 files changed

+95
-40
lines changed

3 files changed

+95
-40
lines changed

flow/Makefile

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -109,46 +109,6 @@ DESIGN_CONFIG ?= ./designs/nangate45/gcd/config.mk
109109
# this file.
110110
include $(DESIGN_CONFIG)
111111

112-
# For instance Bazel needs artifacts (.odb and .rpt files) on a failure to
113-
# allow the user to save hours on re-running the failed step locally, but
114-
# when working with a Makefile flow, it is more natural to fail the step
115-
# and leave the user to manually inspect the logs and artifacts directly via
116-
# the file system.
117-
#
118-
# Set to 1 to change the behavior to generate artifacts upon failure to
119-
# e.g. do a global route. The exit code will still be non-zero on all other
120-
# failures that aren't covered by the "useful to inspect the artifacts on
121-
# failure" use-case.
122-
#
123-
# Example: just like detailed routing, a global route that fails with congestion, is not
124-
# a build failure(as in exit code non-zero), it is a successful(as in zero exit code)
125-
# global route that produce reports detailing the problem.
126-
#
127-
# Detailed route will not proceed, if there is global routing congestion
128-
#
129-
# This allows build systems, such as bazel, to create artifacts for global
130-
# and detailed route, even if the operation had problems, without having
131-
# know about the semantics between global and detailed route.
132-
#
133-
# Considering that global and detailed route can run for a long time and
134-
# use a lot of memory, this allows inspecting results on a laptop for
135-
# a build that ran on a server.
136-
export GENERATE_ARTIFACTS_ON_FAILURE ?= 0
137-
138-
# Default TNS_END_PERCENT value for post CTS timing repair
139-
# Try fixing all violating endpoints by default (reduce to 5% for runtime)
140-
export TNS_END_PERCENT ?=100
141-
142-
# Default routing layer adjustment
143-
export ROUTING_LAYER_ADJUSTMENT ?= 0.5
144-
export RECOVER_POWER ?= 0
145-
export SKIP_INCREMENTAL_REPAIR ?= 0
146-
export DETAILED_METRICS ?= 0
147-
export EQUIVALENCE_CHECK ?= 0
148-
export CORE_UTILIZATION ?=
149-
export DIE_AREA ?=
150-
export CORE_AREA ?=
151-
152112
# If we are running headless use offscreen rendering for save_image
153113
ifeq ($(DISPLAY),)
154114
export QT_QPA_PLATFORM ?= offscreen
@@ -200,6 +160,8 @@ export UTILS_DIR ?= $(FLOW_HOME)/util
200160
export SCRIPTS_DIR ?= $(FLOW_HOME)/scripts
201161
export TEST_DIR ?= $(FLOW_HOME)/test
202162

163+
$(foreach line,$(shell $(SCRIPTS_DIR)/defaults.py),$(eval export $(line)))
164+
203165
PUBLIC=nangate45 sky130hd sky130hs asap7 ihp-sg13g2 gf180
204166

205167
ifneq ($(wildcard $(PLATFORM_HOME)/$(PLATFORM)),)

flow/scripts/defaults.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python3
2+
3+
import os
4+
import yaml
5+
6+
dir_path = os.path.dirname(os.path.realpath(__file__))
7+
8+
yaml_path = os.path.join(dir_path, "defaults.yaml")
9+
with open(yaml_path, "r") as file:
10+
data = yaml.safe_load(file)
11+
12+
for key, value in data.items():
13+
if value["value"] is None:
14+
continue
15+
print(f'{key}?={value["value"]}')

flow/scripts/defaults.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
GENERATE_ARTIFACTS_ON_FAILURE:
2+
description: >
3+
For instance Bazel needs artifacts (.odb and .rpt files) on a failure to
4+
allow the user to save hours on re-running the failed step locally, but
5+
when working with a Makefile flow, it is more natural to fail the step
6+
and leave the user to manually inspect the logs and artifacts directly via
7+
the file system.
8+
9+
Set to 1 to change the behavior to generate artifacts upon failure to
10+
e.g. do a global route. The exit code will still be non-zero on all other
11+
failures that aren't covered by the "useful to inspect the artifacts on
12+
failure" use-case.
13+
14+
Example: just like detailed routing, a global route that fails with congestion, is not
15+
a build failure(as in exit code non-zero), it is a successful(as in zero exit code)
16+
global route that produce reports detailing the problem.
17+
18+
Detailed route will not proceed, if there is global routing congestion
19+
20+
This allows build systems, such as bazel, to create artifacts for global
21+
and detailed route, even if the operation had problems, without having
22+
know about the semantics between global and detailed route.
23+
24+
Considering that global and detailed route can run for a long time and
25+
use a lot of memory, this allows inspecting results on a laptop for
26+
a build that ran on a server.
27+
value: 0
28+
stages:
29+
- all
30+
31+
TNS_END_PERCENT:
32+
description: >
33+
Default TNS_END_PERCENT value for post CTS timing repair.
34+
Try fixing all violating endpoints by default (reduce to 5% for runtime).
35+
value: 100
36+
stages:
37+
- crt
38+
- floorplan
39+
- grt
40+
41+
ROUTING_LAYER_ADJUSTMENT:
42+
value: 0.5
43+
description: Default routing layer adjustment
44+
stages:
45+
- place
46+
- grt
47+
- route
48+
- final
49+
50+
RECOVER_POWER:
51+
value: 0
52+
stages:
53+
- grt
54+
SKIP_INCREMENTAL_REPAIR:
55+
value: 0
56+
stages:
57+
- grt
58+
DETAILED_METRICS:
59+
value: 0
60+
stages:
61+
- cts
62+
- grt
63+
EQUIVALENCE_CHECK:
64+
value: 0
65+
stages:
66+
- cts
67+
CORE_UTILIZATION:
68+
value: null
69+
stages:
70+
- floorplan
71+
DIE_AREA:
72+
value: null
73+
stages:
74+
- floorplan
75+
CORE_AREA:
76+
value: null
77+
stages:
78+
- floorplan

0 commit comments

Comments
 (0)