Skip to content

Commit

Permalink
feat(shuttle): use .oas from user projects when available
Browse files Browse the repository at this point in the history
  • Loading branch information
htfab committed Jan 13, 2025
1 parent b9e2e9f commit bcee6f1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions shuttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import brotli # type: ignore
import git
import klayout.db as pya
import yaml

from config import Config
Expand All @@ -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)))
Expand Down Expand Up @@ -203,6 +212,12 @@ def copy_macros(self):
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"]
Expand Down

0 comments on commit bcee6f1

Please sign in to comment.