mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat(shuttle): use .oas from user projects when available
This commit is contained in:
+15
@@ -7,6 +7,7 @@ from typing import List, Set
|
||||
|
||||
import brotli # type: ignore
|
||||
import git
|
||||
import klayout.db as pya
|
||||
import yaml
|
||||
|
||||
from config import Config
|
||||
@@ -29,6 +30,14 @@ def copy_print_decompress(src: str, dest: str):
|
||||
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):
|
||||
for file in glob.glob(pattern):
|
||||
copy_print(file, os.path.join(dest_dir, os.path.basename(file)))
|
||||
@@ -203,6 +212,12 @@ class ShuttleConfig:
|
||||
copy_print_decompress(
|
||||
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/*/*.v", "tt-multiplexer/ol2/tt_top/verilog")
|
||||
macros = ["tt_um_chip_rom", "tt_ctrl", "tt_mux"]
|
||||
|
||||
Reference in New Issue
Block a user