mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
feat(precheck): oas file support #134
replace legacy .gds.br support with .oas file support
This commit is contained in:
@@ -9,7 +9,6 @@ import time
|
|||||||
import traceback
|
import traceback
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
import brotli
|
|
||||||
import gdstk
|
import gdstk
|
||||||
import klayout.db as pya
|
import klayout.db as pya
|
||||||
import klayout.rdb as rdb
|
import klayout.rdb as rdb
|
||||||
@@ -282,17 +281,16 @@ def main():
|
|||||||
gds_stem = args.gds.removesuffix(".gds")
|
gds_stem = args.gds.removesuffix(".gds")
|
||||||
gds_temp = None
|
gds_temp = None
|
||||||
gds_file = args.gds
|
gds_file = args.gds
|
||||||
elif args.gds.endswith(".gds.br"):
|
elif args.gds.endswith(".oas"):
|
||||||
gds_stem = args.gds.removesuffix(".gds.br")
|
gds_stem = args.gds.removesuffix(".oas")
|
||||||
gds_temp = tempfile.NamedTemporaryFile(suffix=".gds", delete=False)
|
gds_temp = tempfile.NamedTemporaryFile(suffix=".gds", delete=False)
|
||||||
gds_file = gds_temp.name
|
gds_file = gds_temp.name
|
||||||
logging.info(f"decompressing {args.gds} to {gds_file}")
|
logging.info(f"Converting {args.gds} to {gds_file}")
|
||||||
with open(args.gds, "rb") as f:
|
layout = pya.Layout()
|
||||||
data = f.read()
|
layout.read(args.gds)
|
||||||
with open(gds_file, "wb") as f:
|
layout.write(gds_file)
|
||||||
f.write(brotli.decompress(data))
|
|
||||||
else:
|
else:
|
||||||
raise PrecheckFailure("Layout file extension is neither .gds nor .gds.br")
|
raise PrecheckFailure("Layout file extension is neither .gds nor .oas")
|
||||||
|
|
||||||
tech = args.tech
|
tech = args.tech
|
||||||
if tech not in tech_names:
|
if tech not in tech_names:
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ name = "tt-precheck"
|
|||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"brotli",
|
|
||||||
"gdstk",
|
"gdstk",
|
||||||
"klayout>=0.28.17.post1,<0.29.0",
|
"klayout>=0.28.17.post1,<0.29.0",
|
||||||
"numpy<2",
|
"numpy<2",
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
#
|
#
|
||||||
# This file is autogenerated by pip-compile with Python 3.13
|
# This file is autogenerated by pip-compile with Python 3.12
|
||||||
# by the following command:
|
# by the following command:
|
||||||
#
|
#
|
||||||
# pip-compile
|
# pip-compile
|
||||||
#
|
#
|
||||||
brotli==1.1.0
|
|
||||||
# via tt-precheck (pyproject.toml)
|
|
||||||
gdstk==0.9.52
|
gdstk==0.9.52
|
||||||
# via tt-precheck (pyproject.toml)
|
# via tt-precheck (pyproject.toml)
|
||||||
iniconfig==2.0.0
|
iniconfig==2.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user