Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPEN] GVSOC support for the Snitch Cluster platform #23

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/BuildDocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
file: Container/Dockerfile
push: true
# JUNGVI: If you operate from a fork and want to build a new docker make sure to replace 'pulp-platform' by your uname.
tags: ghcr.io/pulp-platform/deeploy:main
tags: ghcr.io/tahaelbayad/deeploy:main
22 changes: 14 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build-deeploy:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -104,6 +104,9 @@ jobs:
TestRQAdd
testRQGEMMTransB
num-cores: 9
simulators: |
banshee
gvsoc

snitch-kernels-tiled-singlebuffer-L2:
uses: ./.github/workflows/TestRunnerTiledSnitchSequential.yml
Expand Down Expand Up @@ -131,6 +134,9 @@ jobs:
"L1": [5000, 10000]
}
]
simulators: |
banshee
gvsoc

### Mempool Tests ###
mempool-kernels:
Expand Down Expand Up @@ -543,7 +549,7 @@ jobs:
deeploy-state-serialization:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -563,7 +569,7 @@ jobs:
deeploy-memory-level-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -583,7 +589,7 @@ jobs:
deeploy-tiler-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -607,7 +613,7 @@ jobs:
deeploy-memory-allocation-extension:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -629,7 +635,7 @@ jobs:
deeploy-typing:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -646,7 +652,7 @@ jobs:
deeploy-regex-matching:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -663,7 +669,7 @@ jobs:
linting:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerCortexM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-cortexm:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerGeneric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-generic:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerMempool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test-runner-mempool:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerSiracusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test-runner-siracusa:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/TestRunnerSnitch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ on:
num-cores:
required: true
type: number
simulator:
required: false
default: "banshee"
simulators:
required: true
type: string

jobs:
test-runner-snitch:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -29,11 +28,16 @@ jobs:
- name: Run Test
run: |
testNames="${{ inputs.test-names }}"
simulators="${{inputs.simulators}}"
cd DeeployTest
echo "$testNames" | while IFS= read -r testName; do
if [[ -n "$testName" ]]; then
echo "Running test: $testName"
python testRunner_snitch.py -t Tests/$testName --simulator=${{ inputs.simulator }} --cores=${{ inputs.num-cores }} --toolchain_install_dir /app/install/riscv-llvm/
echo "$simulators" | while IFS= read -r simulator; do
if [[ -n "$simulator" ]]; then
echo "$testNames" | while IFS= read -r testName; do
if [[ -n "$testName" ]]; then
echo "Running test $testName using $simulator"
python testRunner_snitch.py -t Tests/$testName --simulator=$simulator --cores=${{ inputs.num-cores }} --toolchain_install_dir /app/install/riscv-llvm/
fi
done
fi
done
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerTiledSiracusa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
L1: ${{ fromJSON(inputs.L1) }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerTiledSiracusaSequential.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
test-runner-siracusa-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/TestRunnerTiledSiracusaWithNeureka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
L1: ${{ fromJSON(inputs.L1) }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
test-runner-siracusa-neureka-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/TestRunnerTiledSnitchSequential.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ on:
required: false
default: "L2"
type: string
simulator:
required: false
default: "banshee"
simulators:
required: true
type: string


Expand All @@ -25,7 +24,7 @@ jobs:
test-runner-snitch-tiled:
runs-on: ubuntu-22.04
container:
image: ghcr.io/pulp-platform/deeploy:main
image: ghcr.io/tahaelbayad/deeploy:main
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -43,18 +42,22 @@ jobs:
key: ${{ runner.os }}-ccache
- name: Run Tests
run: |
simulators="${{inputs.simulators}}"
cd DeeployTest
echo '${{ inputs.tests-config }}' > tests.json
mkdir -p /app/.ccache
export CCACHE_DIR=/app/.ccache

jq -c '.[]' tests.json | while read test; do
testName=$(echo "$test" | jq -r '.name')
L1_values=$(echo "$test" | jq -r '.L1[]')
for L1_value in $L1_values; do
echo "Running test: $testName with L1: $L1_value"
python testRunner_tiled_snitch.py -t Tests/$testName --cores=${{ inputs.num-cores }} --simulator=${{ inputs.simulator }} --l1 $L1_value --defaultMemLevel=${{ inputs.default-memory-level }} --toolchain_install_dir /app/install/riscv-llvm/
done
echo "$simulators" | while IFS= read -r simulator; do
if [[ -n "$simulator" ]]; then
jq -c '.[]' tests.json | while read test; do
testName=$(echo "$test" | jq -r '.name')
L1_values=$(echo "$test" | jq -r '.L1[]')
for L1_value in $L1_values; do
echo "Running test: $testName with L1: $L1_value using $simulator"
python testRunner_tiled_snitch.py -t Tests/$testName --cores=${{ inputs.num-cores }} --simulator=$simulator --l1 $L1_value --defaultMemLevel=${{ inputs.default-memory-level }} --toolchain_install_dir /app/install/riscv-llvm/
done
done
fi
done
shell: bash

5 changes: 5 additions & 0 deletions Container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ RUN make pulp-sdk
RUN make qemu
RUN make mempool
RUN make banshee
RUN make gvsoc && cp -r /app/toolchain/gvsoc/core/requirements.txt /app/core-requirements.txt && cp -r /app/toolchain/gvsoc/gapy/requirements.txt /app/gapy-requirements.txt
lukamac marked this conversation as resolved.
Show resolved Hide resolved

# Dependencies needed for compiling Snitch
## Bender's installaton
Expand Down Expand Up @@ -114,6 +115,7 @@ ENV CMAKE=/usr/bin/cmake
ENV PULP_SDK_HOME=/app/install/pulp-sdk
ENV LLVM_INSTALL_DIR=/app/install/llvm
ENV SNITCH_HOME=/app/install/snitch_cluster
ENV GVSOC_INSTALL_DIR=/app/install/gvsoc
ENV MEMPOOL_HOME=/app/install/mempool
ENV PATH=/app/install/qemu/bin:/app/install/banshee:$PATH
ENV PATH="/root/.cargo/bin:${PATH}"
Expand All @@ -140,6 +142,9 @@ pip install toml-to-requirements && \
toml-to-req --toml-file pyproject.toml && \
pip install -r requirements.txt

COPY --from=builder /app/core-requirements.txt ./core-requirements.txt
COPY --from=builder /app/gapy-requirements.txt ./gapy-requirements.txt
RUN pip install -r core-requirements.txt -r gapy-requirements.txt

# Copy pre-built toolchains and emulators
COPY --from=builder /app/install ./install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
_dumpCycleCntTemplate = NodeTemplate("""
snrt_cluster_hw_barrier();
if (snrt_is_dm_core()) {
#ifndef BANSHEE_SIMULATION
#ifndef BANSHEE_SIMULATION || GVSOC_SIMULATION
DUMP(getCycles());
#else
printf("${position} of ${nodeName} block at cycle %d \\n", getCycles());
Expand Down
1 change: 1 addition & 0 deletions DeeployTest/Platforms/Snitch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ add_deeploy_executable(${ProjectId} EXCLUDE_FROM_ALL ${SOURCES})
target_link_libraries(${ProjectId} PRIVATE network deeploylib)
target_compile_options(${ProjectId} INTERFACE network)
add_banshee_simulation(${ProjectId})
add_gvsoc_simulation(${ProjectId})
add_snitch_cluster_vsim_simulation(${ProjectId})
add_snitch_cluster_vsim_gui_simulation(${ProjectId})
6 changes: 3 additions & 3 deletions DeeployTest/Platforms/Snitch/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int main(void) {
uint32_t core_id = snrt_global_core_idx();
uint32_t compute_core_id = snrt_global_compute_core_idx();

#ifdef BANSHEE_SIMULATION
#ifdef BANSHEE_SIMULATION || GVSOC_SIMULATION
uint32_t const num_compute_cores = (NUM_CORES - 1);
#else
uint32_t const num_compute_cores = snrt_global_compute_core_num();
Expand Down Expand Up @@ -98,7 +98,7 @@ int main(void) {

snrt_cluster_hw_barrier();

#ifndef BANSHEE_SIMULATION
#ifndef BANSHEE_SIMULATION || GVSOC_SIMULATION
lukamac marked this conversation as resolved.
Show resolved Hide resolved
if (snrt_is_dm_core()) {
ResetTimer();
StartTimer();
Expand All @@ -108,7 +108,7 @@ int main(void) {
RunNetwork(compute_core_id, num_compute_cores);

uint32_t runtimeCycles = 0;
#ifndef BANSHEE_SIMULATION
#ifndef BANSHEE_SIMULATION || GVSOC_SIMULATION
if (snrt_is_dm_core()) {
runtimeCycles = getCycles();
DUMP(runtimeCycles);
Expand Down
2 changes: 1 addition & 1 deletion DeeployTest/testRunner_snitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
metavar = "<simulator>",
dest = "simulator",
type = str,
choices = ["banshee", "vsim", "vsim.gui"],
choices = ["banshee", "vsim", "vsim.gui", "gvsoc"],
default = "banshee",
help = "Select the simulator to use")
args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion DeeployTest/testRunner_tiled_snitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
metavar = "<simulator>",
dest = "simulator",
type = str,
choices = ["banshee", "vsim", "vsim.gui"],
choices = ["banshee", "vsim", "vsim.gui", "gvsoc"],
default = "banshee",
help = "Select the simulator to use")

Expand Down
5 changes: 5 additions & 0 deletions DeeployTest/testUtils/testRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ def configure_cmake_project(self):
else:
self.cmake_args += " -D banshee_simulation=OFF"

if self._simulator == 'gvsoc':
self.cmake_args += " -D gvsoc_simulation=ON"
else:
self.cmake_args += " -D gvsoc_simulation=OFF"

command = f"$CMAKE -D TOOLCHAIN={self._args.toolchain} -D TOOLCHAIN_INSTALL_DIR={self._dir_toolchain} -D GENERATED_SOURCE={self._dir_gen} -D platform={self._platform} {self.cmake_args} -B {self._dir_build} -D TESTNAME={self._name_test} .."

if self._args.verbose >= 3:
Expand Down
Loading
Loading