Skip to content

Commit 31be124

Browse files
committed
add openroad_autotuner executable
Signed-off-by: luarss <[email protected]>
1 parent ae2e846 commit 31be124

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-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
```

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: 11 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,6 @@ def sweep():
647647
sys.exit(1)
648648
elif args.mode == "sweep":
649649
sweep()
650+
651+
if __name__ == "__main__":
652+
main()

0 commit comments

Comments
 (0)