forked from TinyTapeout/tt05-vhdl-demo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.py
42 lines (33 loc) · 1.07 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
#
# OpenLane2 build script to harden the tt_top macro inside
# the classic user_project_wrapper
#
# Copyright (c) 2023 Sylvain Munaut <[email protected]>
# SPDX-License-Identifier: Apache-2.0
#
import argparse
import json
import os
from openlane.common import get_opdks_rev
from openlane.flows.misc import OpenInKLayout
from openlane.flows.classic import VHDLClassic
import volare
if __name__ == '__main__':
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--open-in-klayout", action="store_true", help="Open last run in KLayout")
args = parser.parse_args()
config = vars(args)
pdk_root = volare.get_volare_home(os.getenv('PDK_ROOT'))
volare.enable(pdk_root, "sky130", get_opdks_rev())
# Load fixed required config for UPW
flow_cfg = json.loads(open('config.json', 'r').read())
# Run flow
flow_class = OpenInKLayout if args.open_in_klayout else VHDLClassic
flow = flow_class(
flow_cfg,
design_dir = ".",
pdk_root = pdk_root,
pdk = "sky130A",
)
flow.start(tag = "wokwi")