Skip to content

Commit 250a574

Browse files
committed
Migrating all tests to new kernel launch API
1 parent 8b63305 commit 250a574

Some content is hidden

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

77 files changed

+940
-1087
lines changed

ci/blackbox.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,11 @@ then
232232
if [ $HAS_ARGS -eq 1 ]
233233
then
234234
echo "running: VORTEX_RT_PATH=$TEMPDIR OPTS=$ARGS make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1"
235-
VORTEX_RT_PATH=$TEMPDIR OPTS=$ARGS make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
235+
DEBUG=1 VORTEX_RT_PATH=$TEMPDIR OPTS=$ARGS make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
236236
status=$?
237237
else
238238
echo "running: VORTEX_RT_PATH=$TEMPDIR make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1"
239-
VORTEX_RT_PATH=$TEMPDIR make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
239+
DEBUG=1 VORTEX_RT_PATH=$TEMPDIR make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
240240
status=$?
241241
fi
242242

@@ -257,11 +257,11 @@ then
257257
if [ $HAS_ARGS -eq 1 ]
258258
then
259259
echo "running: OPTS=$ARGS make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1"
260-
OPTS=$ARGS make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
260+
DEBUG=1 OPTS=$ARGS make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
261261
status=$?
262262
else
263263
echo "running: make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1"
264-
make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
264+
DEBUG=1 make -C $APP_PATH run-$DRIVER > $LOGFILE 2>&1
265265
status=$?
266266
fi
267267
fi

ci/regression.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ opencl()
133133
make -C tests/opencl run-simx
134134
make -C tests/opencl run-rtlsim
135135

136+
./ci/blackbox.sh --driver=simx --app=lbm --warps=8
137+
./ci/blackbox.sh --driver=rtlsim --app=lbm --warps=8
138+
136139
echo "opencl tests done!"
137140
}
138141

hw/rtl/afu/opae/vortex_afu.sv

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ module vortex_afu import ccip_if_pkg::*; import local_mem_cfg_pkg::*; import VX_
9696

9797
wire [127:0] afu_id = `AFU_ACCEL_UUID;
9898

99-
wire [63:0] dev_caps = {8'b0,
99+
wire [63:0] dev_caps = {16'b0,
100100
8'(`LMEM_ENABLED ? `LMEM_LOG_SIZE : 0),
101-
8'(`NUM_BARRIERS),
102101
16'(`NUM_CORES * `NUM_CLUSTERS),
103102
8'(`NUM_WARPS),
104103
8'(`NUM_THREADS),

hw/rtl/afu/xrt/VX_afu_ctrl.sv

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,8 @@ module VX_afu_ctrl #(
142142
RSTATE_DATA = 2'd1;
143143

144144
// device caps
145-
wire [63:0] dev_caps = {8'b0,
145+
wire [63:0] dev_caps = {16'b0,
146146
8'(`LMEM_ENABLED ? `LMEM_LOG_SIZE : 0),
147-
8'(`NUM_BARRIERS),
148147
16'(`NUM_CORES * `NUM_CLUSTERS),
149148
8'(`NUM_WARPS),
150149
8'(`NUM_THREADS),

kernel/include/vx_intrinsics.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@
1717
#ifndef __VX_INTRINSICS_H__
1818
#define __VX_INTRINSICS_H__
1919

20-
#include <stddef.h>
20+
#include <stdint.h>
2121
#include <VX_types.h>
2222

23+
#if __riscv_xlen == 64
24+
typedef unsigned long size_t; // 64-bit RISC-V
25+
#elif __riscv_xlen == 32
26+
typedef unsigned int size_t; // 32-bit RISC-V
27+
#else
28+
#error "Unknown RISC-V architecture"
29+
#endif
30+
2331
#if defined(__clang__)
2432
#define __UNIFORM__ __attribute__((annotate("vortex.uniform")))
2533
#else

kernel/include/vx_spawn.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@
2121
extern "C" {
2222
#endif
2323

24-
typedef void (*vx_spawn_tasks_cb)(uint32_t task_id, void *arg);
25-
26-
typedef void (*vx_serial_cb)(void *arg);
27-
28-
void vx_spawn_tasks(uint32_t num_tasks, vx_spawn_tasks_cb callback, const void * arg);
29-
30-
void vx_serial(vx_serial_cb callback, const void * arg);
31-
32-
///////////////////////////////////////////////////////////////////////////////
33-
3424
typedef union {
3525
struct {
3626
uint32_t x;
@@ -46,23 +36,28 @@ extern dim3_t gridDim;
4636
extern dim3_t blockDim;
4737

4838
extern __thread uint32_t __local_group_id;
49-
extern uint32_t __groups_per_core;
5039
extern uint32_t __warps_per_group;
5140

5241
typedef void (*vx_kernel_func_cb)(void *arg);
5342

43+
typedef void (*vx_serial_cb)(void *arg);
44+
5445
#define __local_mem(size) \
5546
(void*)((int8_t*)csr_read(VX_CSR_LOCAL_MEM_BASE) + __local_group_id * size)
5647

5748
#define __syncthreads() \
58-
vx_barrier(__COUNTER__ * __groups_per_core + __local_group_id, __warps_per_group)
49+
vx_barrier(__local_group_id, __warps_per_group)
5950

51+
// launch a kernel function with a grid of blocks and block of threads
6052
int vx_spawn_threads(uint32_t dimension,
6153
const uint32_t* grid_dim,
6254
const uint32_t* block_dim,
6355
vx_kernel_func_cb kernel_func,
6456
const void* arg);
6557

58+
// function call serialization
59+
void vx_serial(vx_serial_cb callback, const void * arg);
60+
6661
#ifdef __cplusplus
6762
}
6863
#endif

0 commit comments

Comments
 (0)