Skip to content

Commit f8fb68e

Browse files
authored
Merge branch 'The-OpenROAD-Project:master' into pr-update-rules
2 parents 97ba853 + 6604ee3 commit f8fb68e

File tree

232 files changed

+28254
-18833
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+28254
-18833
lines changed

.devcontainer/devcontainer.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) 2024 Antmicro <www.antmicro.com>
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
{
5+
"image": "ghcr.io/the-openroad-project/openroad-flow-scripts:lxqt",
6+
"forwardPorts": [6080],
7+
"portsAttributes": {
8+
"6080": {
9+
"label": "desktop"
10+
}
11+
},
12+
"postAttachCommand": "bash /usr/local/share/desktop-init.sh"
13+
}

.github/workflows/github-actions-cron-test-installer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
sudo service docker restart
4646
- name: Run installer
4747
run: |
48-
./etc/DockerHelper.sh create -target=dev -os=${{ matrix.os }}
48+
./etc/DockerHelper.sh create -target=dev -os=${{ matrix.os }} -tag=latest
4949
- name: Build project
5050
run: |
51-
./etc/DockerHelper.sh create -target=builder -os=${{ matrix.os }}
51+
./etc/DockerHelper.sh create -target=builder -os=${{ matrix.os }} -tag=latest
5252
- name: Test build
5353
run: |
5454
cmd="source ./env.sh ; yosys -help ; openroad -help ; make -C flow ;"
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Build and publish ORFS images
2+
on:
3+
push:
4+
paths:
5+
- etc/DependencyInstaller.sh
6+
- etc/DockerHelper.sh
7+
- .github/workflows/github-actions-publish-docker-images.yml
8+
- build_openroad.sh
9+
- env.sh
10+
- flow/Makefile
11+
- docker/Dockerfile.dev
12+
- docker/Dockerfile.builder
13+
- tools/codespace/scripts/**
14+
- tools/codespace/Dockerfile-lxqt
15+
pull_request:
16+
paths:
17+
- etc/DependencyInstaller.sh
18+
- etc/DockerHelper.sh
19+
- .github/workflows/github-actions-publish-docker-images.yml
20+
- build_openroad.sh
21+
- env.sh
22+
- flow/Makefile
23+
- docker/Dockerfile.dev
24+
- docker/Dockerfile.builder
25+
- tools/codespace/scripts/**
26+
- tools/codespace/Dockerfile-lxqt
27+
28+
jobs:
29+
buildCodespaceImage:
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 600
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set environment variables
36+
run: echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
37+
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Login to GitHub Container Registry (GHCR)
42+
if: github.event_name != 'pull_request'
43+
uses: docker/login-action@v3
44+
with:
45+
registry: ghcr.io
46+
username: gha
47+
password: ${{ github.token }}
48+
49+
- name: Build and export codespaces image
50+
uses: docker/build-push-action@v6
51+
with:
52+
context: .
53+
push: true
54+
tags: ${{ env.IMAGE }}:lxqt
55+
file: tools/codespace/Dockerfile-lxqt
56+
cache-from: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache
57+
cache-to: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache
58+
59+
buildDependenciesImage:
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: [["ubuntu20.04", "ubuntu:20.04"], ["ubuntu22.04", "ubuntu:22.04"]]
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Check out repository code
67+
uses: actions/checkout@v4
68+
with:
69+
fetch-depth: 1
70+
submodules: recursive
71+
72+
- name: Set environment variables
73+
run: |
74+
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os[0] }}" >> $GITHUB_ENV
75+
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Login to GitHub Container Registry (GHCR)
80+
if: github.event_name != 'pull_request'
81+
uses: docker/login-action@v2
82+
with:
83+
registry: ghcr.io
84+
username: gha
85+
password: ${{ github.token }}
86+
87+
- name: Copy OpenROAD installer
88+
run: cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh
89+
90+
- name: Build and export dependencies image
91+
uses: docker/build-push-action@v6
92+
with:
93+
context: etc
94+
push: true
95+
tags: ${{ env.IMAGE_DEPS }}:latest
96+
file: docker/Dockerfile.dev
97+
build-args: |
98+
fromImage=${{ matrix.os[1] }}
99+
cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache
100+
cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache,mode=max
101+
102+
buildORFSImage:
103+
needs: buildDependenciesImage
104+
strategy:
105+
fail-fast: false
106+
matrix:
107+
os: ["ubuntu20.04", "ubuntu22.04"]
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: Free Disk Space
111+
uses: jlumbroso/free-disk-space@main
112+
with:
113+
tool-cache: false
114+
115+
- name: Check out repository code
116+
uses: actions/checkout@v4
117+
with:
118+
fetch-depth: 1
119+
submodules: recursive
120+
121+
- name: Set environment variables
122+
run: |
123+
echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')/${{ matrix.os }}" >> $GITHUB_ENV
124+
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os }}" >> $GITHUB_ENV
125+
echo "NUM_THREADS=$(nproc)" >> $GITHUB_ENV
126+
127+
- name: Set up Docker Buildx
128+
uses: docker/setup-buildx-action@v3
129+
130+
- name: Login to GitHub Container Registry (GHCR)
131+
if: github.event_name != 'pull_request'
132+
uses: docker/login-action@v2
133+
with:
134+
registry: ghcr.io
135+
username: gha
136+
password: ${{ github.token }}
137+
138+
- name: Build and export ORFS image
139+
uses: docker/build-push-action@v6
140+
with:
141+
context: .
142+
push: true
143+
tags: ${{ env.IMAGE }}:latest
144+
file: docker/Dockerfile.builder
145+
build-args: |
146+
fromImage=${{ env.IMAGE_DEPS }}
147+
numThreads=${{ env.NUM_THREADS }}
148+
cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache
149+
cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,10 @@ perf.data.old
8888
docs/main
8989
docs/build
9090
GitGuide.md
91+
SupportedOS.md
92+
index2.md
93+
Manpage.md
9194
mainREADME.md
9295
build
96+
.scala-build/
97+
.bsp/

build_openroad.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ OPENROAD_APP_BRANCH="master"
2020
INSTALL_PATH="$(pwd)/tools/install"
2121

2222
YOSYS_USER_ARGS=""
23-
YOSYS_ARGS="CONFIG=gcc"
23+
YOSYS_ARGS="CONFIG=clang"
2424

2525
OPENROAD_APP_USER_ARGS=""
2626
OPENROAD_APP_ARGS=""
@@ -206,6 +206,8 @@ EOF
206206
fi
207207
fi
208208

209+
echo "[INFO FLW-0028] Compiling with ${PROC} threads."
210+
209211
# Only add install prefix variables after parsing arguments.
210212
YOSYS_ARGS+=" PREFIX=${INSTALL_PATH}/yosys"
211213
OPENROAD_APP_ARGS+=" -D CMAKE_INSTALL_PREFIX=${INSTALL_PATH}/OpenROAD"

docker/Dockerfile.builder

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
13
# Target with dependencies to build all flow tools from their sources.
24
# i.e., "./build_openroad.sh --local" from inside a docker container
35
# NOTE: don't use this file directly unless you know what you are doing,
46
# instead use etc/DockerHelper.sh
7+
58
ARG fromImage=openroad/flow-ubuntu22.04-dev:latest
69

7-
FROM $fromImage
10+
FROM $fromImage AS orfs-base
11+
12+
WORKDIR /OpenROAD-flow-scripts
13+
COPY --link dev_env.sh dev_env.sh
14+
COPY --link build_openroad.sh build_openroad.sh
15+
16+
FROM orfs-base AS orfs-builder-base
817
18+
COPY --link tools tools
919
ARG numThreads=$(nproc)
1020
11-
COPY . /OpenROAD-flow-scripts
12-
WORKDIR /OpenROAD-flow-scripts
21+
RUN echo "" > tools/yosys/abc/.gitcommit && \
22+
./build_openroad.sh --no_init --local --threads ${numThreads}
23+
24+
FROM orfs-base
25+
26+
# The order for copying the directories is based on the frequency of changes (ascending order),
27+
# and the layer size (descending order)
28+
COPY --link docker docker
29+
COPY --link flow/tutorials flow/tutorials
30+
COPY --link docs docs
31+
COPY --link flow/test flow/test
32+
COPY --link flow/platforms flow/platforms
33+
COPY --link flow/util flow/util
34+
COPY --link flow/scripts flow/scripts
35+
COPY --link flow/designs flow/designs
1336

14-
RUN ./build_openroad.sh --no_init --local --threads ${numThreads}
37+
COPY --link --from=orfs-builder-base /OpenROAD-flow-scripts/tools/install tools/install
38+
COPY --link \
39+
--exclude=.git* --exclude=tools/ --exclude=docs/ --exclude=docker/ \
40+
--exclude=flow/designs --exclude=flow/platforms --exclude=flow/scripts \
41+
--exclude=flow/test --exclude=flow/tutorials --exclude=flow/util \
42+
. ./

docker/Dockerfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ COPY InstallerOpenROAD.sh \
1515
ARG options=""
1616

1717
RUN ./DependencyInstaller.sh $options \
18-
&& rm -rf /tmp/installer
18+
&& rm -rf /tmp/installer /tmp/* /var/tmp/* /var/lib/apt/lists/*
1919

2020
ARG fromImage
2121

docs/conf.py

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
source_suffix = ['.md']
6464

6565
# The master toctree document.
66-
master_doc = 'index'
66+
master_doc = 'index2.md'
6767

6868
# List of patterns, relative to source directory, that match files and
6969
# directories to ignore when looking for source files.
@@ -77,6 +77,7 @@
7777
'README.md',
7878
'docs/releases/PostAlpha2.1BranchMethodology.md',
7979
'main',
80+
'index.md'
8081
]
8182

8283
# The name of the Pygments (syntax highlighting) style to use.
@@ -151,15 +152,55 @@ def setup(app):
151152
shutil.copy('../README.md', 'mainREADME.md')
152153
swap_prefix('mainREADME.md', '```mermaid', '```{mermaid}\n:align: center\n')
153154

155+
# Grab the reference file from OR
154156
url = 'https://raw.githubusercontent.com/The-OpenROAD-Project/OpenROAD/master/docs/contrib/GitGuide.md'
155157
get_file_from_url(url, 'contrib/GitGuide.md')
158+
159+
# Temporarily using commit number, will change once OR commit merged.
160+
url = 'https://raw.githubusercontent.com/The-OpenROAD-Project/OpenROAD/3563176d00daeb613eed2ccf9442137b0ae2cad3/docs/index.md'
161+
get_file_from_url(url, 'SupportedOS.md')
156162

157163
# edit OpenROAD to OpenROAD-flow-scripts for GitGuide
158164
with open('contrib/GitGuide.md', 'r') as f:
159165
content = f.read()
160-
161166
content = content.replace('user/Build.md', '../index.md#build-or-installing-orfs-dependencies')
162167
content = content.replace('OpenROAD', 'OpenROAD-flow-scripts')
163168
content = content.replace('The-OpenROAD-flow-scripts', 'The-OpenROAD')
164169
with open('contrib/GitGuide.md', 'w') as f:
165170
f.write(content)
171+
172+
# Create a copy of the index.md file
173+
import shutil
174+
shutil.copy('index.md', 'index2.md')
175+
176+
# Use re to find the desired content
177+
start_pattern = '## Supported Operating Systems'
178+
end_pattern = '## Code of conduct'
179+
with open('SupportedOS.md', 'r') as f:
180+
markdown_content = f.read()
181+
182+
match = re.search(f'{start_pattern}(.*?){end_pattern}', markdown_content, re.DOTALL)
183+
184+
assert match is not None, 'No match found, check the OR Doc pattern on index.md'
185+
extracted_content = match.group(1)
186+
extracted_content = "\n#### Supported Operating Systems" + extracted_content
187+
print(extracted_content)
188+
189+
# Find insert position
190+
with open('index2.md', 'r') as f:
191+
existing_content = f.read()
192+
match = re.search(r'### Setup', existing_content)
193+
assert match is not None, 'Check search keyword.'
194+
with open('index2.md', 'w') as f:
195+
insert_position = match.end() + 1
196+
before_insert = existing_content[:insert_position]
197+
after_insert = existing_content[insert_position:]
198+
199+
# Combine the parts with the extracted content
200+
updated_content = before_insert + extracted_content + after_insert
201+
202+
f.write(updated_content)
203+
204+
# Get Manpage file
205+
url = 'https://raw.githubusercontent.com/The-OpenROAD-Project/OpenROAD/master/src/utl/README.md'
206+
get_file_from_url(url, 'Manpage.md')
85.3 KB
Loading

docs/images/create_codespace.gif

180 KB
Loading

0 commit comments

Comments
 (0)