feat(shuttle): use .oas from user projects when available

This commit is contained in:
htfab
2025-01-13 15:40:14 +02:00
committed by Uri Shaked
parent b9e2e9fc08
commit 9d3ca84b00
+15
View File
@@ -7,6 +7,7 @@ from typing import List, Set
import brotli # type: ignore import brotli # type: ignore
import git import git
import klayout.db as pya
import yaml import yaml
from config import Config from config import Config
@@ -29,6 +30,14 @@ def copy_print_decompress(src: str, dest: str):
logging.info(f" -> {dest} (decompressed)") logging.info(f" -> {dest} (decompressed)")
def copy_print_convert(src: str, dest: str):
os.makedirs(os.path.dirname(dest), exist_ok=True)
layout = pya.Layout()
layout.read(src)
layout.write(dest)
logging.info(f" -> {dest} (converted)")
def copy_print_glob(pattern: str, dest_dir: str): def copy_print_glob(pattern: str, dest_dir: str):
for file in glob.glob(pattern): for file in glob.glob(pattern):
copy_print(file, os.path.join(dest_dir, os.path.basename(file))) copy_print(file, os.path.join(dest_dir, os.path.basename(file)))
@@ -203,6 +212,12 @@ class ShuttleConfig:
copy_print_decompress( copy_print_decompress(
file, os.path.join("tt-multiplexer/ol2/tt_top/gds", decompressed_name) file, os.path.join("tt-multiplexer/ol2/tt_top/gds", decompressed_name)
) )
# Convert .oas files to .gds
for file in glob.glob("projects/*/*.oas"):
converted_name = os.path.splitext(os.path.basename(file))[0] + ".gds"
copy_print_convert(
file, os.path.join("tt-multiplexer/ol2/tt_top/gds", converted_name)
)
copy_print_glob("projects/*/*.lef", "tt-multiplexer/ol2/tt_top/lef") copy_print_glob("projects/*/*.lef", "tt-multiplexer/ol2/tt_top/lef")
copy_print_glob("projects/*/*.v", "tt-multiplexer/ol2/tt_top/verilog") copy_print_glob("projects/*/*.v", "tt-multiplexer/ol2/tt_top/verilog")
macros = ["tt_um_chip_rom", "tt_ctrl", "tt_mux"] macros = ["tt_um_chip_rom", "tt_ctrl", "tt_mux"]