Skip to content

Commit edcbee7

Browse files
committed
Inserted test for tiles=2 in CI
1 parent 5aecd81 commit edcbee7

3 files changed

Lines changed: 82 additions & 20 deletions

File tree

.gitlab-ci.yml

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ variables:
1212

1313
stages:
1414
- clone
15-
- build
16-
- run
15+
- build_tiles_2
16+
- test_tiles_2
1717

1818

1919
.python:
@@ -50,32 +50,32 @@ clone-gvsoc:
5050
artifacts:
5151
paths: [ "gvsoc" ]
5252

53-
.gvsoc:
54-
extends: [.base, .python_gvsoc]
55-
script:
56-
- make gvsoc tiles=${tiles}
53+
# .gvsoc:
54+
# extends: [.base, .python_gvsoc]
55+
# script:
56+
# - make gvsoc tiles=${tiles}
5757

58-
gvsoc_tiles_2:
59-
extends: .gvsoc
60-
stage: build
61-
needs:
62-
- job: clone-gvsoc
63-
artifacts: true
64-
variables:
65-
tiles: 2
58+
# gvsoc_tiles_2:
59+
# extends: .gvsoc
60+
# stage: build
61+
# needs:
62+
# - job: clone-gvsoc
63+
# artifacts: true
64+
# variables:
65+
# tiles: 2
6666

6767

6868
.MAGIA:
6969
extends: [.base, .python]
7070
script:
7171
- make rtl-clean MAGIA_DIR=$MAGIA
72-
- source $MAGIA/magia_venv/bin/activate && make MAGIA MAGIA_DIR=$MAGIA tiles=${tiles} target_platform=${target_platform}
72+
- source $MAGIA/magia_venv/bin/activate && make MAGIA MAGIA_DIR=$MAGIA tiles=${tiles} target_platform=${target_platform} fast_sim=1
7373
artifacts:
7474
paths: [ "$MAGIA/work", "$MAGIA/sim/work", "$MAGIA/sim/modelsim.ini", "$MAGIA/scripts/sim_ret_errors.sh", "$MAGIA/scripts/compile.tcl" ]
7575

76-
MAGIA_V2_TILES_2:
76+
magia_v2_tiles_2:
7777
extends: .MAGIA
78-
stage: build
78+
stage: build_tiles_2
7979
needs:
8080
- job: clone-magia
8181
artifacts : true
@@ -90,15 +90,43 @@ MAGIA_V2_TILES_2:
9090
.build:
9191
extends: [.base, .export_toolchain]
9292
script:
93-
- make clean build tiles=${tiles} target_platform=${target_platform} compiler=${compiler}
93+
- make clean build tiles=${tiles} target_platform=${target_platform} compiler=${compiler} eval=1
9494
artifacts:
9595
paths: [ "build" ]
9696

97-
build_test_magiav2_tiles_2:
97+
build_test_magia_v2_tiles_2:
9898
extends: .build
99-
stage: build
99+
stage: build_tiles_2
100100
variables:
101101
tiles: 2
102102
target_platform: magia_v2
103103
compiler: GCC_PULP
104104

105+
.sim:
106+
extends: [.base, .export_toolchain]
107+
script:
108+
- export TESTLOG="${TESTNAME##*/}"
109+
- make run MAGIA_DIR=$MAGIA platform=${platform} test=$TESTNAME tiles=${tiles} > $TESTLOG.log
110+
- ./scripts/sim_ret_errors.sh $TESTLOG.log
111+
artifacts:
112+
paths: [ "*.log" ]
113+
expire_in: 2 weeks
114+
115+
magia_v2_tiles_2_rtl_sim:
116+
extends: [.sim]
117+
stage: test_tiles_2
118+
needs:
119+
- job: clone-magia
120+
artifacts: true
121+
- job: magia_v2_tiles_2
122+
artifacts: true
123+
- job: build_test_magia_v2_tiles_2
124+
artifacts: true
125+
variables:
126+
platform: rtl
127+
tiles: 2
128+
parallel:
129+
matrix:
130+
- TESTNAME: [test_helloworld, test_fsync_levels, test_fsync_rc, test_fsync_diag, test_mm_is, test_mm_ws, test_mm_os, test_idma_2d, test_idma_1d, test_cemm_global, test_mm_is_2, test_mm_os_2, test_mm_ws_2, test_fsync_lr, test_gemv]
131+
132+

scripts/sim_ret_errors.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2025 ETH Zurich and University of Bologna.
4+
# Solderpad Hardware License, Version 0.51, see LICENSE.SHL for details.
5+
# SPDX-License-Identifier: SHL-0.51
6+
7+
# Author: Alessandro Nadalini <alessandro.nadalini3@unibo.it>
8+
9+
LOGFILE="$1"
10+
11+
if [[ ! -f "$LOGFILE" ]]; then
12+
echo "Error: File not found!"
13+
exit 2
14+
fi
15+
16+
# Extract the number from the last occurrence of "Errors: N"
17+
errors=$(grep -oP 'Errors:\s*\K[0-9]+' "$LOGFILE" | tail -n 1)
18+
19+
if [[ -z "$errors" ]]; then
20+
echo "No 'Errors:' pattern found in log file."
21+
exit 3
22+
fi
23+
24+
# Exit with 1 if errors > 0, else 0
25+
if [[ "$errors" -gt 0 ]]; then
26+
exit 1
27+
else
28+
exit 0
29+
fi

tests/magia/mesh/mm_is_2/src/test.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ int main(void){
148148
volatile uint32_t output_pt_prev;
149149
volatile uint32_t weight_pt_next;
150150
//redmule_mcnfig((uint16_t) t_size, (uint16_t) tile_h, (uint16_t) tile_w);
151+
152+
fsync_sync_level(&fsync_ctrl, MAX_SYNC_LVL - 1, 0);
153+
#if STALLING == 0
154+
eu_fsync_wait(&eu_ctrl, WAIT_MODE);
155+
#endif
151156

152157
/**
153158
* TEST LOOP - REPEAT THE TEST N_ITERATION TIMES.

0 commit comments

Comments
 (0)