Skip to content

Commit 8a070e6

Browse files
authored
Merge pull request #2788 from luarss/topic/exec-script
[Autotuner] openroad_autotuner entrypoint
2 parents 1a629f5 + ae94fa5 commit 8a070e6

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

docs/user/InstructionsForAutoTuner.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,23 +124,23 @@ The following commands should be run from `./tools/AutoTuner`.
124124

125125
#### Tune only
126126

127-
* AutoTuner: `python3 -m autotuner.distributed tune -h`
127+
* AutoTuner: `openroad_autotuner tune -h`
128128

129129
Example:
130130

131131
```shell
132-
python3 -m autotuner.distributed --design gcd --platform sky130hd \
132+
openroad_autotuner --design gcd --platform sky130hd \
133133
--config ../../flow/designs/sky130hd/gcd/autotuner.json \
134134
tune --samples 5
135135
```
136136
#### Sweep only
137137

138-
* Parameter sweeping: `python3 -m autotuner.distributed sweep -h`
138+
* Parameter sweeping: `openroad_autotuner sweep -h`
139139

140140
Example:
141141

142142
```shell
143-
python3 -m autotuner.distributed --design gcd --platform sky130hd \
143+
openroad_autotuner --design gcd --platform sky130hd \
144144
--config src/autotuner/distributed-sweep-example.json \
145145
sweep
146146
```

flow/test/test_autotuner.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ if [ "$PLATFORM" == "asap7" ] && [ "$DESIGN_NAME" == "gcd" ]; then
2323

2424
echo "Running AutoTuner resume test (only once)"
2525
python3 -m unittest tools.AutoTuner.test.resume_check.ResumeCheck.test_tune_resume
26+
27+
echo "Running AutoTuner binary check (only once)"
28+
openroad_autotuner -h
2629
fi
2730

2831
echo "Running Autotuner plotting smoke test"

tools/AutoTuner/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ readme = "README.md"
1010
requires-python = ">= 3.8"
1111
dynamic = ["dependencies", "optional-dependencies"]
1212

13+
[project.scripts]
14+
openroad_autotuner = "autotuner.distributed:main"
15+
1316
[tool.setuptools.dynamic]
1417
dependencies = { file = ["requirements.txt"] }
1518
optional-dependencies.dev = { file = ["requirements-dev.txt"] }

tools/AutoTuner/src/autotuner/distributed.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
Dependencies are documented in pip format at distributed-requirements.txt
44
55
For both sweep and tune modes:
6-
python3 -m autotuner.distributed -h
6+
openroad_autotuner -h
77
88
Note: the order of the parameters matter.
99
Arguments --design, --platform and --config are always required and should
1010
precede the <mode>.
1111
1212
AutoTuner:
13-
python3 -m autotuner.distributed tune -h
14-
python3 -m autotuner.distributed --design gcd --platform sky130hd \
13+
openroad_autotuner tune -h
14+
openroad_autotuner --design gcd --platform sky130hd \
1515
--config ../designs/sky130hd/gcd/autotuner.json \
1616
tune
1717
Example:
1818
1919
Parameter sweeping:
20-
python3 -m autotuner.distributed sweep -h
20+
openroad_autotuner sweep -h
2121
Example:
22-
python3 -m autotuner.distributed --design gcd --platform sky130hd \
23-
--config distributed-sweep-example.json \
24-
sweep
22+
openroad_autotuner --design gcd --platform sky130hd \
23+
--config distributed-sweep-example.json \
24+
sweep
2525
"""
2626

2727
import argparse
@@ -594,7 +594,7 @@ def sweep():
594594
print("[INFO TUN-0010] Sweep complete.")
595595

596596

597-
if __name__ == "__main__":
597+
def main():
598598
args = parse_arguments()
599599

600600
# Read config and original files before handling where to run in case we
@@ -647,3 +647,7 @@ def sweep():
647647
sys.exit(1)
648648
elif args.mode == "sweep":
649649
sweep()
650+
651+
652+
if __name__ == "__main__":
653+
main()

0 commit comments

Comments
 (0)