Skip to content

Commit c8bc460

Browse files
committed
fmt
1 parent 4f30f82 commit c8bc460

File tree

9 files changed

+388
-598
lines changed

9 files changed

+388
-598
lines changed

kernel/include/vx_spawn.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#ifndef __VX_SPAWN_H__
1515
#define __VX_SPAWN_H__
1616

17-
#include <stdint.h>
1817
#include <vx_intrinsics.h>
18+
#include <stdint.h>
1919

2020
#ifdef __cplusplus
2121
extern "C" {
@@ -43,23 +43,23 @@ typedef void (*vx_kernel_func_cb)(void *arg);
4343
typedef void (*vx_serial_cb)(void *arg);
4444

4545
#define __local_mem(size) \
46-
(void *)((int8_t *)csr_read(VX_CSR_LOCAL_MEM_BASE) + __local_group_id * size)
46+
(void*)((int8_t*)csr_read(VX_CSR_LOCAL_MEM_BASE) + __local_group_id * size)
4747

4848
#define __syncthreads() \
4949
vx_barrier(__local_group_id, __warps_per_group)
5050

5151
// launch a kernel function with a grid of blocks and block of threads
5252
int vx_spawn_threads(uint32_t dimension,
53-
const uint32_t *grid_dim,
54-
const uint32_t *block_dim,
53+
const uint32_t* grid_dim,
54+
const uint32_t* block_dim,
5555
vx_kernel_func_cb kernel_func,
56-
const void *arg);
56+
const void* arg);
5757

5858
// function call serialization
59-
void vx_serial(vx_serial_cb callback, const void *arg);
59+
void vx_serial(vx_serial_cb callback, const void * arg);
6060

6161
#ifdef __cplusplus
6262
}
6363
#endif
6464

65-
#endif // __VX_SPAWN_H__
65+
#endif // __VX_SPAWN_H__

kernel/scripts/link32.ld

+1-34
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ OUTPUT_FORMAT("elf32-littleriscv", "elf32-littleriscv",
77
"elf32-littleriscv")
88
OUTPUT_ARCH(riscv)
99
ENTRY(_start)
10-
11-
MEMORY {
12-
DRAM0 (rwx): ORIGIN = 0x80000000, LENGTH = 512M
13-
DRAMARG (rwx): ORIGIN = 0x9fff0000, LENGTH = 8K
14-
DRAM1 (rwx): ORIGIN = 0xa0000000, LENGTH = 16M
15-
DRAM2 (rwx): ORIGIN = 0xa1000000, LENGTH = 16M
16-
DRAM3 (rwx): ORIGIN = 0xa2000000, LENGTH = 16M
17-
}
18-
1910
SECTIONS
2011
{
2112
. = STARTUP_ADDR;
@@ -259,28 +250,4 @@ SECTIONS
259250
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
260251
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
261252

262-
.args : {
263-
*(.args)
264-
FILL(0x00);
265-
. = ALIGN(8K);
266-
}> DRAMARG
267-
268-
.operand.a : {
269-
*(.operand.a)
270-
FILL(0x00);
271-
. = ALIGN(32K);
272-
}> DRAM1
273-
274-
.operand.b : {
275-
*(.operand.b)
276-
FILL(0x00);
277-
. = ALIGN(32K);
278-
}> DRAM2
279-
280-
.operand.c : {
281-
*(.operand.c)
282-
FILL(0x00);
283-
. = ALIGN(32K);
284-
}> DRAM3
285-
286-
}
253+
}

runtime/common/callbacks.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -22,56 +22,56 @@ extern "C" {
2222

2323
typedef struct {
2424
// open the device and connect to it
25-
int (*dev_open)(vx_device_h *hdevice);
25+
int (*dev_open) (vx_device_h* hdevice);
2626

2727
// Close the device when all the operations are done
28-
int (*dev_close)(vx_device_h hdevice);
28+
int (*dev_close) (vx_device_h hdevice);
2929

3030
// return device configurations
31-
int (*dev_caps)(vx_device_h hdevice, uint32_t caps_id, uint64_t *value);
31+
int (*dev_caps) (vx_device_h hdevice, uint32_t caps_id, uint64_t *value);
3232

3333
// allocate device memory and return address
34-
int (*mem_alloc)(vx_device_h hdevice, uint64_t size, int flags, vx_buffer_h *hbuffer);
34+
int (*mem_alloc) (vx_device_h hdevice, uint64_t size, int flags, vx_buffer_h* hbuffer);
3535

3636
// reserve memory address range
37-
int (*mem_reserve)(vx_device_h hdevice, uint64_t address, uint64_t size, int flags, vx_buffer_h *hbuffer);
37+
int (*mem_reserve) (vx_device_h hdevice, uint64_t address, uint64_t size, int flags, vx_buffer_h* hbuffer);
3838

3939
// release device memory
40-
int (*mem_free)(vx_buffer_h hbuffer);
40+
int (*mem_free) (vx_buffer_h hbuffer);
4141

4242
// set device memory access rights
43-
int (*mem_access)(vx_buffer_h hbuffer, uint64_t offset, uint64_t size, int flags);
43+
int (*mem_access) (vx_buffer_h hbuffer, uint64_t offset, uint64_t size, int flags);
4444

4545
// return device memory address
46-
int (*mem_address)(vx_buffer_h hbuffer, uint64_t *address);
46+
int (*mem_address) (vx_buffer_h hbuffer, uint64_t* address);
4747

4848
// get device memory info
49-
int (*mem_info)(vx_device_h hdevice, uint64_t *mem_free, uint64_t *mem_used);
49+
int (*mem_info) (vx_device_h hdevice, uint64_t* mem_free, uint64_t* mem_used);
5050

5151
// Copy bytes from host to device memory
52-
int (*copy_to_dev)(vx_buffer_h hbuffer, const void *host_ptr, uint64_t dst_offset, uint64_t size);
52+
int (*copy_to_dev) (vx_buffer_h hbuffer, const void* host_ptr, uint64_t dst_offset, uint64_t size);
5353

5454
// Copy bytes from device memory to host
55-
int (*copy_from_dev)(void *host_ptr, vx_buffer_h hbuffer, uint64_t src_offset, uint64_t size);
55+
int (*copy_from_dev) (void* host_ptr, vx_buffer_h hbuffer, uint64_t src_offset, uint64_t size);
5656

5757
// Start device execution
58-
int (*start)(vx_device_h hdevice, vx_buffer_h hkernel, vx_buffer_h harguments);
58+
int (*start) (vx_device_h hdevice, vx_buffer_h hkernel, vx_buffer_h harguments);
5959

6060
// Wait for device ready with milliseconds timeout
61-
int (*ready_wait)(vx_device_h hdevice, uint64_t timeout);
61+
int (*ready_wait) (vx_device_h hdevice, uint64_t timeout);
6262

6363
// read device configuration registers
64-
int (*dcr_read)(vx_device_h hdevice, uint32_t addr, uint32_t *value);
64+
int (*dcr_read) (vx_device_h hdevice, uint32_t addr, uint32_t* value);
6565

6666
// write device configuration registers
67-
int (*dcr_write)(vx_device_h hdevice, uint32_t addr, uint32_t value);
67+
int (*dcr_write) (vx_device_h hdevice, uint32_t addr, uint32_t value);
6868

6969
// query device performance counter
70-
int (*mpm_query)(vx_device_h hdevice, uint32_t addr, uint32_t core_id, uint64_t *value);
70+
int (*mpm_query) (vx_device_h hdevice, uint32_t addr, uint32_t core_id, uint64_t* value);
7171

7272
} callbacks_t;
7373

74-
int vx_dev_init(callbacks_t *callbacks);
74+
int vx_dev_init(callbacks_t* callbacks);
7575

7676
#ifdef __cplusplus
7777
}

runtime/common/callbacks.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,4 @@ extern int vx_dev_init(callbacks_t* callbacks) {
222222
};
223223

224224
return 0;
225-
}
225+
}

runtime/include/vortex.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ int vx_dump_perf(vx_device_h hdevice, FILE* stream);
143143
}
144144
#endif
145145

146-
#endif // __VX_VORTEX_H__
146+
#endif // __VX_VORTEX_H__

runtime/simx/vortex.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,4 +674,4 @@ class vx_device {
674674
#endif
675675
};
676676

677-
#include <callbacks.inc>
677+
#include <callbacks.inc>

0 commit comments

Comments
 (0)