Skip to content

Commit 7dd4a58

Browse files
committed
[GAP9] Docker CI Test
1 parent 71896e7 commit 7dd4a58

8 files changed

Lines changed: 105 additions & 36 deletions

File tree

.github/workflows/_runner-gap9-tiled.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ jobs:
7171
max_attempts: 3
7272
retry_on: timeout
7373
command: |
74+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
75+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh
7476
cd DeeployTest
7577
mkdir -p /app/.ccache
7678
export CCACHE_DIR=/app/.ccache

.github/workflows/_runner-gap9.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ jobs:
4141
key: ccache-ci
4242
- name: Run Test
4343
run: |
44+
# Activate GAP9 SDK environment
45+
source /app/install/gap9-sdk/.gap9-venv/bin/activate
46+
source /app/install/gap9-sdk/configs/gap9_evk_audio.sh
47+
4448
testNames="${{ inputs.test-names }}"
4549
cd DeeployTest
4650
mkdir -p /app/.ccache

.github/workflows/ci-deeploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ name: CI • Deeploy
1717
docker_image_deeploy:
1818
description: "Deeploy Image to use"
1919
required: false
20-
default: "ghcr.io/pulp-platform/deeploy:devel"
20+
default: "ghcr.io/runwang/deeploy:gap"
2121

2222
concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}

Container/Dockerfile.deeploy

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,65 @@ COPY Makefile ./
2626
COPY requirements-dev.txt ./
2727

2828
# Install SSH keys to access private repositories
29-
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan iis-git.ee.ethz.ch >> ~/.ssh/known_hosts
30-
31-
# Compile emulators
29+
RUN mkdir -p -m 0700 ~/.ssh && \
30+
ssh-keyscan iis-git.ee.ethz.ch >> ~/.ssh/known_hosts && \
31+
ssh-keyscan github.com >> ~/.ssh/known_hosts
32+
33+
# Install build dependencies for GAP9 SDK
34+
RUN apt-get update && \
35+
apt-get install -y \
36+
device-tree-compiler \
37+
bison \
38+
flex \
39+
rsync \
40+
build-essential \
41+
g++ \
42+
python3-dev && \
43+
rm -rf /var/lib/apt/lists/*
44+
45+
# Compile emulators (except banshee and gvsoc)
3246
# WIESEP: We need to already clean up some space, otherwise the GitHub runners run out of disk space
3347
RUN --mount=type=cache,target=/ccache \
3448
--mount=type=cache,target=/root/.cache/pip \
3549
--mount=type=cache,target=/root/.cargo/registry \
36-
ccache -z && \
37-
make pulp-sdk chimera-sdk qemu mempool banshee xtensor && \
38-
make gvsoc && \
39-
cp -r /app/toolchain/gvsoc/core/requirements.txt /app/core-requirements.txt && \
50+
make pulp-sdk chimera-sdk qemu mempool xtensor
51+
52+
# Install Rust 1.70.0 separately for better caching
53+
RUN --mount=type=cache,target=/root/.cargo/registry \
54+
rustup install 1.70.0 && \
55+
rustup default 1.70.0
56+
57+
# Install GAP9 RISC-V GCC toolchain (required for GAP9 SDK build)
58+
RUN --mount=type=cache,target=/ccache \
59+
make gap9-toolchain
60+
61+
# Build GAP9 SDK
62+
RUN --mount=type=ssh \
63+
--mount=type=cache,target=/ccache \
64+
--mount=type=cache,target=/root/.cache/pip \
65+
make gap9-sdk
66+
67+
# Compile banshee with Rust 1.70.0
68+
RUN --mount=type=cache,target=/ccache \
69+
--mount=type=cache,target=/root/.cache/pip \
70+
--mount=type=cache,target=/root/.cargo/registry \
71+
export PATH="/root/.rustup/toolchains/1.70.0-x86_64-unknown-linux-gnu/bin:$PATH" && \
72+
make banshee
73+
74+
# Compile gvsoc
75+
RUN --mount=type=cache,target=/ccache \
76+
--mount=type=cache,target=/root/.cache/pip \
77+
--mount=type=cache,target=/root/.cargo/registry \
78+
make gvsoc
79+
80+
# Save gvsoc requirements and clean up toolchain source
81+
RUN cp -r /app/toolchain/gvsoc/core/requirements.txt /app/core-requirements.txt && \
4082
cp -r /app/toolchain/gvsoc/gapy/requirements.txt /app/gapy-requirements.txt && \
41-
rm -rf toolchain/pulp-sdk toolchain/qemu toolchain/mempool toolchain/banshee toolchain/xtensor toolchain/xtl toolchain/xsimd toolchain/gvsoc && \
42-
ccache -s
83+
rm -rf toolchain/pulp-sdk toolchain/qemu toolchain/mempool toolchain/banshee toolchain/xtensor toolchain/xtl toolchain/xsimd toolchain/gvsoc
4384

4485
# Install SoftHier emulator and toolchain
4586
RUN --mount=type=cache,target=/ccache \
46-
ccache -z && \
47-
make SOFTHIER_INSTALL_DIR=/app/install/softhier softhier && \
48-
ccache -s
87+
make SOFTHIER_INSTALL_DIR=/app/install/softhier softhier
4988

5089
# Install Bender
5190
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
@@ -62,18 +101,10 @@ fi
62101
ENV CC="gcc"
63102
ENV CXX="g++"
64103

65-
RUN --mount=type=ssh \
66-
--mount=type=cache,target=/ccache \
67-
--mount=type=cache,target=/root/.cache/pip \
68-
ccache -z && \
69-
make gap9-sdk && \
70-
ccache -s
71104

72105
RUN --mount=type=cache,target=/ccache \
73106
--mount=type=cache,target=/root/.cache/pip \
74-
ccache -z && \
75-
make snitch_runtime && \
76-
ccache -s
107+
make snitch_runtime
77108

78109
# Remove toolchain to make the container lighter
79110
RUN rm -rf toolchain

Deeploy/Targets/GAP9/Platform.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ class GAP9StructBuffer(StructBuffer):
232232
_includeList = [
233233
"pmsis.h",
234234
"DeeployGAP9Math.h",
235-
"pulp_nn_kernels.h",
236235
"DeeployMchan.h"
237236
]
238237

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,25 +412,27 @@ ${TOOLCHAIN_DIR}/gap9-toolchain:
412412
${GAP_RISCV_GCC_INSTALL_DIR}: ${TOOLCHAIN_DIR}/gap9-toolchain
413413
cd ${TOOLCHAIN_DIR}/gap9-toolchain && \
414414
mkdir -p ${GAP_RISCV_GCC_INSTALL_DIR} && \
415+
sed -i 's/sudo rsync/rsync/g' install.sh && \
415416
./install.sh ${GAP_RISCV_GCC_INSTALL_DIR}
416417

417418
gap9-toolchain: ${GAP_RISCV_GCC_INSTALL_DIR}
418419

419420
${TOOLCHAIN_DIR}/gap9-sdk:
420421
cd ${TOOLCHAIN_DIR} && \
421-
git clone git@iis-git.ee.ethz.ch:wiesep/gap9_sdk.git gap9-sdk && \
422-
cd ${TOOLCHAIN_DIR}/gap9-sdk && git checkout ${GAP9_SDK_COMMIT_HASH} && \
423-
git submodule update --init --recursive && \
424-
git apply ${TOOLCHAIN_DIR}/gap9-sdk.patch
422+
git clone git@github.com:pulp-platform/gap-sdk.git gap9-sdk && \
423+
cd ${TOOLCHAIN_DIR}/gap9-sdk && \
424+
git submodule update --init --recursive
425425

426-
${GAP9_SDK_INSTALL_DIR}: ${TOOLCHAIN_DIR}/gap9-sdk
426+
${GAP9_SDK_INSTALL_DIR}: ${TOOLCHAIN_DIR}/gap9-sdk ${GAP_RISCV_GCC_INSTALL_DIR}
427427
mkdir -p ${GAP9_SDK_INSTALL_DIR}
428428
cp -r ${TOOLCHAIN_DIR}/gap9-sdk ${GAP9_SDK_INSTALL_DIR}/../ && \
429429
cd ${GAP9_SDK_INSTALL_DIR} && \
430430
python -m venv .gap9-venv && \
431431
. .gap9-venv/bin/activate && \
432432
. configs/gap9_evk_audio.sh && \
433-
make install_dependency cmake_sdk.build && \
433+
sed -i '/pip3 install -r tools\/audio-framework\/requirements.txt/s/^/# /' install_python_deps.sh && \
434+
./install_python_deps.sh && \
435+
make cmake_sdk.build && \
434436
deactivate
435437

436438
gap9-sdk: ${GAP9_SDK_INSTALL_DIR}

TargetLibraries/GAP9/CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ file(GLOB_RECURSE SOURCES
77
)
88

99
# RW: Include PULPOpen sources but exclude dory_mem related files
10-
file(GLOB_RECURSE PULPOPEN_SOURCES "../PULPOpen/src/**")
11-
list(FILTER PULPOPEN_SOURCES EXCLUDE REGEX ".*dory_mem.*")
12-
list(APPEND SOURCES ${PULPOPEN_SOURCES})
10+
#file(GLOB_RECURSE PULPOPEN_SOURCES "../PULPOpen/src/**")
11+
#list(FILTER PULPOPEN_SOURCES EXCLUDE REGEX ".*dory_mem.*")
12+
#list(APPEND SOURCES ${PULPOPEN_SOURCES})
1313

1414
if(NOT DEFINED ENV{GAP_SDK_HOME})
1515
message(FATAL_ERROR "Environment variable GAP_SDK_HOME not set.")
@@ -19,9 +19,14 @@ add_deeploy_library(deeploygap9 STATIC ${SOURCES})
1919
target_include_directories(deeploygap9
2020
PUBLIC
2121
${CMAKE_CURRENT_LIST_DIR}/inc
22-
${CMAKE_CURRENT_LIST_DIR}/../PULPOpen/inc
2322
)
2423

24+
#target_include_directories(deeploygap9
25+
# PUBLIC
26+
# ${CMAKE_CURRENT_LIST_DIR}/inc
27+
# ${CMAKE_CURRENT_LIST_DIR}/../PULPOpen/inc
28+
#)
29+
2530
target_compile_options(deeploygap9 PUBLIC
2631
-DNUM_CORES=${NUM_CORES}
2732
)
@@ -42,11 +47,11 @@ target_link_libraries(deeploygap9 PUBLIC pmsis)
4247
set(PULPNNVERSION XPULPV2)
4348
set(PULPNNBITWIDTH 32)
4449
add_compile_definitions(NUM_CORES=${NUM_CORES})
45-
add_subdirectory(third_party/pulp-nn-mixed)
50+
#add_subdirectory(third_party/pulp-nn-mixed)
4651

4752
#RW: GCC not recognizing -Wno-typedef-redefinition defined in PULP-NN CMakelist
48-
target_compile_options(pulp-nn-mixed PRIVATE -Wno-error)
49-
target_link_libraries(deeploygap9 PUBLIC pulp-nn-mixed)
53+
#target_compile_options(pulp-nn-mixed PRIVATE -Wno-error)
54+
#target_link_libraries(deeploygap9 PUBLIC pulp-nn-mixed)
5055

5156
target_link_libraries(deeploygap9 PUBLIC m)
5257

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: 2025 ETH Zurich and University of Bologna
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
set(GAP_SDK_HOME $ENV{GAP_SDK_HOME})
6+
7+
set(GAP9_SDK_INCLUDES
8+
${GAP_SDK_HOME}/rtos/pmsis/include
9+
${GAP_SDK_HOME}/rtos/pmsis/api/include
10+
${GAP_SDK_HOME}/rtos/pmsis/api/include/pmsis/chips/gap9
11+
${GAP_SDK_HOME}/rtos/pmsis/api/include/pmsis/implem/gap9
12+
${GAP_SDK_HOME}/rtos/pmsis/pmsis_bsp/include
13+
${GAP_SDK_HOME}/rtos/freeRTOS/vendors/gwt/gap9/pmsis/include
14+
${GAP_SDK_HOME}/rtos/freeRTOS/vendors/gwt/gap9/config
15+
${GAP_SDK_HOME}/rtos/freeRTOS/freertos_kernel/include
16+
)
17+
18+
set(GAP9_SDK_COMPILE_FLAGS
19+
-D__riscv__
20+
-D__GAP9__
21+
-DCHIP=GAP9_V2
22+
-DCONFIG_GAP9_V2
23+
)
24+
25+
set(PULP_SDK_INCLUDES ${GAP9_SDK_INCLUDES})
26+
set(PULP_SDK_COMPILE_FLAGS ${GAP9_SDK_COMPILE_FLAGS})

0 commit comments

Comments
 (0)