Skip to content

Commit b54a844

Browse files
committed
FakeRAM2.0: black-format the files the asap7 backend touches
The patch predates black-formatting FakeRAM2.0 (3388907), so the code it carried was never formatted. Formatting only. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent cc67c77 commit b54a844

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎tools/FakeRAM2.0/orfs_asap7/generate.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"leakage": 0.001,
3434
}
3535

36+
3637
def run_orfs_asap7(platform: str, out_dir: Path, json_path: Path):
3738
if platform != "asap7":
3839
sys.stderr.write(f"FakeRAM2.0 orfs_asap7: unsupported platform {platform}\n")
@@ -46,7 +47,9 @@ def run_orfs_asap7(platform: str, out_dir: Path, json_path: Path):
4647
return 1
4748

4849
out_dir.mkdir(parents=True, exist_ok=True)
49-
converted = sorted((m for m in memories if m.get("idiomatic")), key=lambda m: m["name"])
50+
converted = sorted(
51+
(m for m in memories if m.get("idiomatic")), key=lambda m: m["name"]
52+
)
5053

5154
process = Process(ASAP7_PROCESS_CONFIG)
5255
timing_data = TimingData(ASAP7_TIMING_CONFIG)
@@ -79,5 +82,7 @@ def run_orfs_asap7(platform: str, out_dir: Path, json_path: Path):
7982
with open(lef_path, "w") as f:
8083
LefExporter(ram).export(f)
8184

82-
(out_dir / "blackboxes.txt").write_text("".join(f"{m['name']}\n" for m in converted))
85+
(out_dir / "blackboxes.txt").write_text(
86+
"".join(f"{m['name']}\n" for m in converted)
87+
)
8388
return 0

‎tools/FakeRAM2.0/run.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ def get_args() -> argparse.Namespace:
3838
def main(args: argparse.Namespace):
3939
if args.orfs_asap7_backend:
4040
from pathlib import Path
41-
return run_orfs_asap7(platform="asap7", out_dir=Path(args.output_dir), json_path=Path(args.config))
41+
42+
return run_orfs_asap7(
43+
platform="asap7", out_dir=Path(args.output_dir), json_path=Path(args.config)
44+
)
4245

4346
json_data = RunUtils.get_config(args.config)
4447
# Create a process object (shared by all srams)

‎tools/FakeRAM2.0/utils/class_process.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ def get_macro_dimensions(self, width_in_bits, depth, num_banks, additional_heigh
119119

120120
total_height += additional_height
121121

122-
min_height = max(3.5, self.snap_height_nm / 1000.0 if self.snap_height_nm else 0)
122+
min_height = max(
123+
3.5, self.snap_height_nm / 1000.0 if self.snap_height_nm else 0
124+
)
123125
total_height = max(total_height, min_height)
124126

125127
return (total_width, total_height)

0 commit comments

Comments
 (0)