ciel 0.21.0.dev1__tar.gz → 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ciel-0.21.0.dev1 → ciel-2.0.0}/PKG-INFO +14 -14
- {ciel-0.21.0.dev1 → ciel-2.0.0}/Readme.md +11 -11
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/__main__.py +52 -103
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/build/__init__.py +10 -9
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/build/ihp_sg13g2.py +4 -4
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/click_common.py +31 -33
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/common.py +65 -72
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/families.py +2 -2
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/github.py +33 -29
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/manage.py +23 -24
- ciel-2.0.0/ciel/source.py +229 -0
- {ciel-0.21.0.dev1 → ciel-2.0.0}/pyproject.toml +5 -2
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/__init__.py +0 -0
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/__version__.py +0 -0
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/build/common.py +0 -0
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/build/gf180mcu.py +0 -0
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/build/git_multi_clone.py +0 -0
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/build/sky130.py +0 -0
- {ciel-0.21.0.dev1 → ciel-2.0.0}/ciel/py.typed +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ciel
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: An PDK builder/version manager for PDKs in the open_pdks format
|
|
5
5
|
Home-page: https://github.com/fossi-foundation/ciel
|
|
6
6
|
License: Apache-2.0
|
|
7
|
-
Author:
|
|
8
|
-
Author-email: donn
|
|
7
|
+
Author: Mohamed Gaber
|
|
8
|
+
Author-email: me@donn.website
|
|
9
9
|
Requires-Python: >=3.8
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
11
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -75,11 +75,11 @@ ciel --version
|
|
|
75
75
|
# About the builds
|
|
76
76
|
In its current inception, ciel supports builds of **sky130** and **gf180mcu** PDKs using [Open_PDKs](https://github.com/efabless/open_pdks), including the following libraries:
|
|
77
77
|
|
|
78
|
-
|sky130|gf180mcu|
|
|
78
|
+
|sky130|gf180mcu|ihp-sg13g2|
|
|
79
79
|
|-|-|-|
|
|
80
80
|
|sky130_fd_io|gf180mcu_fd_io|sg13g2_io|
|
|
81
81
|
|sky130_fd_pr|gf180mcu_fd_pr|sg13g2_pr|
|
|
82
|
-
|sky130_fd_pr_reram
|
|
82
|
+
|sky130_fd_pr_reram|gf180mcu_fd_pr|sg13g2_pr|
|
|
83
83
|
|sky130_fd_sc_hd|gf180mcu_fd_sc_mcu7t5v0|sg13g2_stdcell|
|
|
84
84
|
|sky130_ml_xx_hd|gf180mcu_fd_sc_mcu9t5v0|-|
|
|
85
85
|
|sky130_fd_sc_hvl|gf180mcu_osu_sc_gp9t3v3|-|
|
|
@@ -89,16 +89,16 @@ In its current inception, ciel supports builds of **sky130** and **gf180mcu** PD
|
|
|
89
89
|
|sky130_fd_sc_hs|-|-|
|
|
90
90
|
|sky130_sram_macros|gf180mcu_fd_ip_sram|sg13g2_sram|
|
|
91
91
|
|
|
92
|
-
Builds for sky130 and gf180mcu are identified by their [**open_pdks**](https://github.com/rtimothyedwards/open_pdks) commit hashes. Builds for
|
|
92
|
+
Builds for sky130 and gf180mcu are identified by their [**open_pdks**](https://github.com/rtimothyedwards/open_pdks) commit hashes. Builds for ihp-sg13g2 are identified by their [**IHP-Open-PDK**](https://github.com/ihp-gmbh/ihp-open-pdk) commit hashes.
|
|
93
93
|
|
|
94
94
|
# Usage
|
|
95
95
|
Ciel requires a so-called **PDK Root**. This PDK root can be anywhere on your computer, but by default it's the folder `~/.ciel` in your home directory. If you have the variable `PDK_ROOT` set, ciel will use that instead. You can also manually override both values by supplying the `--pdk-root` commandline argument.
|
|
96
96
|
|
|
97
97
|
## Listing All Available PDKs
|
|
98
|
-
To list all available pre-built
|
|
98
|
+
To list all available pre-built PDK families hosted in this repository, you can just invoke `ciel ls-remote --pdk-family <pdk-family>`.
|
|
99
99
|
|
|
100
100
|
```sh
|
|
101
|
-
$ ciel ls-remote --pdk sky130
|
|
101
|
+
$ ciel ls-remote --pdk-family sky130
|
|
102
102
|
Pre-built sky130 PDK versions
|
|
103
103
|
├── 44a43c23c81b45b8e774ae7a84899a5a778b6b0b (2022.08.16) (enabled)
|
|
104
104
|
├── e8294524e5f67c533c5d0c3afa0bcc5b2a5fa066 (2022.07.29) (installed)
|
|
@@ -108,7 +108,7 @@ Pre-built sky130 PDK versions
|
|
|
108
108
|
├── 8fe7f760ece2bb49b1c310e60243f0558977dae5 (2022.04.06)
|
|
109
109
|
└── 7519dfb04400f224f140749cda44ee7de6f5e095 (2022.02.10)
|
|
110
110
|
|
|
111
|
-
$ ciel ls-remote --pdk gf180mcu
|
|
111
|
+
$ ciel ls-remote --pdk-family gf180mcu
|
|
112
112
|
Pre-built gf180mcu PDK versions
|
|
113
113
|
└── 120b0bd69c745825a0b8b76f364043a1cd08bb6a (2022.09.22)
|
|
114
114
|
```
|
|
@@ -116,10 +116,10 @@ Pre-built gf180mcu PDK versions
|
|
|
116
116
|
It includes a hash of the commit of the relevant repo used for that particular build, the date that this commit was created, and whether you already installed this PDK and/or if it is the currently enabled PDK.
|
|
117
117
|
|
|
118
118
|
## Listing Installed PDKs
|
|
119
|
-
Typing `ciel ls --pdk <pdk>` in the terminal shows you your PDK Root and the PDKs you currently have installed.
|
|
119
|
+
Typing `ciel ls --pdk-family <pdk-family>` in the terminal shows you your PDK Root and the PDKs you currently have installed.
|
|
120
120
|
|
|
121
121
|
```sh
|
|
122
|
-
$ ciel ls --pdk sky130
|
|
122
|
+
$ ciel ls --pdk-family sky130
|
|
123
123
|
/home/test/ciel/sky130/versions
|
|
124
124
|
├── 44a43c23c81b45b8e774ae7a84899a5a778b6b0b (2022.08.16) (enabled)
|
|
125
125
|
├── e8294524e5f67c533c5d0c3afa0bcc5b2a5fa066 (2022.07.29)
|
|
@@ -130,12 +130,12 @@ $ ciel ls --pdk sky130
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
## Downloading and Enabling PDKs
|
|
133
|
-
You can enable a particular sky130 PDK by invoking `ciel enable --pdk <pdk> <open_pdks commit hash>`. This will automatically download that particular version of the PDK, if found, and set it as your currently used PDK.
|
|
133
|
+
You can enable a particular sky130 PDK by invoking `ciel enable --pdk-family <pdk-family> <open_pdks commit hash>`. This will automatically download that particular version of the PDK, if found, and set it as your currently used PDK.
|
|
134
134
|
|
|
135
|
-
For example, to activate a build of sky130 using open_pdks `7519dfb04400f224f140749cda44ee7de6f5e095`, you invoke `ciel enable --pdk sky130 7519dfb04400f224f140749cda44ee7de6f5e095`, as shown below:
|
|
135
|
+
For example, to activate a build of sky130 using open_pdks `7519dfb04400f224f140749cda44ee7de6f5e095`, you invoke `ciel enable --pdk-family sky130 7519dfb04400f224f140749cda44ee7de6f5e095`, as shown below:
|
|
136
136
|
|
|
137
137
|
```sh
|
|
138
|
-
$ ciel enable --pdk sky130 7519dfb04400f224f140749cda44ee7de6f5e095
|
|
138
|
+
$ ciel enable --pdk-family sky130 7519dfb04400f224f140749cda44ee7de6f5e095
|
|
139
139
|
Downloading pre-built tarball for 7519dfb04400f224f140749cda44ee7de6f5e095… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
|
|
140
140
|
Unpacking… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
|
|
141
141
|
PDK version 7519dfb04400f224f140749cda44ee7de6f5e095 enabled.
|
|
@@ -46,11 +46,11 @@ ciel --version
|
|
|
46
46
|
# About the builds
|
|
47
47
|
In its current inception, ciel supports builds of **sky130** and **gf180mcu** PDKs using [Open_PDKs](https://github.com/efabless/open_pdks), including the following libraries:
|
|
48
48
|
|
|
49
|
-
|sky130|gf180mcu|
|
|
49
|
+
|sky130|gf180mcu|ihp-sg13g2|
|
|
50
50
|
|-|-|-|
|
|
51
51
|
|sky130_fd_io|gf180mcu_fd_io|sg13g2_io|
|
|
52
52
|
|sky130_fd_pr|gf180mcu_fd_pr|sg13g2_pr|
|
|
53
|
-
|sky130_fd_pr_reram
|
|
53
|
+
|sky130_fd_pr_reram|gf180mcu_fd_pr|sg13g2_pr|
|
|
54
54
|
|sky130_fd_sc_hd|gf180mcu_fd_sc_mcu7t5v0|sg13g2_stdcell|
|
|
55
55
|
|sky130_ml_xx_hd|gf180mcu_fd_sc_mcu9t5v0|-|
|
|
56
56
|
|sky130_fd_sc_hvl|gf180mcu_osu_sc_gp9t3v3|-|
|
|
@@ -60,16 +60,16 @@ In its current inception, ciel supports builds of **sky130** and **gf180mcu** PD
|
|
|
60
60
|
|sky130_fd_sc_hs|-|-|
|
|
61
61
|
|sky130_sram_macros|gf180mcu_fd_ip_sram|sg13g2_sram|
|
|
62
62
|
|
|
63
|
-
Builds for sky130 and gf180mcu are identified by their [**open_pdks**](https://github.com/rtimothyedwards/open_pdks) commit hashes. Builds for
|
|
63
|
+
Builds for sky130 and gf180mcu are identified by their [**open_pdks**](https://github.com/rtimothyedwards/open_pdks) commit hashes. Builds for ihp-sg13g2 are identified by their [**IHP-Open-PDK**](https://github.com/ihp-gmbh/ihp-open-pdk) commit hashes.
|
|
64
64
|
|
|
65
65
|
# Usage
|
|
66
66
|
Ciel requires a so-called **PDK Root**. This PDK root can be anywhere on your computer, but by default it's the folder `~/.ciel` in your home directory. If you have the variable `PDK_ROOT` set, ciel will use that instead. You can also manually override both values by supplying the `--pdk-root` commandline argument.
|
|
67
67
|
|
|
68
68
|
## Listing All Available PDKs
|
|
69
|
-
To list all available pre-built
|
|
69
|
+
To list all available pre-built PDK families hosted in this repository, you can just invoke `ciel ls-remote --pdk-family <pdk-family>`.
|
|
70
70
|
|
|
71
71
|
```sh
|
|
72
|
-
$ ciel ls-remote --pdk sky130
|
|
72
|
+
$ ciel ls-remote --pdk-family sky130
|
|
73
73
|
Pre-built sky130 PDK versions
|
|
74
74
|
├── 44a43c23c81b45b8e774ae7a84899a5a778b6b0b (2022.08.16) (enabled)
|
|
75
75
|
├── e8294524e5f67c533c5d0c3afa0bcc5b2a5fa066 (2022.07.29) (installed)
|
|
@@ -79,7 +79,7 @@ Pre-built sky130 PDK versions
|
|
|
79
79
|
├── 8fe7f760ece2bb49b1c310e60243f0558977dae5 (2022.04.06)
|
|
80
80
|
└── 7519dfb04400f224f140749cda44ee7de6f5e095 (2022.02.10)
|
|
81
81
|
|
|
82
|
-
$ ciel ls-remote --pdk gf180mcu
|
|
82
|
+
$ ciel ls-remote --pdk-family gf180mcu
|
|
83
83
|
Pre-built gf180mcu PDK versions
|
|
84
84
|
└── 120b0bd69c745825a0b8b76f364043a1cd08bb6a (2022.09.22)
|
|
85
85
|
```
|
|
@@ -87,10 +87,10 @@ Pre-built gf180mcu PDK versions
|
|
|
87
87
|
It includes a hash of the commit of the relevant repo used for that particular build, the date that this commit was created, and whether you already installed this PDK and/or if it is the currently enabled PDK.
|
|
88
88
|
|
|
89
89
|
## Listing Installed PDKs
|
|
90
|
-
Typing `ciel ls --pdk <pdk>` in the terminal shows you your PDK Root and the PDKs you currently have installed.
|
|
90
|
+
Typing `ciel ls --pdk-family <pdk-family>` in the terminal shows you your PDK Root and the PDKs you currently have installed.
|
|
91
91
|
|
|
92
92
|
```sh
|
|
93
|
-
$ ciel ls --pdk sky130
|
|
93
|
+
$ ciel ls --pdk-family sky130
|
|
94
94
|
/home/test/ciel/sky130/versions
|
|
95
95
|
├── 44a43c23c81b45b8e774ae7a84899a5a778b6b0b (2022.08.16) (enabled)
|
|
96
96
|
├── e8294524e5f67c533c5d0c3afa0bcc5b2a5fa066 (2022.07.29)
|
|
@@ -101,12 +101,12 @@ $ ciel ls --pdk sky130
|
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
## Downloading and Enabling PDKs
|
|
104
|
-
You can enable a particular sky130 PDK by invoking `ciel enable --pdk <pdk> <open_pdks commit hash>`. This will automatically download that particular version of the PDK, if found, and set it as your currently used PDK.
|
|
104
|
+
You can enable a particular sky130 PDK by invoking `ciel enable --pdk-family <pdk-family> <open_pdks commit hash>`. This will automatically download that particular version of the PDK, if found, and set it as your currently used PDK.
|
|
105
105
|
|
|
106
|
-
For example, to activate a build of sky130 using open_pdks `7519dfb04400f224f140749cda44ee7de6f5e095`, you invoke `ciel enable --pdk sky130 7519dfb04400f224f140749cda44ee7de6f5e095`, as shown below:
|
|
106
|
+
For example, to activate a build of sky130 using open_pdks `7519dfb04400f224f140749cda44ee7de6f5e095`, you invoke `ciel enable --pdk-family sky130 7519dfb04400f224f140749cda44ee7de6f5e095`, as shown below:
|
|
107
107
|
|
|
108
108
|
```sh
|
|
109
|
-
$ ciel enable --pdk sky130 7519dfb04400f224f140749cda44ee7de6f5e095
|
|
109
|
+
$ ciel enable --pdk-family sky130 7519dfb04400f224f140749cda44ee7de6f5e095
|
|
110
110
|
Downloading pre-built tarball for 7519dfb04400f224f140749cda44ee7de6f5e095… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
|
|
111
111
|
Unpacking… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
|
|
112
112
|
PDK version 7519dfb04400f224f140749cda44ee7de6f5e095 enabled.
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# Copyright 2025 The American University in Cairo
|
|
2
|
+
#
|
|
3
|
+
# Adapted from the Volare project
|
|
4
|
+
#
|
|
1
5
|
# Copyright 2022-2023 Efabless Corporation
|
|
2
6
|
#
|
|
3
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -25,11 +29,7 @@ from .common import (
|
|
|
25
29
|
resolve_version,
|
|
26
30
|
)
|
|
27
31
|
from .click_common import (
|
|
28
|
-
opt,
|
|
29
|
-
opt_build,
|
|
30
|
-
opt_push,
|
|
31
32
|
opt_pdk_root,
|
|
32
|
-
opt_token,
|
|
33
33
|
)
|
|
34
34
|
from .manage import (
|
|
35
35
|
print_installed_list,
|
|
@@ -41,11 +41,13 @@ from .build import (
|
|
|
41
41
|
build_cmd,
|
|
42
42
|
push_cmd,
|
|
43
43
|
)
|
|
44
|
+
from .github import opt_github_token
|
|
45
|
+
from .source import opt_data_source
|
|
44
46
|
|
|
45
47
|
|
|
46
48
|
@click.command("output")
|
|
47
49
|
@opt_pdk_root
|
|
48
|
-
def output_cmd(pdk_root,
|
|
50
|
+
def output_cmd(pdk_root, pdk_family):
|
|
49
51
|
"""Outputs the currently enabled PDK version.
|
|
50
52
|
|
|
51
53
|
If not outputting to a tty, the output is either the version string
|
|
@@ -53,14 +55,16 @@ def output_cmd(pdk_root, pdk):
|
|
|
53
55
|
exit code of 1.
|
|
54
56
|
"""
|
|
55
57
|
|
|
56
|
-
version = Version.get_current(pdk_root,
|
|
58
|
+
version = Version.get_current(pdk_root, pdk_family)
|
|
57
59
|
if sys.stdout.isatty():
|
|
58
60
|
if version is None:
|
|
59
|
-
print(
|
|
61
|
+
print(
|
|
62
|
+
f"No version of the PDK {pdk_family} is currently enabled at {pdk_root}."
|
|
63
|
+
)
|
|
60
64
|
print("Invoke ciel --help for assistance installing and enabling versions.")
|
|
61
65
|
exit(1)
|
|
62
66
|
else:
|
|
63
|
-
print(f"Installed: {
|
|
67
|
+
print(f"Installed: {pdk_family} v{version.name}")
|
|
64
68
|
print("Invoke ciel --help for assistance installing and enabling versions.")
|
|
65
69
|
else:
|
|
66
70
|
if version is None:
|
|
@@ -78,9 +82,10 @@ def output_cmd(pdk_root, pdk):
|
|
|
78
82
|
expose_value=False,
|
|
79
83
|
prompt="Are you sure? This will delete all non-enabled versions of the PDK from your computer.",
|
|
80
84
|
)
|
|
81
|
-
def prune_cmd(pdk_root,
|
|
85
|
+
def prune_cmd(pdk_root, pdk_family):
|
|
82
86
|
"""Removes all PDKs other than, if it exists, the one currently in use."""
|
|
83
|
-
|
|
87
|
+
|
|
88
|
+
pdk_versions = Version.get_all_installed(pdk_root, pdk_family)
|
|
84
89
|
for version in pdk_versions:
|
|
85
90
|
if version.is_current(pdk_root):
|
|
86
91
|
continue
|
|
@@ -101,9 +106,10 @@ def prune_cmd(pdk_root, pdk):
|
|
|
101
106
|
prompt="Are you sure? This will delete this version of the PDK from your computer.",
|
|
102
107
|
)
|
|
103
108
|
@click.argument("version", required=False)
|
|
104
|
-
def rm_cmd(pdk_root,
|
|
109
|
+
def rm_cmd(pdk_root, pdk_family, version):
|
|
105
110
|
"""Removes the PDK version specified."""
|
|
106
|
-
|
|
111
|
+
|
|
112
|
+
version_object = Version(version, pdk_family)
|
|
107
113
|
try:
|
|
108
114
|
version_object.uninstall(pdk_root)
|
|
109
115
|
print(f"Deleted {version}.")
|
|
@@ -113,18 +119,20 @@ def rm_cmd(pdk_root, pdk, version):
|
|
|
113
119
|
|
|
114
120
|
|
|
115
121
|
@click.command("ls")
|
|
116
|
-
@
|
|
122
|
+
@opt_data_source
|
|
123
|
+
@opt_github_token
|
|
117
124
|
@opt_pdk_root
|
|
118
|
-
def list_cmd(pdk_root,
|
|
125
|
+
def list_cmd(data_source, pdk_root, pdk_family):
|
|
119
126
|
"""Lists PDK versions that are locally installed. JSON if not outputting to a tty."""
|
|
120
127
|
|
|
121
|
-
pdk_versions = Version.get_all_installed(pdk_root,
|
|
128
|
+
pdk_versions = Version.get_all_installed(pdk_root, pdk_family)
|
|
122
129
|
|
|
123
130
|
if sys.stdout.isatty():
|
|
124
131
|
console = Console()
|
|
125
132
|
print_installed_list(
|
|
126
133
|
pdk_root,
|
|
127
|
-
|
|
134
|
+
pdk_family,
|
|
135
|
+
data_source=data_source,
|
|
128
136
|
console=console,
|
|
129
137
|
installed_list=pdk_versions,
|
|
130
138
|
)
|
|
@@ -133,21 +141,28 @@ def list_cmd(pdk_root, pdk):
|
|
|
133
141
|
|
|
134
142
|
|
|
135
143
|
@click.command("ls-remote")
|
|
136
|
-
@
|
|
144
|
+
@opt_github_token
|
|
145
|
+
@opt_data_source
|
|
137
146
|
@opt_pdk_root
|
|
138
|
-
def list_remote_cmd(pdk_root,
|
|
147
|
+
def list_remote_cmd(data_source, pdk_root, pdk_family):
|
|
139
148
|
"""Lists PDK versions that are remotely available. JSON if not outputting to a tty."""
|
|
140
149
|
|
|
141
150
|
try:
|
|
142
|
-
|
|
143
|
-
pdk_versions = all_versions.get(pdk) or []
|
|
151
|
+
pdk_versions = data_source.get_available_versions(pdk_family)
|
|
144
152
|
|
|
145
153
|
if sys.stdout.isatty():
|
|
146
154
|
console = Console()
|
|
147
|
-
print_remote_list(pdk_root,
|
|
155
|
+
print_remote_list(pdk_root, pdk_family, console, pdk_versions)
|
|
148
156
|
else:
|
|
149
157
|
for version in pdk_versions:
|
|
150
158
|
print(version.name)
|
|
159
|
+
except ValueError as e:
|
|
160
|
+
if sys.stdout.isatty():
|
|
161
|
+
console = Console()
|
|
162
|
+
console.print(f"[red]{e}")
|
|
163
|
+
else:
|
|
164
|
+
print(f"{e}", file=sys.stderr)
|
|
165
|
+
sys.exit(-1)
|
|
151
166
|
except httpx.HTTPStatusError as e:
|
|
152
167
|
if sys.stdout.isatty():
|
|
153
168
|
console = Console()
|
|
@@ -169,7 +184,7 @@ def list_remote_cmd(pdk_root, pdk):
|
|
|
169
184
|
@click.command("path")
|
|
170
185
|
@opt_pdk_root
|
|
171
186
|
@click.argument("version", required=False)
|
|
172
|
-
def path_cmd(pdk_root,
|
|
187
|
+
def path_cmd(pdk_root, pdk_family, version):
|
|
173
188
|
"""
|
|
174
189
|
Prints the path of the ciel PDK root.
|
|
175
190
|
|
|
@@ -177,14 +192,15 @@ def path_cmd(pdk_root, pdk, version):
|
|
|
177
192
|
version instead.
|
|
178
193
|
"""
|
|
179
194
|
if version is not None:
|
|
180
|
-
version = Version(version,
|
|
195
|
+
version = Version(version, pdk_family)
|
|
181
196
|
print(version.get_dir(pdk_root), end="")
|
|
182
197
|
else:
|
|
183
198
|
print(get_ciel_home(pdk_root))
|
|
184
199
|
|
|
185
200
|
|
|
186
201
|
@click.command("enable")
|
|
187
|
-
@
|
|
202
|
+
@opt_data_source
|
|
203
|
+
@opt_github_token
|
|
188
204
|
@opt_pdk_root
|
|
189
205
|
@click.option(
|
|
190
206
|
"-f",
|
|
@@ -202,8 +218,9 @@ def path_cmd(pdk_root, pdk, version):
|
|
|
202
218
|
)
|
|
203
219
|
@click.argument("version", required=False)
|
|
204
220
|
def enable_cmd(
|
|
221
|
+
data_source,
|
|
205
222
|
pdk_root,
|
|
206
|
-
|
|
223
|
+
pdk_family,
|
|
207
224
|
tool_metadata_file_path,
|
|
208
225
|
version,
|
|
209
226
|
include_libraries,
|
|
@@ -217,6 +234,7 @@ def enable_cmd(
|
|
|
217
234
|
tools with a tool_metadata.yml file, for example OpenLane or DFFRAM,
|
|
218
235
|
the appropriate version will be enabled automatically.
|
|
219
236
|
"""
|
|
237
|
+
|
|
220
238
|
if include_libraries == ():
|
|
221
239
|
include_libraries = None
|
|
222
240
|
|
|
@@ -230,10 +248,11 @@ def enable_cmd(
|
|
|
230
248
|
try:
|
|
231
249
|
enable(
|
|
232
250
|
pdk_root,
|
|
233
|
-
|
|
251
|
+
pdk_family,
|
|
234
252
|
version,
|
|
235
253
|
include_libraries=include_libraries,
|
|
236
254
|
output=console,
|
|
255
|
+
data_source=data_source,
|
|
237
256
|
)
|
|
238
257
|
except Exception as e:
|
|
239
258
|
console.print(f"[red]{e}")
|
|
@@ -241,7 +260,8 @@ def enable_cmd(
|
|
|
241
260
|
|
|
242
261
|
|
|
243
262
|
@click.command("fetch")
|
|
244
|
-
@
|
|
263
|
+
@opt_data_source
|
|
264
|
+
@opt_github_token
|
|
245
265
|
@opt_pdk_root
|
|
246
266
|
@click.option(
|
|
247
267
|
"-f",
|
|
@@ -259,8 +279,9 @@ def enable_cmd(
|
|
|
259
279
|
)
|
|
260
280
|
@click.argument("version", required=False)
|
|
261
281
|
def fetch_cmd(
|
|
282
|
+
data_source,
|
|
262
283
|
pdk_root,
|
|
263
|
-
|
|
284
|
+
pdk_family,
|
|
264
285
|
tool_metadata_file_path,
|
|
265
286
|
version,
|
|
266
287
|
include_libraries,
|
|
@@ -275,6 +296,7 @@ def fetch_cmd(
|
|
|
275
296
|
tools with a tool_metadata.yml file, for example OpenLane or DFFRAM,
|
|
276
297
|
the appropriate version will be enabled automatically.
|
|
277
298
|
"""
|
|
299
|
+
|
|
278
300
|
if include_libraries == ():
|
|
279
301
|
include_libraries = None
|
|
280
302
|
|
|
@@ -287,8 +309,9 @@ def fetch_cmd(
|
|
|
287
309
|
|
|
288
310
|
try:
|
|
289
311
|
version = fetch(
|
|
312
|
+
data_source=data_source,
|
|
290
313
|
pdk_root=pdk_root,
|
|
291
|
-
pdk=
|
|
314
|
+
pdk=pdk_family,
|
|
292
315
|
version=version,
|
|
293
316
|
include_libraries=include_libraries,
|
|
294
317
|
output=console,
|
|
@@ -300,79 +323,6 @@ def fetch_cmd(
|
|
|
300
323
|
exit(-1)
|
|
301
324
|
|
|
302
325
|
|
|
303
|
-
@click.command("enable_or_build", hidden=True)
|
|
304
|
-
@opt_token
|
|
305
|
-
@opt_pdk_root
|
|
306
|
-
@opt_push
|
|
307
|
-
@opt_build
|
|
308
|
-
@opt("--also-push/--dont-push", default=False, help="Also push.")
|
|
309
|
-
@click.option(
|
|
310
|
-
"-f",
|
|
311
|
-
"--metadata-file",
|
|
312
|
-
"tool_metadata_file_path",
|
|
313
|
-
default=None,
|
|
314
|
-
help="Explicitly define a tool metadata file instead of searching for a metadata file",
|
|
315
|
-
)
|
|
316
|
-
@click.argument("version")
|
|
317
|
-
def enable_or_build_cmd(
|
|
318
|
-
include_libraries,
|
|
319
|
-
jobs,
|
|
320
|
-
pdk_root,
|
|
321
|
-
pdk,
|
|
322
|
-
owner,
|
|
323
|
-
repository,
|
|
324
|
-
pre,
|
|
325
|
-
clear_build_artifacts,
|
|
326
|
-
tool_metadata_file_path,
|
|
327
|
-
also_push,
|
|
328
|
-
version,
|
|
329
|
-
use_repo_at,
|
|
330
|
-
push_libraries,
|
|
331
|
-
):
|
|
332
|
-
"""
|
|
333
|
-
Attempts to activate a given PDK version. If the version is not found locally or remotely,
|
|
334
|
-
it will instead attempt to build said version.
|
|
335
|
-
|
|
336
|
-
Parameters: <version>
|
|
337
|
-
"""
|
|
338
|
-
if include_libraries == ():
|
|
339
|
-
include_libraries = None
|
|
340
|
-
if push_libraries == ():
|
|
341
|
-
push_libraries = include_libraries
|
|
342
|
-
|
|
343
|
-
console = Console()
|
|
344
|
-
try:
|
|
345
|
-
version = resolve_version(version, tool_metadata_file_path)
|
|
346
|
-
except Exception as e:
|
|
347
|
-
console.print(f"Could not determine open_pdks version: {e}")
|
|
348
|
-
exit(-1)
|
|
349
|
-
try:
|
|
350
|
-
enable(
|
|
351
|
-
pdk_root=pdk_root,
|
|
352
|
-
pdk=pdk,
|
|
353
|
-
version=version,
|
|
354
|
-
build_if_not_found=True,
|
|
355
|
-
also_push=also_push,
|
|
356
|
-
build_kwargs={
|
|
357
|
-
"include_libraries": include_libraries,
|
|
358
|
-
"jobs": jobs,
|
|
359
|
-
"clear_build_artifacts": clear_build_artifacts,
|
|
360
|
-
"use_repo_at": use_repo_at,
|
|
361
|
-
},
|
|
362
|
-
push_kwargs={
|
|
363
|
-
"owner": owner,
|
|
364
|
-
"repository": repository,
|
|
365
|
-
"pre": pre,
|
|
366
|
-
"push_libraries": push_libraries,
|
|
367
|
-
},
|
|
368
|
-
include_libraries=include_libraries,
|
|
369
|
-
output=console,
|
|
370
|
-
)
|
|
371
|
-
except Exception as e:
|
|
372
|
-
console.print(f"[red]{e}")
|
|
373
|
-
exit(-1)
|
|
374
|
-
|
|
375
|
-
|
|
376
326
|
@click.group()
|
|
377
327
|
@click.version_option(
|
|
378
328
|
__version__,
|
|
@@ -404,7 +354,6 @@ cli.add_command(list_cmd)
|
|
|
404
354
|
cli.add_command(list_remote_cmd)
|
|
405
355
|
cli.add_command(enable_cmd)
|
|
406
356
|
cli.add_command(fetch_cmd)
|
|
407
|
-
cli.add_command(enable_or_build_cmd)
|
|
408
357
|
|
|
409
358
|
try:
|
|
410
359
|
import ssl # noqa: F401
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# Copyright 2025 The American University in Cairo
|
|
2
|
+
#
|
|
3
|
+
# Adapted from the Volare project
|
|
4
|
+
#
|
|
1
5
|
# Copyright 2022-2023 Efabless Corporation
|
|
2
6
|
#
|
|
3
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -28,7 +32,7 @@ from rich.progress import Progress
|
|
|
28
32
|
from ..github import (
|
|
29
33
|
GitHubSession,
|
|
30
34
|
get_commit_date,
|
|
31
|
-
|
|
35
|
+
opt_github_token,
|
|
32
36
|
)
|
|
33
37
|
from ..common import (
|
|
34
38
|
Version,
|
|
@@ -40,7 +44,6 @@ from ..click_common import (
|
|
|
40
44
|
opt_push,
|
|
41
45
|
opt_build,
|
|
42
46
|
opt_pdk_root,
|
|
43
|
-
opt_token,
|
|
44
47
|
)
|
|
45
48
|
from ..families import Family
|
|
46
49
|
|
|
@@ -79,7 +82,7 @@ def build(
|
|
|
79
82
|
|
|
80
83
|
|
|
81
84
|
@click.command("build")
|
|
82
|
-
@
|
|
85
|
+
@opt_github_token
|
|
83
86
|
@opt_pdk_root
|
|
84
87
|
@opt_build
|
|
85
88
|
@click.option(
|
|
@@ -135,16 +138,14 @@ def push(
|
|
|
135
138
|
pdk,
|
|
136
139
|
version,
|
|
137
140
|
*,
|
|
138
|
-
owner
|
|
139
|
-
repository
|
|
141
|
+
owner,
|
|
142
|
+
repository,
|
|
140
143
|
pre=False,
|
|
141
144
|
push_libraries=None,
|
|
142
|
-
session: Optional[GitHubSession] = None,
|
|
143
145
|
):
|
|
144
146
|
family = Family.by_name[pdk]
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
session = GitHubSession()
|
|
148
|
+
session = GitHubSession()
|
|
148
149
|
if session.github_token is None:
|
|
149
150
|
raise TypeError("No GitHub token was provided.")
|
|
150
151
|
|
|
@@ -231,7 +232,7 @@ def push(
|
|
|
231
232
|
|
|
232
233
|
|
|
233
234
|
@click.command("push", hidden=True)
|
|
234
|
-
@
|
|
235
|
+
@opt_github_token
|
|
235
236
|
@opt_pdk_root
|
|
236
237
|
@opt_push
|
|
237
238
|
@click.argument("version")
|
|
@@ -83,9 +83,9 @@ def build_ihp(build_directory, ihp_path):
|
|
|
83
83
|
def install_ihp(build_directory, pdk_root, version):
|
|
84
84
|
console = Console()
|
|
85
85
|
with console.status("Adding build to list of installed versions…"):
|
|
86
|
-
ihp_sg13g2_family = Family.by_name["
|
|
86
|
+
ihp_sg13g2_family = Family.by_name["ihp-sg13g2"]
|
|
87
87
|
|
|
88
|
-
version_directory = Version(version, "
|
|
88
|
+
version_directory = Version(version, "ihp-sg13g2").get_dir(pdk_root)
|
|
89
89
|
if (
|
|
90
90
|
os.path.exists(version_directory)
|
|
91
91
|
and len(os.listdir(version_directory)) != 0
|
|
@@ -94,7 +94,7 @@ def install_ihp(build_directory, pdk_root, version):
|
|
|
94
94
|
it = 0
|
|
95
95
|
while os.path.exists(backup_path) and len(os.listdir(backup_path)) != 0:
|
|
96
96
|
it += 1
|
|
97
|
-
backup_path = Version(f"{version}.bk{it}", "
|
|
97
|
+
backup_path = Version(f"{version}.bk{it}", "ihp-sg13g2").get_dir(
|
|
98
98
|
pdk_root
|
|
99
99
|
)
|
|
100
100
|
console.log(
|
|
@@ -132,7 +132,7 @@ def build(
|
|
|
132
132
|
using_repos = {}
|
|
133
133
|
|
|
134
134
|
build_directory = os.path.join(
|
|
135
|
-
get_ciel_dir(pdk_root, "
|
|
135
|
+
get_ciel_dir(pdk_root, "ihp-sg13g2"), "build", version
|
|
136
136
|
)
|
|
137
137
|
timestamp = datetime.now().strftime("build_ihp-sg13g2-%Y-%m-%d-%H-%M-%S")
|
|
138
138
|
log_dir = os.path.join(build_directory, "logs", timestamp)
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# Copyright 2025 The American University in Cairo
|
|
2
|
+
#
|
|
3
|
+
# Adapted from the Volare project
|
|
4
|
+
#
|
|
1
5
|
# Copyright 2022-2023 Efabless Corporation
|
|
2
6
|
#
|
|
3
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -11,29 +15,47 @@
|
|
|
11
15
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
16
|
# See the License for the specific language governing permissions and
|
|
13
17
|
# limitations under the License.
|
|
14
|
-
import os
|
|
15
18
|
from functools import partial
|
|
16
19
|
from typing import Callable, Optional
|
|
17
20
|
|
|
18
21
|
import click
|
|
19
22
|
|
|
20
|
-
from .common import
|
|
21
|
-
|
|
23
|
+
from .common import (
|
|
24
|
+
CIEL_RESOLVED_HOME,
|
|
25
|
+
resolve_pdk_family,
|
|
26
|
+
)
|
|
27
|
+
from .families import Family
|
|
22
28
|
|
|
23
29
|
opt = partial(click.option, show_default=True)
|
|
24
30
|
|
|
25
31
|
|
|
32
|
+
def pdk_cb(
|
|
33
|
+
ctx: click.Context,
|
|
34
|
+
param: click.Parameter,
|
|
35
|
+
value: Optional[str],
|
|
36
|
+
):
|
|
37
|
+
try:
|
|
38
|
+
resolved = resolve_pdk_family(value)
|
|
39
|
+
except ValueError as e:
|
|
40
|
+
raise click.BadParameter(str(e), ctx, param)
|
|
41
|
+
if resolved is None:
|
|
42
|
+
raise click.BadParameter(
|
|
43
|
+
f"A PDK family or variant must be specified. The following families are supported: {', '.join(Family.by_name)}"
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
26
47
|
def opt_pdk_root(function: Callable):
|
|
27
48
|
function = opt(
|
|
49
|
+
"--pdk-family",
|
|
28
50
|
"--pdk",
|
|
29
|
-
required=False,
|
|
30
|
-
|
|
31
|
-
help="
|
|
51
|
+
required=False, # Requirement handled by callback
|
|
52
|
+
callback=pdk_cb,
|
|
53
|
+
help="A valid PDK family or variant (the latter of which is resolved to a family).",
|
|
32
54
|
)(function)
|
|
33
55
|
function = opt(
|
|
34
56
|
"--pdk-root",
|
|
35
57
|
required=False,
|
|
36
|
-
default=
|
|
58
|
+
default=CIEL_RESOLVED_HOME,
|
|
37
59
|
help="Path to the PDK root",
|
|
38
60
|
)(function)
|
|
39
61
|
return function
|
|
@@ -77,12 +99,10 @@ def opt_build(function: Callable):
|
|
|
77
99
|
|
|
78
100
|
|
|
79
101
|
def opt_push(function: Callable):
|
|
80
|
-
function = opt("-o", "--owner", default=
|
|
81
|
-
function
|
|
82
|
-
)
|
|
83
|
-
function = opt("-r", "--repository", default=volare_repo.name, help="Repository")(
|
|
102
|
+
function = opt("-o", "--owner", default="efabless", help="Repository Owner")(
|
|
84
103
|
function
|
|
85
104
|
)
|
|
105
|
+
function = opt("-r", "--repository", default="volare", help="Repository")(function)
|
|
86
106
|
function = opt(
|
|
87
107
|
"--pre/--prod", default=False, help="Push as pre-release or production"
|
|
88
108
|
)(function)
|
|
@@ -95,25 +115,3 @@ def opt_push(function: Callable):
|
|
|
95
115
|
help="Push only libraries in this list. You can use -L multiple times to include multiple libraries. Pass 'None' to push all libraries built.",
|
|
96
116
|
)(function)
|
|
97
117
|
return function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def set_token_cb(
|
|
101
|
-
ctx: click.Context,
|
|
102
|
-
param: click.Parameter,
|
|
103
|
-
value: Optional[str],
|
|
104
|
-
):
|
|
105
|
-
GitHubSession.Token.override = value
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def opt_token(function: Callable) -> Callable:
|
|
109
|
-
function = opt(
|
|
110
|
-
"-t",
|
|
111
|
-
"--token",
|
|
112
|
-
"session",
|
|
113
|
-
default=None,
|
|
114
|
-
required=False,
|
|
115
|
-
expose_value=False,
|
|
116
|
-
help="Replace the GitHub token used for GitHub requests, which is by default the value of the environment variable GITHUB_TOKEN or None.",
|
|
117
|
-
callback=set_token_cb,
|
|
118
|
-
)(function)
|
|
119
|
-
return function
|