mirror of
https://github.com/The-OpenROAD-Project/OpenLane.git
synced 2026-05-29 00:23:55 +08:00
Update OpenROAD + Handle Breaking Changes (#1949)
+ update utils.py `fetch_submodules_from_tarballs` to handle relative submodule url ~ `openroad_app` -> `0a6d0fd` ~ add extractor for operating conditions Co-authored-by: Donn <me@donn.website>
This commit is contained in:
4
.github/workflows/openlane_ci.yml
vendored
4
.github/workflows/openlane_ci.yml
vendored
@@ -24,6 +24,10 @@ jobs:
|
||||
- name: Set up environment variables
|
||||
uses: ./.github/actions/set_env_variables
|
||||
|
||||
- name: Set up GITHUB_TOKEN
|
||||
run: |
|
||||
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Get Volare Build/Push Dependencies
|
||||
run: |
|
||||
# Magic Build Dependencies
|
||||
|
||||
4
Makefile
4
Makefile
@@ -124,7 +124,7 @@ mount:
|
||||
|
||||
.PHONY: pdk
|
||||
pdk: venv/created
|
||||
PYTHONPATH= ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir volare>=0.12.3
|
||||
PYTHONPATH= ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir 'volare>=0.12.3'
|
||||
./venv/bin/volare enable --pdk $(PDK_FAMILY)
|
||||
|
||||
.PHONY: survey
|
||||
@@ -147,7 +147,7 @@ start-build-env: venv/created
|
||||
bash -c "bash --rcfile <(cat ~/.bashrc ./venv/bin/activate)"
|
||||
|
||||
venv: venv/created
|
||||
venv/created: ./requirements.txt ./requirements_dev.txt ./requirements_lint.txt ./dependencies/python/precompile_time.txt ./dependencies/python/run_time.txt
|
||||
venv/created: ./requirements.txt ./requirements_dev.txt ./requirements_lint.txt ./dependencies/python/precompile_time.txt
|
||||
rm -rf ./venv
|
||||
$(PYTHON_BIN) -m venv ./venv
|
||||
PYTHONPATH= ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir pip
|
||||
|
||||
3
dependencies/python/compile_time.txt
vendored
3
dependencies/python/compile_time.txt
vendored
@@ -1,2 +1 @@
|
||||
cmake
|
||||
pyinstaller
|
||||
cmake
|
||||
4
dependencies/python/run_time.txt
vendored
4
dependencies/python/run_time.txt
vendored
@@ -1,4 +1,4 @@
|
||||
click>=8.0.0,<9
|
||||
pyyaml>=6,<7
|
||||
install>=1.3.5,<2
|
||||
XlsxWriter>=3.0.2,<4
|
||||
XlsxWriter>=3.0.2,<4
|
||||
git+https://github.com/efabless/libparse-python@0.1.5
|
||||
2
dependencies/tool_metadata.yml
vendored
2
dependencies/tool_metadata.yml
vendored
@@ -65,7 +65,7 @@
|
||||
in_install: false
|
||||
- name: openroad_app
|
||||
repo: https://github.com/The-OpenROAD-Project/OpenROAD
|
||||
commit: 0cfb9a45bfb256c9af1a0500d4c97da0f145f54f
|
||||
commit: 0a6d0fd469bc674417036342994520ee2e0a2727
|
||||
in_install: false
|
||||
- name: git
|
||||
repo: https://github.com/git/git
|
||||
|
||||
2
dependencies/verify_versions.py
vendored
2
dependencies/verify_versions.py
vendored
@@ -55,7 +55,6 @@ def verify_versions(
|
||||
manifest_names_by_SOURCES_name = {
|
||||
"open_pdks": "open_pdks",
|
||||
"skywater": "sky130",
|
||||
"magic": "magic",
|
||||
}
|
||||
pdk_manifest_names = set(manifest_names_by_SOURCES_name.values())
|
||||
|
||||
@@ -131,6 +130,7 @@ def verify_versions(
|
||||
)
|
||||
|
||||
for name, commit in tool_versions:
|
||||
print(name, commit)
|
||||
manifest_commit = manifest_dict[name]["commit"]
|
||||
|
||||
if commit != manifest_commit:
|
||||
|
||||
@@ -46,6 +46,7 @@ pull-build-base:
|
||||
$(PYTHON_BIN) ./utils.py pull-if-doesnt-exist --repository $(TOOL_REPOSITORY) --os $(OS_NAME) --architecture $(BUILD_ARCH) build-base
|
||||
@echo "-----------"
|
||||
|
||||
# Used by pull-if-doesnt-exist
|
||||
build-run-base: ./run_base/Dockerfile
|
||||
cat ../dependencies/python/run_time.txt > ./run_base/pip_dependencies.txt
|
||||
cat ../dependencies/centos-7/precompile_time.txt > ./run_base/yum_repos.txt
|
||||
@@ -61,7 +62,7 @@ pull-run-base:
|
||||
@echo "-----------"
|
||||
|
||||
# Tool Images
|
||||
$(TOOL_BUILD_TARGETS): build-% : ./%/Dockerfile pull-build-base
|
||||
$(TOOL_BUILD_TARGETS): build-% : ./%/Dockerfile pull-build-base pull-run-base
|
||||
mkdir -p logs
|
||||
cp ./utils.py $*
|
||||
$(BUILD_COMMAND)\
|
||||
|
||||
1
docker/run_base/.dockerignore
Normal file
1
docker/run_base/.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
/Dockerfile
|
||||
@@ -32,4 +32,5 @@ RUN git config --global user.email "openlane.user@localhost"
|
||||
## Wheel Build Dependencies
|
||||
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
||||
COPY ./pip_dependencies.txt /pip_dependencies.txt
|
||||
RUN yum install -y swig3 gcc gcc-c++ python3-devel
|
||||
RUN python3 -m pip install --no-cache-dir -r /pip_dependencies.txt
|
||||
@@ -29,7 +29,7 @@ CI_ARCHITECTURES = {"amd64", "arm64v8"}
|
||||
SUPPORTED_OPERATING_SYSTEMS = {"centos-7"}
|
||||
|
||||
|
||||
def test_manifest_exists(repository, tag) -> str:
|
||||
def test_manifest_exists(repository, tag) -> bool:
|
||||
url = f"https://registry.hub.docker.com/v2/repositories/{repository}/tags/{tag}"
|
||||
req = urllib.request.Request(url, headers={"Accept": "application/json"})
|
||||
status = None
|
||||
@@ -303,6 +303,9 @@ def fetch_submodules_from_tarballs(filter, repository, commit):
|
||||
|
||||
for name, submodule in submodules_by_name.items():
|
||||
submodule["commit"] = shas_by_path.get(submodule["path"])
|
||||
if submodule["url"].startswith(tuple(["./", "../"])):
|
||||
submodule["url"] = urllib.parse.urljoin(repository, submodule["url"])
|
||||
|
||||
if submodule["url"].endswith(".git"):
|
||||
submodule["url"] = submodule["url"][:-4]
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
-r ./dependencies/python/precompile_time.txt
|
||||
-r ./dependencies/python/run_time.txt
|
||||
click>=8.0.0,<9
|
||||
pyyaml>=6,<7
|
||||
@@ -114,7 +114,7 @@ proc print_units {args} {
|
||||
proc read_libs {args} {
|
||||
sta::parse_key_args "read_libs" args \
|
||||
keys {-typical -slowest -fastest}\
|
||||
flags {-no_extra}
|
||||
flags {-no_extra -set_operating_conditions}
|
||||
|
||||
if { ![info exists keys(-typical)] } {
|
||||
puts "read_libs -typical is required"
|
||||
@@ -134,6 +134,13 @@ proc read_libs {args} {
|
||||
foreach lib $corner($corner_name) {
|
||||
puts "read_liberty -corner $corner_name $lib"
|
||||
read_liberty -corner $corner_name $lib
|
||||
if { [info exists flags(-set_operating_conditions)] } {
|
||||
set lib_info [fetch_library_info $lib]
|
||||
set lib_name [lindex $lib_info 0]
|
||||
set operating_conditions [lindex $lib_info 1]
|
||||
puts "\[INFO] Setting operating conditions to '$operating_conditions'…"
|
||||
set_operating_conditions -library $lib_name $operating_conditions
|
||||
}
|
||||
}
|
||||
if { ![info exists flags(-no_extra)] } {
|
||||
if { [info exists ::env(EXTRA_LIBS) ] } {
|
||||
@@ -151,7 +158,7 @@ proc read_libs {args} {
|
||||
proc read {args} {
|
||||
sta::parse_key_args "read" args \
|
||||
keys {-lib_fastest -lib_typical -lib_slowest} \
|
||||
flags {-no_spefs}
|
||||
flags {-no_spefs -set_lib_operating_conditions}
|
||||
|
||||
if { [info exists ::env(IO_READ_DEF)] && $::env(IO_READ_DEF) } {
|
||||
if { [ catch {read_lef $::env(MERGED_LEF)} errmsg ]} {
|
||||
@@ -184,6 +191,9 @@ proc read {args} {
|
||||
if { [info exists keys(-lib_slowest)] } {
|
||||
lappend read_libs_args -slowest "$keys(-lib_slowest)"
|
||||
}
|
||||
if { [info exists flags(-set_lib_operating_conditions)] } {
|
||||
lappend read_libs_args -set_operating_conditions
|
||||
}
|
||||
|
||||
read_libs {*}$read_libs_args
|
||||
|
||||
@@ -319,3 +329,9 @@ proc read_spefs {} {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc fetch_library_info {lib} {
|
||||
set extraction [exec python3 $::env(SCRIPTS_DIR)/utils/get_default_operating_conditions.py $lib]
|
||||
set result [split $extraction ":"]
|
||||
return $result
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
source $::env(SCRIPTS_DIR)/openroad/common/io.tcl
|
||||
read
|
||||
read -set_lib_operating_conditions
|
||||
read_spef $::env(CURRENT_SPEF)
|
||||
|
||||
source $::env(SCRIPTS_DIR)/openroad/common/set_rc.tcl
|
||||
|
||||
51
scripts/utils/get_default_operating_conditions.py
Normal file
51
scripts/utils/get_default_operating_conditions.py
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright 2023 Efabless Corporation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
import sys
|
||||
|
||||
import click
|
||||
from libparse import LibertyParser
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument("liberty", type=click.Path(dir_okay=False, exists=True))
|
||||
def get_default_operating_conditions(liberty):
|
||||
library = LibertyParser(open(liberty))
|
||||
ast = library.ast
|
||||
|
||||
default_operating_conditions_id = None
|
||||
operating_conditions_raw = {}
|
||||
for child in ast.children:
|
||||
if child.id == "default_operating_conditions":
|
||||
default_operating_conditions_id = child.value
|
||||
if child.id == "operating_conditions":
|
||||
operating_conditions_raw[child.args[0]] = child
|
||||
|
||||
if default_operating_conditions_id is None:
|
||||
if len(operating_conditions_raw) > 1:
|
||||
print(
|
||||
"No default operating condition defined, and the liberty file has multiple operating conditions.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
exit(-1)
|
||||
elif len(operating_conditions_raw) < 1:
|
||||
print("Liberty file has no operating conditions.", file=sys.stderr)
|
||||
exit(-1)
|
||||
default_operating_conditions_id = list(operating_conditions_raw.keys())[0]
|
||||
|
||||
print(f"{ast.args[0]}:{default_operating_conditions_id}", end="")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
get_default_operating_conditions()
|
||||
Reference in New Issue
Block a user