Skip to content

Commit

Permalink
debian-bullseye/openroad: add openroad/gui (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed May 23, 2022
1 parent d02a2e7 commit cdb9638
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 9 deletions.
48 changes: 44 additions & 4 deletions debian-bullseye/openroad/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ARG REGISTRY='gcr.io/hdl-containers/debian/bullseye'

#---

FROM $REGISTRY/build/dev AS build
FROM $REGISTRY/build/dev AS setup

RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC \
&& apt-get update -qq \
Expand All @@ -30,12 +30,31 @@ RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC && build
RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC && setup

#---

FROM scratch AS version
COPY --from=build /tmp/hdlc.openroad.version /
COPY --from=setup /tmp/hdlc.openroad.version /

#---

FROM setup AS build

RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC && build

#---

FROM setup AS build-gui

RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends ${makedepends_gui[@]} \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC && build

#---

Expand All @@ -44,12 +63,33 @@ COPY --from=build /opt/openroad /openroad

#---

FROM $REGISTRY/build/base
FROM scratch AS pkg-gui
COPY --from=build-gui /opt/openroad /openroad-gui

#---

FROM $REGISTRY/build/base AS run

RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends ${depends[@]} \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*

#---

FROM run AS openroad

COPY --from=build /opt/openroad /

#---

FROM run AS gui

RUN --mount=type=bind,target=/tmp/ctx . /tmp/ctx/HDLC \
&& apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends ${depends_gui[@]} \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build-gui /opt/openroad /
20 changes: 16 additions & 4 deletions debian-bullseye/openroad/HDLC
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

# Authors:
# Unai Martinez-Corral
# Torsten Meissner
#
# Copyright 2021 Unai Martinez-Corral <[email protected]>
# Copyright 2022 Unai Martinez-Corral <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,19 +34,32 @@ makedepends=(
tcllib
)

build() {
makedepends_gui=(
qtbase5-dev
)

setup() {
git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD.git /tmp/openroad
cd /tmp/openroad
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g' > /tmp/hdlc.openroad.version
mkdir build
cd build
}

build() {
cd /tmp/openroad/build
cmake ..
make DESTDIR=/opt/openroad install
}

# -DBUILD_GUI=ON

depends=(
libomp5-11
libpython3.9
libspdlog1
tcl
)

depends_gui=(
libqt5widgets5
)
11 changes: 11 additions & 0 deletions doc/graph/asic.dot
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ digraph G {
"magic"
"netgen"
"openroad"
"openroad/gui"
}
{ node [color=mediumblue, fontcolor=mediumblue]
"pkg/irsim"
"pkg/klayout"
"pkg/magic"
"pkg/netgen"
"pkg/openroad"
"pkg/openroad/gui"
}
{ node [color=brown, fontcolor=brown]
"magic/irsim"
Expand Down Expand Up @@ -178,17 +180,24 @@ digraph G {

d_openroad -> {
"openroad"
"openroad/gui"
"pkg/openroad"
"pkg/openroad/gui"
} [style=dotted];

{
node [shape=folder, color=red, fontcolor=red]
"t_openroad" [label="openroad"];
"t_pkg/openroad" [label="openroad.pkg"];
"t_openroad/gui" [label="openroad--gui"];
"t_pkg/openroad/gui" [label="openroad--gui.pkg"];
}

"openroad" -> "t_openroad";
"pkg/openroad" -> "t_pkg/openroad";

"openroad/gui" -> "t_openroad/gui";
"pkg/openroad/gui" -> "t_pkg/openroad/gui";
}

# Dockerfile dependencies
Expand Down Expand Up @@ -228,6 +237,8 @@ digraph G {
"p_netgen_scratch" -> "pkg/netgen";
"p_openroad_build/base" -> "openroad";
"p_openroad_scratch" -> "pkg/openroad";
"p_openroad_build/base" -> "openroad/gui";
"p_openroad_scratch" -> "pkg/openroad/gui";
}

{ edge [style=dashed, color=grey]
Expand Down
4 changes: 4 additions & 0 deletions doc/graph/graph.dot
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ digraph G {
"nextpnr"
"openfpgaloader"
"openroad"
"openroad/gui"
"prjoxide"
"prjtrellis"
"verilator"
Expand Down Expand Up @@ -88,6 +89,7 @@ digraph G {
"pkg/nextpnr/generic"
"pkg/openfpgaloader"
"pkg/openroad"
"pkg/openroad/gui"
"pkg/osvb"
"pkg/pono"
"pkg/prjoxide"
Expand Down Expand Up @@ -308,11 +310,13 @@ digraph G {
"magic/irsim"
"netgen"
"openroad"
"openroad/gui"
"pkg/irsim"
"pkg/klayout"
"pkg/magic"
"pkg/netgen"
"pkg/openroad"
"pkg/openroad/gui"
};
}

Expand Down
2 changes: 2 additions & 0 deletions doc/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ openroad:
src: true
pkg:
- 'openroad'
- 'openroad/gui'
use:
- 'openroad'
- 'openroad/gui'

#---

Expand Down
28 changes: 28 additions & 0 deletions test/openroad--gui.pkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

# Authors:
# Unai Martinez-Corral
#
# Copyright 2020-2022 Unai Martinez-Corral <[email protected]>
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0

set -e

cd $(dirname "$0")

./openroad.pkg.sh

./_todo.sh
30 changes: 30 additions & 0 deletions test/openroad--gui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env sh

# Authors:
# Unai Martinez-Corral
#
# Copyright 2020-2022 Unai Martinez-Corral <[email protected]>
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0

set -e

cd $(dirname "$0")

./_env.sh

./openroad.sh

./_todo.sh
11 changes: 10 additions & 1 deletion utils/pyHDLC/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ defaults:
# ASIC:
magic: { dockerfile: magic, target: magic }
magic/irsim: { dockerfile: magic, target: irsim }
openroad: { dockerfile: openroad, target: openroad }
pkg/openroad/gui: { dockerfile: openroad, target: pkg-gui }
openroad/gui: { dockerfile: openroad, target: gui }


jobs:
Expand All @@ -134,7 +137,6 @@ jobs:
klayout: *SysDebianAmd64
netgen: *SysDebianDefaultArchSet
openfpgaloader: *SysDebianDefaultArchSet
openroad: *SysDebianAmd64
prjoxide: *SysDebianAmd64
prjtrellis: *SysDebianAmd64
verilator: *SysDebianDefaultArchSet
Expand Down Expand Up @@ -235,6 +237,13 @@ jobs:
- nextpnr/generic
- nextpnr
sys: *SysDebianAmd64
openroad:
images:
- pkg/openroad
- openroad
- pkg/openroad/gui
- openroad/gui
sys: *SysDebianAmd64
osvb:
images:
- pkg/osvb
Expand Down

0 comments on commit cdb9638

Please sign in to comment.