fpga_synthesis merge
This commit is contained in:
1
runtime/.gitignore
vendored
Normal file
1
runtime/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/config.h
|
||||
4
runtime/Makefile
Normal file
4
runtime/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
all:
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#define TOTAL_THREADS 4
|
||||
#define TOTAL_WARPS 4
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
#include <VX_config.h>
|
||||
|
||||
# .section .FileIO
|
||||
|
||||
93
runtime/intrinsics/vx_intrinsics.S
Normal file
93
runtime/intrinsics/vx_intrinsics.S
Normal file
@@ -0,0 +1,93 @@
|
||||
#include <VX_config.h>
|
||||
|
||||
.section .text
|
||||
|
||||
.type vx_wspawn, @function
|
||||
.global vx_wspawn
|
||||
vx_wspawn:
|
||||
.word 0x00b5106b # wspawn a0(num_warps), a1(func_ptr)
|
||||
ret
|
||||
|
||||
.type vx_tmc, @function
|
||||
.global vx_tmc
|
||||
vx_tmc:
|
||||
.word 0x0005006b # tmc a0
|
||||
ret
|
||||
|
||||
.type vx_barrier, @function
|
||||
.global vx_barrier
|
||||
vx_barrier:
|
||||
.word 0x00b5406b # barrier a0(barrier_id), a1(num_warps)
|
||||
ret
|
||||
|
||||
.type vx_split, @function
|
||||
.global vx_split
|
||||
vx_split:
|
||||
.word 0x0005206b # split a0
|
||||
ret
|
||||
|
||||
.type vx_join, @function
|
||||
.global vx_join
|
||||
vx_join:
|
||||
.word 0x0000306b #join
|
||||
ret
|
||||
|
||||
.type vx_warp_id, @function
|
||||
.global vx_warp_id
|
||||
vx_warp_id:
|
||||
csrr a0, CSR_LWID
|
||||
ret
|
||||
|
||||
.type vx_warp_gid, @function
|
||||
.global vx_warp_gid
|
||||
vx_warp_gid:
|
||||
csrr a0, CSR_GWID
|
||||
ret
|
||||
|
||||
.type vx_thread_id, @function
|
||||
.global vx_thread_id
|
||||
vx_thread_id:
|
||||
csrr a0, CSR_LTID
|
||||
ret
|
||||
|
||||
.type vx_thread_gid, @function
|
||||
.global vx_thread_gid
|
||||
vx_thread_gid:
|
||||
csrr a0, CSR_GTID
|
||||
ret
|
||||
|
||||
.type vx_core_id, @function
|
||||
.global vx_core_id
|
||||
vx_core_id:
|
||||
csrr a0, CSR_GCID
|
||||
ret
|
||||
|
||||
.type vx_num_threads, @function
|
||||
.global vx_num_threads
|
||||
vx_num_threads:
|
||||
csrr a0, CSR_NT
|
||||
ret
|
||||
|
||||
.type vx_num_warps, @function
|
||||
.global vx_num_warps
|
||||
vx_num_warps:
|
||||
csrr a0, CSR_NW
|
||||
ret
|
||||
|
||||
.type vx_num_cores, @function
|
||||
.global vx_num_cores
|
||||
vx_num_cores:
|
||||
csrr a0, CSR_NC
|
||||
ret
|
||||
|
||||
.type vx_num_cycles, @function
|
||||
.global vx_num_cycles
|
||||
vx_num_cycles:
|
||||
csrr a0, CSR_CYCLL
|
||||
ret
|
||||
|
||||
.type vx_num_instrs, @function
|
||||
.global vx_num_instrs
|
||||
vx_num_instrs:
|
||||
csrr a0, CSR_INSTL
|
||||
ret
|
||||
@@ -1,52 +1,62 @@
|
||||
|
||||
#ifndef VX_INTRINSICS
|
||||
|
||||
#define VX_INTRINSICS
|
||||
#ifndef VX_INTRINSICS_H
|
||||
#define VX_INTRINSICS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Spawns Warps
|
||||
void vx_wspawn (unsigned numWarps, unsigned PC_spawn);
|
||||
// Spawn warps
|
||||
void vx_wspawn(int num_warps, unsigned func_ptr);
|
||||
|
||||
// Changes thread mask (activated/deactivates threads)
|
||||
void vx_tmc (unsigned numThreads);
|
||||
// Set thread mask
|
||||
void vx_tmc(int num_threads);
|
||||
|
||||
// Warp Barrier
|
||||
void vx_barrier(unsigned barriedID, unsigned numWarps);
|
||||
|
||||
// split on a predicate
|
||||
void vx_split (unsigned predicate);
|
||||
void vx_barrier(int barried_id, int num_warps);
|
||||
|
||||
// Split on a predicate
|
||||
void vx_split(int predicate);
|
||||
|
||||
// Join
|
||||
void vx_join (void);
|
||||
void vx_join();
|
||||
|
||||
// Return the warp's unique thread id
|
||||
int vx_thread_id();
|
||||
|
||||
// Get Hardware thread ID
|
||||
unsigned vx_threadID(void);
|
||||
// Return the core's unique warp id
|
||||
int vx_warp_id();
|
||||
|
||||
// Return processsor unique core id
|
||||
int vx_core_id();
|
||||
|
||||
// Get hardware warp ID
|
||||
unsigned vx_warpID(void);
|
||||
// Return processsor global thread id
|
||||
int vx_thread_gid();
|
||||
|
||||
// Get Number cycles/Inst
|
||||
unsigned vx_getCycles(void);
|
||||
unsigned vx_getInst(void);
|
||||
// Return processsor global warp id
|
||||
int vx_warp_gid();
|
||||
|
||||
void vx_resetStack(void);
|
||||
// Return the number of threads in a warp
|
||||
int vx_num_threads();
|
||||
|
||||
// Return the number of warps in a core
|
||||
int vx_num_warps();
|
||||
|
||||
// Return the number of cores in the processsor
|
||||
int vx_num_cores();
|
||||
|
||||
// Return the number of cycles
|
||||
int vx_num_cycles();
|
||||
|
||||
// Return the number of instructions
|
||||
int vx_num_instrs();
|
||||
|
||||
#define __if(b) vx_split(b); \
|
||||
if (b)
|
||||
|
||||
#define __else else
|
||||
|
||||
|
||||
#define __endif vx_join();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
|
||||
|
||||
|
||||
.section .text
|
||||
|
||||
|
||||
.type vx_wspawn, @function
|
||||
.global vx_wspawn
|
||||
vx_wspawn:
|
||||
.word 0x00b5106b # wspawn a0(numWarps), a1(PC SPAWN)
|
||||
ret
|
||||
|
||||
.type vx_tmc, @function
|
||||
.global vx_tmc
|
||||
vx_tmc:
|
||||
.word 0x0005006b # tmc a0
|
||||
ret
|
||||
|
||||
|
||||
.type vx_barrier, @function
|
||||
.global vx_barrier
|
||||
vx_barrier:
|
||||
.word 0x00b5406b # barrier a0(barrier id), a1(numWarps)
|
||||
ret
|
||||
|
||||
.type vx_split, @function
|
||||
.global vx_split
|
||||
vx_split:
|
||||
.word 0x0005206b # split a0
|
||||
ret
|
||||
|
||||
.type vx_join, @function
|
||||
.global vx_join
|
||||
vx_join:
|
||||
.word 0x0000306b #join
|
||||
ret
|
||||
|
||||
|
||||
.type vx_warpID, @function
|
||||
.global vx_warpID
|
||||
vx_warpID:
|
||||
csrr a0, 0x21 # read warp IDs
|
||||
ret
|
||||
|
||||
|
||||
.type vx_threadID, @function
|
||||
.global vx_threadID
|
||||
vx_threadID:
|
||||
csrr a0, 0x20 # read thread IDs
|
||||
ret
|
||||
|
||||
.type vx_getCycles, @function
|
||||
.global vx_getCycles
|
||||
vx_getCycles:
|
||||
csrr a0, 0x26 # read thread IDs
|
||||
ret
|
||||
|
||||
|
||||
.type vx_getInst, @function
|
||||
.global vx_getInst
|
||||
vx_getInst:
|
||||
csrr a0, 0x25 # read thread IDs
|
||||
ret
|
||||
|
||||
|
||||
.type vx_resetStack, @function
|
||||
.global vx_resetStack
|
||||
vx_resetStack:
|
||||
li a0, 4
|
||||
.word 0x0005006b # tmc 4
|
||||
|
||||
csrr a3, 0x21 # get wid
|
||||
slli a3, a3, 15 # shift by wid
|
||||
csrr a2, 0x20 # get tid
|
||||
slli a1, a2, 10 # multiply tid by 1024
|
||||
slli a2, a2, 2 # multiply tid by 4
|
||||
lui sp, 0x6ffff # load base sp
|
||||
sub sp, sp, a1 # sub sp - (1024*tid)
|
||||
sub sp, sp, a3 # shoft per warp
|
||||
add sp, sp, a2 # shift sp for better performance
|
||||
|
||||
csrr a3, 0x21 # get wid
|
||||
beqz a3, RETURN
|
||||
li a0, 0
|
||||
.word 0x0005006b # tmc 0
|
||||
RETURN:
|
||||
ret
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
#include <VX_config.h>
|
||||
|
||||
.type vx_print_str, @function
|
||||
.global vx_print_str
|
||||
@@ -22,9 +22,12 @@ be:
|
||||
.type vx_printc, @function
|
||||
.global vx_printc
|
||||
vx_printc:
|
||||
la t0, 0x00010000
|
||||
la t0, print_addr
|
||||
lw t0, 0(t0)
|
||||
sw a1, 0(t0)
|
||||
ret
|
||||
|
||||
|
||||
.section .data
|
||||
print_addr:
|
||||
.word IO_BUS_ADDR_COUT
|
||||
|
||||
@@ -26,7 +26,7 @@ void vx_print_hex(unsigned f)
|
||||
}
|
||||
|
||||
|
||||
void vx_printf(char * c, unsigned f)
|
||||
void vx_printf(const char * c, unsigned f)
|
||||
{
|
||||
vx_print_str(c);
|
||||
vx_print_hex(f);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
#pragma once
|
||||
#ifndef VX_IO_H
|
||||
#define VX_IO_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
@@ -8,13 +8,15 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
static char * hextoa[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
|
||||
|
||||
void vx_print_hex(unsigned);
|
||||
void vx_printf(char *, unsigned);
|
||||
void vx_printf(const char *, unsigned);
|
||||
|
||||
void vx_print_str(char *);
|
||||
void vx_print_str(const char *);
|
||||
void vx_printc(unsigned, char c);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,42 +0,0 @@
|
||||
|
||||
|
||||
|
||||
#include "io/io.h" // Printing functions
|
||||
#include "intrinsics/instrinsics.h" // vx_threadID and vx_WarpID
|
||||
|
||||
struct args
|
||||
{
|
||||
void * data;
|
||||
};
|
||||
|
||||
|
||||
void function(void * arg)
|
||||
{
|
||||
struct args * real_arg = (struct args *) arg;
|
||||
|
||||
unsigned tid = vx_threadID();
|
||||
unsigned wid = vx_WarpID();
|
||||
|
||||
__if(something) // Control divergent if
|
||||
{
|
||||
|
||||
}
|
||||
__else
|
||||
{
|
||||
|
||||
}
|
||||
__endif
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
void * data = vx_loadfile("filename.txt"); // The raw char data will be returned by vx_loadfile
|
||||
|
||||
struct args arg;
|
||||
arg.data = data;
|
||||
|
||||
vx_spawnWarps(numWarps, numThreads, function, &data);
|
||||
|
||||
|
||||
}
|
||||
@@ -154,25 +154,26 @@ int _isatty (int file)
|
||||
|
||||
int _lseek(int fd, int offset, int whence)
|
||||
{
|
||||
// vx_print_str("Hello from _lseek\n");
|
||||
char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
char * read_buffer = (char *) FILE_IO_READ;
|
||||
// // vx_print_str("Hello from _lseek\n");
|
||||
// char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
// char * read_buffer = (char *) FILE_IO_READ;
|
||||
|
||||
int cmd_id = LSEEK;
|
||||
// int cmd_id = LSEEK;
|
||||
|
||||
upload((char **) &write_buffer, (char *) &cmd_id , sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &fd , sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &offset , sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &whence , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &cmd_id , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &fd , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &offset , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &whence , sizeof(int));
|
||||
|
||||
|
||||
trap_to_simulator();
|
||||
// trap_to_simulator();
|
||||
|
||||
int retval;
|
||||
// int retval;
|
||||
|
||||
download((char **) &read_buffer, (char *) &retval);
|
||||
// download((char **) &read_buffer, (char *) &retval);
|
||||
|
||||
return retval;
|
||||
// return retval;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -184,47 +185,48 @@ int _lseek(int fd, int offset, int whence)
|
||||
int _read (int file, char *ptr, int len)
|
||||
{
|
||||
|
||||
char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
char * read_buffer = (char *) FILE_IO_READ;
|
||||
// char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
// char * read_buffer = (char *) FILE_IO_READ;
|
||||
|
||||
int cmd_id = READ;
|
||||
// int cmd_id = READ;
|
||||
|
||||
upload((char **) &write_buffer, (char *) &cmd_id, sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &file , sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &ptr , sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &len , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &cmd_id, sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &file , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &ptr , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &len , sizeof(int));
|
||||
|
||||
trap_to_simulator();
|
||||
// trap_to_simulator();
|
||||
|
||||
|
||||
return len;
|
||||
// return len;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int _write (int file, char *buf, int nbytes)
|
||||
{
|
||||
|
||||
char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
// char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
|
||||
int cmd_id = WRITE;
|
||||
// int cmd_id = WRITE;
|
||||
|
||||
upload((char **) &write_buffer, (char *) &cmd_id, sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &file , sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) buf , nbytes);
|
||||
// upload((char **) &write_buffer, (char *) &cmd_id, sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &file , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) buf , nbytes);
|
||||
|
||||
|
||||
trap_to_simulator();
|
||||
// trap_to_simulator();
|
||||
|
||||
// vx_print_str("Hello from _write\n");
|
||||
|
||||
// int i;
|
||||
int i;
|
||||
|
||||
// unsigned int volatile * const print_addr = (unsigned int *) 0x00010000;
|
||||
unsigned int volatile * const print_addr = (unsigned int *) 0x00010000;
|
||||
|
||||
// for (i = 0; i < nbytes; i++)
|
||||
// {
|
||||
// (*print_addr) = buf[i];
|
||||
// }
|
||||
for (i = 0; i < nbytes; i++)
|
||||
{
|
||||
(*print_addr) = buf[i];
|
||||
}
|
||||
|
||||
return nbytes;
|
||||
|
||||
@@ -232,12 +234,12 @@ int _write (int file, char *buf, int nbytes)
|
||||
|
||||
|
||||
|
||||
static int heap_start = (int) 0x10000000;
|
||||
static int head_end = (int) 0x20000000;
|
||||
static int heap_start = (int) 0x90000000;
|
||||
static int head_end = (int) 0xa0000000;
|
||||
|
||||
void * _sbrk (int nbytes)
|
||||
{
|
||||
// vx_print_str("Hello from _sbrk\n");
|
||||
vx_print_str("Hello from _sbrk\n");
|
||||
// vx_printf("nbytes: ", nbytes);
|
||||
|
||||
//if (nbytes < 0) //vx_print_str("nbytes less than zero\n");
|
||||
@@ -250,10 +252,10 @@ void * _sbrk (int nbytes)
|
||||
|
||||
// vx_printf("New nbytes: ", nbytes);
|
||||
|
||||
// if (nbytes > 10240)
|
||||
// {
|
||||
// nbytes = 10240;
|
||||
// }
|
||||
if (nbytes > 10240)
|
||||
{
|
||||
nbytes = 10240;
|
||||
}
|
||||
|
||||
// if (((unsigned) head_end) > ((unsigned) (heap_ptr + nbytes)))
|
||||
if (true)
|
||||
@@ -265,41 +267,34 @@ void * _sbrk (int nbytes)
|
||||
// vx_print_str("\n");
|
||||
return (void *) base;
|
||||
}
|
||||
else
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return (void *) -1;
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// errno = ENOMEM;
|
||||
// return (void *) -1;
|
||||
// }
|
||||
} /* _sbrk () */
|
||||
|
||||
|
||||
void _exit(int val)
|
||||
{
|
||||
// vx_print_str("Hello from exit\n");
|
||||
vx_tmc(0);
|
||||
}
|
||||
|
||||
|
||||
int _open(const char *name, int flags, int mode)
|
||||
{
|
||||
char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
char * read_buffer = (char *) FILE_IO_READ;
|
||||
// char * write_buffer = (char *) FILE_IO_WRITE;
|
||||
// char * read_buffer = (char *) FILE_IO_READ;
|
||||
|
||||
int cmd_id = OPEN;
|
||||
// int cmd_id = OPEN;
|
||||
|
||||
upload((char **) &write_buffer, (char *) &cmd_id, sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) &name , sizeof (char *));
|
||||
upload((char **) &write_buffer, (char *) &flags , sizeof(int));
|
||||
upload((char **) &write_buffer, (char *) & mode , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &cmd_id, sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) &name , sizeof (char *));
|
||||
// upload((char **) &write_buffer, (char *) &flags , sizeof(int));
|
||||
// upload((char **) &write_buffer, (char *) & mode , sizeof(int));
|
||||
|
||||
|
||||
trap_to_simulator();
|
||||
// trap_to_simulator();
|
||||
|
||||
int fd;
|
||||
download((char **) &read_buffer, (char *) &fd);
|
||||
// int fd;
|
||||
// download((char **) &read_buffer, (char *) &fd);
|
||||
|
||||
|
||||
return fd;
|
||||
// return fd;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -310,7 +305,7 @@ void _kill()
|
||||
|
||||
unsigned _getpid()
|
||||
{
|
||||
return vx_threadID();
|
||||
return vx_thread_id();
|
||||
}
|
||||
|
||||
void _unlink()
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
#include "../vx_api/vx_api.h"
|
||||
>>>>>>> fpga_synthesis
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
<<<<<<< HEAD
|
||||
struct pocl_context_t {
|
||||
uint32_t num_groups[3];
|
||||
uint32_t global_offset[3];
|
||||
@@ -15,6 +20,8 @@ struct pocl_context_t {
|
||||
uint32_t work_dim;
|
||||
};
|
||||
|
||||
=======
|
||||
>>>>>>> fpga_synthesis
|
||||
typedef void (*pocl_workgroup_func) (
|
||||
void * /* args */,
|
||||
void * /* pocl_context */,
|
||||
@@ -23,7 +30,11 @@ typedef void (*pocl_workgroup_func) (
|
||||
uint32_t /* group_z */
|
||||
);
|
||||
|
||||
<<<<<<< HEAD
|
||||
void pocl_spawn(struct pocl_context_t * ctx, const pocl_workgroup_func pfn, void * arguments) {
|
||||
=======
|
||||
void pocl_spawn(struct pocl_context_t * ctx, pocl_workgroup_func pfn, const void * args) {
|
||||
>>>>>>> fpga_synthesis
|
||||
uint32_t x, y, z;
|
||||
for (z = 0; z < ctx->num_groups[2]; ++z)
|
||||
for (y = 0; y < ctx->num_groups[1]; ++y)
|
||||
|
||||
68
runtime/startup/vx_start.S
Normal file
68
runtime/startup/vx_start.S
Normal file
@@ -0,0 +1,68 @@
|
||||
#include <VX_config.h>
|
||||
|
||||
.section .init, "ax"
|
||||
.global _start
|
||||
.type _start, @function
|
||||
_start:
|
||||
la a1, vx_set_sp
|
||||
csrr a0, CSR_NW # get num warps
|
||||
.word 0x00b5106b # wspawn a0(numWarps), a1(PC SPAWN)
|
||||
jal vx_set_sp
|
||||
li a0, 1
|
||||
.word 0x0005006b # back to single thread
|
||||
# Initialize global pointerp
|
||||
# call __cxx_global_var_init
|
||||
# Clear the bss segment
|
||||
la a0, _edata
|
||||
la a2, _end
|
||||
sub a2, a2, a0
|
||||
li a1, 0
|
||||
call memset
|
||||
la a0, __libc_fini_array # Register global termination functions
|
||||
call atexit # to be called upon exit
|
||||
call __libc_init_array # Run global initialization functions
|
||||
call main
|
||||
tail exit
|
||||
.size _start, .-_start
|
||||
|
||||
.section .text
|
||||
.type _exit, @function
|
||||
.global _exit
|
||||
_exit:
|
||||
li a0, 0
|
||||
.word 0x0005006b # disable all threads
|
||||
|
||||
.section .text
|
||||
.type vx_set_sp, @function
|
||||
.global vx_set_sp
|
||||
vx_set_sp:
|
||||
csrr a0, CSR_NT # get num threads
|
||||
.word 0x0005006b # activate all threads
|
||||
|
||||
.option push
|
||||
.option norelax
|
||||
1:auipc gp, %pcrel_hi(__global_pointer$)
|
||||
addi gp, gp, %pcrel_lo(1b)
|
||||
.option pop
|
||||
|
||||
csrr a1, CSR_GTID # get global thread id
|
||||
slli a1, a1, 10 # multiply by 1024
|
||||
csrr a2, CSR_LTID # get local thread id
|
||||
slli a2, a2, 2 # multiply by 4
|
||||
lui sp, STACK_BASE_ADDR # load base sp
|
||||
sub sp, sp, a1 # sub thread block
|
||||
add sp, sp, a2 # reduce addr collision for perf
|
||||
|
||||
csrr a3, CSR_LWID # get wid
|
||||
beqz a3, RETURN
|
||||
li a0, 0
|
||||
.word 0x0005006b # tmc 0
|
||||
RETURN:
|
||||
ret
|
||||
|
||||
.section .data
|
||||
.global __dso_handle
|
||||
.weak __dso_handle
|
||||
__dso_handle:
|
||||
.long 0
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
# .section .init, "ax"
|
||||
# .global _start
|
||||
# _start:
|
||||
# .cfi_startproc
|
||||
# .cfi_undefined ra
|
||||
# .option push
|
||||
# .option norelax
|
||||
# la gp, __global_pointer$
|
||||
# .option pop
|
||||
# la sp, __stack_top
|
||||
# add s0, sp, zero
|
||||
# jal zero, main
|
||||
# .cfi_endproc
|
||||
# .end
|
||||
|
||||
.section .init, "ax"
|
||||
.global _start
|
||||
.type _start, @function
|
||||
_start:
|
||||
# Initialize SP
|
||||
# la sp, __stack_top
|
||||
la a1, vx_set_sp
|
||||
li a0, 32
|
||||
.word 0x00b5106b # wspawn a0(numWarps), a1(PC SPAWN)
|
||||
jal vx_set_sp
|
||||
li a0, 1
|
||||
.word 0x0005006b # tmc 1
|
||||
# Initialize global pointerp
|
||||
# call __cxx_global_var_init
|
||||
# Clear the bss segment
|
||||
la a0, _edata
|
||||
la a2, _end
|
||||
sub a2, a2, a0
|
||||
li a1, 0
|
||||
call memset
|
||||
la a0, __libc_fini_array # Register global termination functions
|
||||
call atexit # to be called upon exit
|
||||
call __libc_init_array # Run global initialization functions
|
||||
# li a0, 4
|
||||
# .word 0x0005006b # tmc 4
|
||||
call main
|
||||
tail exit
|
||||
.size _start, .-_start
|
||||
|
||||
.section .text
|
||||
.type vx_set_sp, @function
|
||||
.global vx_set_sp
|
||||
vx_set_sp:
|
||||
li a0, 32
|
||||
.word 0x0005006b # tmc 4
|
||||
|
||||
.option push
|
||||
.option norelax
|
||||
1:auipc gp, %pcrel_hi(__global_pointer$)
|
||||
addi gp, gp, %pcrel_lo(1b)
|
||||
.option pop
|
||||
|
||||
csrr a3, 0x21 # get wid
|
||||
slli a3, a3, 0x1a # shift by wid
|
||||
csrr a2, 0x20 # get tid
|
||||
slli a1, a2, 10 # multiply tid by 1024
|
||||
slli a2, a2, 2 # multiply tid by 4
|
||||
lui sp, 0x6ffff # load base sp
|
||||
sub sp, sp, a1 # sub sp - (1024*tid)
|
||||
sub sp, sp, a3 # shoft per warp
|
||||
add sp, sp, a2 # shift sp for better performance
|
||||
|
||||
csrr a3, 0x21 # get wid
|
||||
beqz a3, RETURN
|
||||
li a0, 0
|
||||
.word 0x0005006b # tmc 0
|
||||
RETURN:
|
||||
ret
|
||||
|
||||
.section .data
|
||||
.global __dso_handle
|
||||
.weak __dso_handle
|
||||
__dso_handle:
|
||||
.long 0
|
||||
|
||||
@@ -3,17 +3,17 @@ RISCV_TOOL_PATH ?= $(wildcard ../../../../riscv-gnu-toolchain/drops)
|
||||
|
||||
COMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gcc
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostdlib
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,../vortex_link.ld -ffreestanding -nostartfiles
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,../../startup/vx_link.ld -ffreestanding -nostartfiles
|
||||
|
||||
DMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objdump
|
||||
CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
|
||||
|
||||
|
||||
VX_STR = ../../startup/vx_start.s
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.s
|
||||
VX_IO = ../../io/vx_io.s ../../io/vx_io.c
|
||||
VX_STR = ../../startup/vx_start.S
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.S
|
||||
VX_IO = ../../io/vx_io.S ../../io/vx_io.c
|
||||
VX_API = ../../vx_api/vx_api.c
|
||||
VX_TEST = ../../tests/tests.c
|
||||
VX_TEST = ../common/tests.c
|
||||
|
||||
VX_MAIN = ./vx_dev_main.c
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#include "../../intrinsics/vx_intrinsics.h"
|
||||
#include "../../io/vx_io.h"
|
||||
#include "../../tests/tests.h"
|
||||
#include "../common/tests.h"
|
||||
#include "../../vx_api/vx_api.h"
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ void mat_add_kernel(void * void_arguments)
|
||||
{
|
||||
mat_add_args_t * arguments = (mat_add_args_t *) void_arguments;
|
||||
|
||||
unsigned wid = vx_warpID();
|
||||
unsigned tid = vx_threadID();
|
||||
unsigned wid = vx_warp_id();
|
||||
unsigned tid = vx_thread_id();
|
||||
|
||||
bool valid = (wid < arguments->numRows) && (tid < arguments->numColums);
|
||||
|
||||
@@ -77,7 +77,7 @@ int main()
|
||||
// void * hellp = malloc(4);
|
||||
vx_print_str("Confirm Dev Main\n");
|
||||
|
||||
vx_print_str("vx_spawnWarps\n");
|
||||
vx_print_str("vx_spawn_warps\n");
|
||||
|
||||
mat_add_args_t arguments;
|
||||
arguments.x = x;
|
||||
@@ -91,7 +91,7 @@ int main()
|
||||
int numThreads = 4;
|
||||
|
||||
// First kernel call
|
||||
vx_spawnWarps(numWarps, numThreads, mat_add_kernel, &arguments);
|
||||
vx_spawn_warps(numWarps, numThreads, mat_add_kernel, &arguments);
|
||||
vx_print_mat(z, arguments.numRows, arguments.numColums);
|
||||
|
||||
|
||||
@@ -102,11 +102,11 @@ int main()
|
||||
arguments.numRows = 4;
|
||||
|
||||
// Second Kernel Call
|
||||
vx_spawnWarps(numWarps, numThreads, mat_add_kernel, &arguments);
|
||||
vx_spawn_warps(numWarps, numThreads, mat_add_kernel, &arguments);
|
||||
vx_print_mat(z, arguments.numRows, arguments.numColums);
|
||||
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
87054
runtime/tests/dev/vx_dev_main.dump
Normal file
87054
runtime/tests/dev/vx_dev_main.dump
Normal file
File diff suppressed because it is too large
Load Diff
BIN
runtime/tests/dev/vx_dev_main.elf
Executable file
BIN
runtime/tests/dev/vx_dev_main.elf
Executable file
Binary file not shown.
5741
runtime/tests/dev/vx_dev_main.hex
Normal file
5741
runtime/tests/dev/vx_dev_main.hex
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ RISCV_TOOL_PATH ?= $(wildcard ../../../../riscv-gnu-toolchain/drops)
|
||||
|
||||
COMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gcc
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostdlib
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,../vortex_link.ld
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,../../startup/vx_link.ld
|
||||
|
||||
DMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objdump
|
||||
CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
|
||||
@@ -11,10 +11,14 @@ CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
|
||||
|
||||
NEWLIB = ../../newlib/newlib.c
|
||||
VX_STR =
|
||||
<<<<<<< HEAD:runtime/mains/hello/Makefile
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.s
|
||||
VX_IO = ../../io/vx_io.s ../../io/vx_io.c
|
||||
=======
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.S
|
||||
VX_IO =
|
||||
>>>>>>> fpga_synthesis:runtime/tests/hello/Makefile
|
||||
VX_API =
|
||||
VX_TEST =
|
||||
VX_FIO =
|
||||
LIBS = $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libc.a $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
|
||||
|
||||
@@ -29,7 +33,11 @@ HEX: ELF
|
||||
$(CPY) -O ihex $(VX_MAIN).elf $(VX_MAIN).hex
|
||||
|
||||
ELF:
|
||||
<<<<<<< HEAD:runtime/mains/hello/Makefile
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_TEST) $(VX_MAIN).cpp $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.elf *.dump *.hex *.qemu *.log *.debug
|
||||
=======
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_MAIN).cpp $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
>>>>>>> fpga_synthesis:runtime/tests/hello/Makefile
|
||||
1031
runtime/tests/hello/hello.dump
Normal file
1031
runtime/tests/hello/hello.dump
Normal file
File diff suppressed because it is too large
Load Diff
BIN
runtime/tests/hello/hello.elf
Normal file
BIN
runtime/tests/hello/hello.elf
Normal file
Binary file not shown.
262
runtime/tests/hello/hello.hex
Normal file
262
runtime/tests/hello/hello.hex
Normal file
@@ -0,0 +1,262 @@
|
||||
:0200000480007A
|
||||
:1000000097110000938101A613850100138601005A
|
||||
:100010003306A64093050000EF00806F171500001F
|
||||
:100020001305059563080500171500001305858E57
|
||||
:10003000EF00D013EF000064032501009305410099
|
||||
:1000400013060000EF00C0546F00805FB707008107
|
||||
:1000500003C7475863140704130101FF23248100D9
|
||||
:1000600013840700B70700002326110093870700B9
|
||||
:10007000638A0700370500811305054B97000000D0
|
||||
:10008000E7000000930710008320C1002302F4580A
|
||||
:1000900003248100130101016780000067800000D4
|
||||
:1000A000B707000093870700638E0700B70500813C
|
||||
:1000B00037050081938585581305054B170300000C
|
||||
:1000C0006700000067800000130101FD2326810204
|
||||
:1000D00013040103232EA4FC232CB4FC232AC4FC08
|
||||
:1000E0008327C4FD83A707002326F4FE832744FD4E
|
||||
:1000F0002322F4FE832744FE03C707008327C4FEA0
|
||||
:100100002380E7008327C4FE93871700032744FE5C
|
||||
:10011000034717002380E7008327C4FE9387270047
|
||||
:10012000032744FE034727002380E7008327C4FEFC
|
||||
:1001300093873700032744FE034737002380E700F7
|
||||
:100140008327C4FE938747002326F4FE232404FE5E
|
||||
:100150006F004003832784FE032784FDB307F70065
|
||||
:1001600003C707008327C4FE2380E7008327C4FE5C
|
||||
:10017000938717002326F4FE832784FE93871700B6
|
||||
:100180002324F4FE032784FE832744FDE344F7FC85
|
||||
:100190008327C4FD0327C4FE23A0E700130000004B
|
||||
:1001A0000324C1021301010367800000130101FD54
|
||||
:1001B0002326810213040103232EA4FC232CB4FC68
|
||||
:1001C0008327C4FD83A707002326F4FE832744FE6C
|
||||
:1001D0002320F4FE8327C4FE03C70700832704FE01
|
||||
:1001E0002380E700832704FE938717000327C4FEBC
|
||||
:1001F000034717002380E700832704FE9387270027
|
||||
:100200000327C4FE034727002380E700832704FE5B
|
||||
:10021000938737000327C4FE034737002380E70096
|
||||
:100220008327C4FE938747002326F4FE232404FE7D
|
||||
:100230006F004003832784FE032784FDB307F70084
|
||||
:100240000327C4FE034707002380E7008327C4FE7B
|
||||
:10025000938717002326F4FE832784FE93871700D5
|
||||
:100260002324F4FE032784FE832744FEE344F7FCA3
|
||||
:100270008327C4FD0327C4FE23A0E700130000006A
|
||||
:100280000324C1021301010367800000130101FF71
|
||||
:100290002326810013040101130000000324C10080
|
||||
:1002A0001301010167800000130101FE232E81006C
|
||||
:1002B000130401022326A4FE2324B4FE832784FE14
|
||||
:1002C0003727000023A2E7009307000013850700EB
|
||||
:1002D0000324C1011301010267800000130101FE24
|
||||
:1002E000232E8100130401022326A4FE930710008D
|
||||
:1002F000138507000324C101130101026780000078
|
||||
:10030000130101FF232681001304010113000000E3
|
||||
:100310000324C1001301010167800000130101FFE4
|
||||
:100320002326810013040101130000000324C100EF
|
||||
:100330001301010167800000130101FD23268102E2
|
||||
:1003400013040103232EA4FC232CB4FC232AC4FC95
|
||||
:10035000B70701002324F4FE232604FE6F00C00229
|
||||
:100360008327C4FE032784FDB307F70083C7070074
|
||||
:1003700013870700832784FE23A0E7008327C4FE9A
|
||||
:10038000938717002326F4FE0327C4FE832744FD2A
|
||||
:10039000E348F7FC832744FD138507000324C102CB
|
||||
:1003A0001301010367800000130101FD2326810270
|
||||
:1003B00013040103232EA4FC8327C4FD63D8070084
|
||||
:1003C0008327C4FDB307F040232EF4FC0327C4FDAC
|
||||
:1003D000B73700009387078063D8E700B73700007E
|
||||
:1003E00093870780232EF4FCB707008183A78756E5
|
||||
:1003F0002326F4FEB707008103A787568327C4FD91
|
||||
:100400003307F700B707008123A4E7568327C4FE0C
|
||||
:10041000138507000324C102130101036780000054
|
||||
:10042000130101FF2326110023248100130401017D
|
||||
:1004300013050000EF00C00E130000008320C10070
|
||||
:10044000032481001301010167800000130101FFF3
|
||||
:100450002326810013040101130000000324C100BE
|
||||
:100460001301010167800000130101FF23268100B1
|
||||
:1004700013040101130000000324C1001301010152
|
||||
:1004800067800000130101FF23261100232481004F
|
||||
:1004900013040101EF00400B9307050013850700CB
|
||||
:1004A0008320C10003248100130101016780000043
|
||||
:1004B000130101FF23268100130401011300000032
|
||||
:1004C0000324C1001301010167800000130101FF33
|
||||
:1004D0002326810013040101B707008183A7075A6F
|
||||
:1004E00093861700370700812320D75A138507000A
|
||||
:1004F0000324C1001301010167800000130101FF03
|
||||
:100500002326810013040101130000000324C1000D
|
||||
:1005100013010101678000006B10B50067800000C7
|
||||
:100520006B000500678000006B40B500678000002D
|
||||
:100530006B200500678000006B30000067800000C2
|
||||
:100540007325100267800000732500026780000099
|
||||
:10055000130540006B000500F32610029396F60089
|
||||
:10056000732600029315A6001316260037F1FF6FBD
|
||||
:100570003301B1403301D1403301C100F3261002F1
|
||||
:1005800063860600130500006B000500678000000D
|
||||
:10059000130101FF2326810013040101B707008125
|
||||
:1005A0001307400123A2E75A9307000013850700B1
|
||||
:1005B0000324C1001301010167800000130101FE43
|
||||
:1005C000232E1100232C8100130401022326A4FEF4
|
||||
:1005D0002324B4FE0327C4FE930710006310F70220
|
||||
:1005E000032784FEB70701009387F7FF6318F7001E
|
||||
:1005F000B70700811385475AEF00C043130000007E
|
||||
:100600008320C101032481011301010267800000DE
|
||||
:10061000130101FF2326110023248100130401018B
|
||||
:10062000B70701009385F7FF13051000EFF01FF9DE
|
||||
:100630008320C100032481001301010167800000B1
|
||||
:10064000130101FF930500002324810023261100DC
|
||||
:1006500013040500EF008019B707008103A5070404
|
||||
:100660008327C50363840700E780070013050400A0
|
||||
:10067000EFF01FDB130101FF232481002320210160
|
||||
:10068000370400003709000093070400130909002C
|
||||
:100690003309F940232611002322910013592940E0
|
||||
:1006A000630009021304040093040000832704007C
|
||||
:1006B0009384140013044400E7800700E31899FEB4
|
||||
:1006C00037040000370900009307040013090900EC
|
||||
:1006D0003309F94013592940630009021304040047
|
||||
:1006E000930400008327040093841400130444003F
|
||||
:1006F000E7800700E31899FE8320C10003248100EE
|
||||
:1007000083244100032901001301010167800000D7
|
||||
:100710001303F00013070500637EC3029377F7000D
|
||||
:100720006390070A63920508937606FF1376F60036
|
||||
:10073000B386E6002320B7002322B7002324B700A6
|
||||
:100740002326B70013070701E366D7FE63140600EC
|
||||
:1007500067800000B306C34093962600970200000E
|
||||
:10076000B38656006780C6002307B700A306B7000C
|
||||
:100770002306B700A305B7002305B700A304B700FD
|
||||
:100780002304B700A303B7002303B700A302B700F5
|
||||
:100790002302B700A301B7002301B700A300B700ED
|
||||
:1007A0002300B7006780000093F5F50F939685004E
|
||||
:1007B000B3E5D50093960501B3E5D5006FF0DFF6FC
|
||||
:1007C0009396270097020000B3865600938200009C
|
||||
:1007D000E78006FA93800200938707FF3307F7400C
|
||||
:1007E0003306F600E378C3F66FF0DFF3130101FD83
|
||||
:1007F000B7070081232C410103AA0704232021030A
|
||||
:100800002326110203298A14232481022322910220
|
||||
:10081000232E3101232A510123286101232671014E
|
||||
:100820002324810163000904130B0500938B050049
|
||||
:10083000930A10009309F0FF832449001384F4FF06
|
||||
:100840006342040293942400B304990063840B046C
|
||||
:1008500083A74410638077051304F4FF9384C4FFD7
|
||||
:10086000E31634FF8320C102032481028324410262
|
||||
:10087000032901028329C101032A8101832A41013D
|
||||
:10088000032B0101832BC100032C81001301010301
|
||||
:10089000678000008327490083A644009387F7FF01
|
||||
:1008A000638E870423A20400E38806FA832789184D
|
||||
:1008B00033978A00032C4900B377F700639207024D
|
||||
:1008C000E78006000327490083278A146314870101
|
||||
:1008D000E304F9F8E38807F8138907006FF0DFF500
|
||||
:1008E0008327C91883A544083377F700631C0700E2
|
||||
:1008F00013050B00E78006006FF0DFFC2322890060
|
||||
:100900006FF09FFA13850500E78006006FF09FFBEC
|
||||
:10091000130101FF23248100B70700003704000002
|
||||
:100920001304040093870700B387874023229100B4
|
||||
:100930002326110093D42740638004029387C7FFC6
|
||||
:1009400033848700832704009384F4FF1304C4FFD7
|
||||
:10095000E7800700E39804FE8320C10003248100A0
|
||||
:100960008324410013010101678000009305050005
|
||||
:100970009306000013060000130500006F004000FE
|
||||
:10098000B707008103A7070483278714638C070434
|
||||
:1009900003A747001308F001634EE8061318270069
|
||||
:1009A00063060502338307012324C30883A887183D
|
||||
:1009B000130610003316E600B3E8C80023A4171985
|
||||
:1009C0002324D310930620006304D50213071700D5
|
||||
:1009D00023A2E700B387070123A4B7001305000093
|
||||
:1009E000678000009307C7142324F7146FF05FFAA1
|
||||
:1009F00083A6C7181307170023A2E70033E6C60033
|
||||
:100A000023A6C718B387070123A4B7001305000066
|
||||
:100A1000678000001305F0FF67800000B707000043
|
||||
:100A20009387070063860700138501EB6FF01FF4BF
|
||||
:100A300067800000130101FE232E810013040102D0
|
||||
:100A40002326A4FE8327C4FE1307700323A0E70018
|
||||
:100A5000130000000324C10113010102678000009C
|
||||
:02000004810079
|
||||
:10000000300000003100000032000000330000002A
|
||||
:10001000340000003500000036000000370000000A
|
||||
:10002000380000003900000061000000620000009C
|
||||
:0E003000630000006400000065000000660030
|
||||
:0400400088000081B3
|
||||
:100048000000008104000081080000810C0000818C
|
||||
:100058001000008114000081180000811C0000813C
|
||||
:100068002000008124000081280000812C000081EC
|
||||
:100078003000008134000081380000813C0000819C
|
||||
:100088000000000074030081DC0300814404008147
|
||||
:100098000000000000000000000000000000000058
|
||||
:1000A8000000000000000000000000000000000048
|
||||
:1000B8000000000000000000000000000000000038
|
||||
:1000C8000000000000000000000000000000000028
|
||||
:1000D8000000000000000000000000000000000018
|
||||
:1000E8000000000000000000000000000000000008
|
||||
:1000F80000000000000000000000000000000000F8
|
||||
:1001080000000000000000000000000000000000E7
|
||||
:1001180000000000000000000000000000000000D7
|
||||
:1001280000000000000000000100000000000000C6
|
||||
:100138000E33CDAB34126DE6ECDE05000B0000008B
|
||||
:1001480000000000000000000000000000000000A7
|
||||
:100158000000000000000000000000000000000097
|
||||
:100168000000000000000000000000000000000087
|
||||
:100178000000000000000000000000000000000077
|
||||
:100188000000000000000000000000000000000067
|
||||
:100198000000000000000000000000000000000057
|
||||
:1001A8000000000000000000000000000000000047
|
||||
:1001B8000000000000000000000000000000000037
|
||||
:1001C8000000000000000000000000000000000027
|
||||
:1001D8000000000000000000000000000000000017
|
||||
:1001E8000000000000000000000000000000000007
|
||||
:1001F80000000000000000000000000000000000F7
|
||||
:1002080000000000000000000000000000000000E6
|
||||
:1002180000000000000000000000000000000000D6
|
||||
:1002280000000000000000000000000000000000C6
|
||||
:1002380000000000000000000000000000000000B6
|
||||
:1002480000000000000000000000000000000000A6
|
||||
:100258000000000000000000000000000000000096
|
||||
:100268000000000000000000000000000000000086
|
||||
:100278000000000000000000000000000000000076
|
||||
:100288000000000000000000000000000000000066
|
||||
:100298000000000000000000000000000000000056
|
||||
:1002A8000000000000000000000000000000000046
|
||||
:1002B8000000000000000000000000000000000036
|
||||
:1002C8000000000000000000000000000000000026
|
||||
:1002D8000000000000000000000000000000000016
|
||||
:1002E8000000000000000000000000000000000006
|
||||
:1002F80000000000000000000000000000000000F6
|
||||
:1003080000000000000000000000000000000000E5
|
||||
:1003180000000000000000000000000000000000D5
|
||||
:1003280000000000000000000000000000000000C5
|
||||
:1003380000000000000000000000000000000000B5
|
||||
:1003480000000000000000000000000000000000A5
|
||||
:100358000000000000000000000000000000000095
|
||||
:100368000000000000000000000000000000000085
|
||||
:100378000000000000000000000000000000000075
|
||||
:100388000000000000000000000000000000000065
|
||||
:100398000000000000000000000000000000000055
|
||||
:1003A8000000000000000000000000000000000045
|
||||
:1003B8000000000000000000000000000000000035
|
||||
:1003C8000000000000000000000000000000000025
|
||||
:1003D8000000000000000000000000000000000015
|
||||
:1003E8000000000000000000000000000000000005
|
||||
:1003F80000000000000000000000000000000000F5
|
||||
:1004080000000000000000000000000000000000E4
|
||||
:1004180000000000000000000000000000000000D4
|
||||
:1004280000000000000000000000000000000000C4
|
||||
:1004380000000000000000000000000000000000B4
|
||||
:1004480000000000000000000000000000000000A4
|
||||
:100458000000000000000000000000000000000094
|
||||
:100468000000000000000000000000000000000084
|
||||
:100478000000000000000000000000000000000074
|
||||
:100488000000000000000000000000000000000064
|
||||
:100498000000000000000000000000000000000054
|
||||
:0804A80000000000000000004C
|
||||
:1004B0001000000000000000017A5200017C0101E0
|
||||
:1004C0001B0D02002000000018000000680500FF5E
|
||||
:1004D0002C00000000440E20448801440C08005801
|
||||
:1004E000C80C0220440E0000200000003C00000068
|
||||
:1004F000A00000FF2C00000000440E1044880144BE
|
||||
:100500000C080058C80C0210440E00002400000023
|
||||
:1005100060000000A80000FF5400000000440E200E
|
||||
:100520004881018802440C080078C144C80C0220AC
|
||||
:10053000440E00002400000088000000D40000FFEA
|
||||
:100540003000000000440E104881018802440C086D
|
||||
:100550000054C144C80C0210440E0000000000000A
|
||||
:1005600000000000000000700000001000000020EB
|
||||
:04057000880000817E
|
||||
:040574004C000080B7
|
||||
:08057800A000008010060080C5
|
||||
:040580001C0A0080D1
|
||||
:040000058000000077
|
||||
:00000001FF
|
||||
@@ -4,23 +4,28 @@ RISCV_TOOL_PATH ?= $(wildcard ../../../../riscv-gnu-toolchain/drops)
|
||||
COMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-g++
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostdlib
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostartfiles
|
||||
CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostartfiles -nodefaultlibs -Wl,-Bstatic,-T,../vortex_link.ld -march=rv32im -mabi=ilp32
|
||||
CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostartfiles -nodefaultlibs -Wl,-Bstatic,-T,../../startup/vx_link.ld -march=rv32im -mabi=ilp32
|
||||
|
||||
DMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objdump
|
||||
CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
|
||||
|
||||
# VX_STR = ../../startup/vx_start.s
|
||||
# VX_STR = ../../startup/vx_start.S
|
||||
|
||||
|
||||
|
||||
NEWLIB = ../../newlib/newlib.c
|
||||
VX_STR = ../../startup/vx_start.s
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.s
|
||||
VX_IO = ../../io/vx_io.s ../../io/vx_io.c
|
||||
VX_STR = ../../startup/vx_start.S
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.S
|
||||
VX_IO = ../../io/vx_io.S ../../io/vx_io.c
|
||||
VX_API = ../../vx_api/vx_api.c
|
||||
<<<<<<< HEAD:runtime/mains/vecadd/Makefile
|
||||
VX_TEST = ../../tests/tests.c
|
||||
VX_FIO = ../../fileio/fileio.s
|
||||
LIBS = -Wl,--whole-archive ./libs/libvecadd.a -Wl,--no-whole-archive ./libs/libOpenCL.a $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libc.a $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
|
||||
=======
|
||||
VX_FIO = ../../fileio/fileio.S
|
||||
LIBS = -Wl,--whole-archive ./libs/libvecadd.a -Wl,--no-whole-archive ./libs/libOpenCL.a ../../../../riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a ../../../../riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
|
||||
>>>>>>> fpga_synthesis:runtime/tests/nativevecadd/Makefile
|
||||
|
||||
VX_MAIN = vx_pocl_main
|
||||
|
||||
@@ -33,7 +38,11 @@ HEX: ELF
|
||||
$(CPY) -O ihex $(VX_MAIN).elf $(VX_MAIN).hex
|
||||
|
||||
ELF:
|
||||
<<<<<<< HEAD:runtime/mains/vecadd/Makefile
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_TEST) $(VX_MAIN).c $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.elf *.dump *.hex *.qemu *.log *.debug
|
||||
=======
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_MAIN).c $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
>>>>>>> fpga_synthesis:runtime/tests/nativevecadd/Makefile
|
||||
1468097
runtime/tests/nativevecadd/libs/libopencl.dump
Normal file
1468097
runtime/tests/nativevecadd/libs/libopencl.dump
Normal file
File diff suppressed because it is too large
Load Diff
420
runtime/tests/nativevecadd/libs/libvecadd.dump
Normal file
420
runtime/tests/nativevecadd/libs/libvecadd.dump
Normal file
@@ -0,0 +1,420 @@
|
||||
In archive libvecadd.a:
|
||||
|
||||
tempfile-56-19-33-68-f2.o: file format elf32-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <__cxx_global_var_init>:
|
||||
0: ff010113 addi sp,sp,-16
|
||||
4: 00112623 sw ra,12(sp)
|
||||
8: 00812423 sw s0,8(sp)
|
||||
c: 01010413 addi s0,sp,16
|
||||
10: 00000537 lui a0,0x0
|
||||
14: 00050513 mv a0,a0
|
||||
18: 00000097 auipc ra,0x0
|
||||
1c: 000080e7 jalr ra # 18 <__cxx_global_var_init+0x18>
|
||||
20: 00812403 lw s0,8(sp)
|
||||
24: 00c12083 lw ra,12(sp)
|
||||
28: 01010113 addi sp,sp,16
|
||||
2c: 00008067 ret
|
||||
|
||||
00000030 <_ZN12_GLOBAL__N_122auto_register_kernel_tC2Ev>:
|
||||
30: ff010113 addi sp,sp,-16
|
||||
34: 00112623 sw ra,12(sp)
|
||||
38: 00812423 sw s0,8(sp)
|
||||
3c: 01010413 addi s0,sp,16
|
||||
40: fea42a23 sw a0,-12(s0)
|
||||
44: 00000537 lui a0,0x0
|
||||
48: 00050513 mv a0,a0
|
||||
4c: 000005b7 lui a1,0x0
|
||||
50: 00058593 mv a1,a1
|
||||
54: 00000637 lui a2,0x0
|
||||
58: 00060713 mv a4,a2
|
||||
5c: 00000637 lui a2,0x0
|
||||
60: 00060793 mv a5,a2
|
||||
64: 00300613 li a2,3
|
||||
68: 00000693 li a3,0
|
||||
6c: 00000097 auipc ra,0x0
|
||||
70: 000080e7 jalr ra # 6c <_ZN12_GLOBAL__N_122auto_register_kernel_tC2Ev+0x3c>
|
||||
74: 00812403 lw s0,8(sp)
|
||||
78: 00c12083 lw ra,12(sp)
|
||||
7c: 01010113 addi sp,sp,16
|
||||
80: 00008067 ret
|
||||
|
||||
00000084 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc>:
|
||||
84: ff010113 addi sp,sp,-16
|
||||
88: 00112623 sw ra,12(sp)
|
||||
8c: 00812423 sw s0,8(sp)
|
||||
90: 01010413 addi s0,sp,16
|
||||
94: 00000097 auipc ra,0x0
|
||||
98: 000080e7 jalr ra # 94 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0x10>
|
||||
9c: 00812403 lw s0,8(sp)
|
||||
a0: 00c12083 lw ra,12(sp)
|
||||
a4: 01010113 addi sp,sp,16
|
||||
a8: 00008067 ret
|
||||
|
||||
Disassembly of section .sbss:
|
||||
|
||||
00000000 <_ZN12_GLOBAL__N_15__x__E>:
|
||||
...
|
||||
|
||||
Disassembly of section .sdata:
|
||||
|
||||
00000000 <_ZZN12_GLOBAL__N_122auto_register_kernel_tC1EvE9arg_types>:
|
||||
0: 0101 addi sp,sp,0
|
||||
2: 01 Address 0x0000000000000002 is out of bounds.
|
||||
|
||||
|
||||
Disassembly of section .bss:
|
||||
|
||||
00000000 <_ZZN12_GLOBAL__N_122auto_register_kernel_tC1EvE11local_sizes>:
|
||||
...
|
||||
|
||||
Disassembly of section .rodata.str1.1:
|
||||
|
||||
00000000 <.L.str>:
|
||||
0: 6576 flw fa0,92(sp)
|
||||
2: 64646163 bltu s0,t1,644 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0x5c0>
|
||||
...
|
||||
|
||||
Disassembly of section .init_array:
|
||||
|
||||
00000000 <.init_array>:
|
||||
0: 0000 unimp
|
||||
...
|
||||
|
||||
Disassembly of section .comment:
|
||||
|
||||
00000000 <.comment>:
|
||||
0: 6300 flw fs0,0(a4)
|
||||
2: 616c flw fa1,68(a0)
|
||||
4: 676e flw fa4,216(sp)
|
||||
6: 7620 flw fs0,104(a2)
|
||||
8: 7265 lui tp,0xffff9
|
||||
a: 6e6f6973 csrrsi s2,0x6e6,30
|
||||
e: 3920 fld fs0,112(a0)
|
||||
10: 302e fld ft0,232(sp)
|
||||
12: 312e fld ft2,232(sp)
|
||||
14: 2820 fld fs0,80(s0)
|
||||
16: 7468 flw fa0,108(s0)
|
||||
18: 7074 flw fa3,100(s0)
|
||||
1a: 2f2f3a73 csrrc s4,0x2f2,t5
|
||||
1e: 68746967 0x68746967
|
||||
22: 6275 lui tp,0x1d
|
||||
24: 632e flw ft6,200(sp)
|
||||
26: 6c2f6d6f jal s10,f66e8 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xf6664>
|
||||
2a: 766c flw fa1,108(a2)
|
||||
2c: 2d6d jal 6e6 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0x662>
|
||||
2e: 696d lui s2,0x1b
|
||||
30: 7272 flw ft4,60(sp)
|
||||
32: 632f726f jal tp,f7664 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xf75e0>
|
||||
36: 616c flw fa1,68(a0)
|
||||
38: 676e flw fa4,216(sp)
|
||||
3a: 672e flw fa4,200(sp)
|
||||
3c: 7469 lui s0,0xffffa
|
||||
3e: 6220 flw fs0,64(a2)
|
||||
40: 6465 lui s0,0x19
|
||||
42: 34643733 0x34643733
|
||||
46: 3162 fld ft2,56(sp)
|
||||
48: 6338 flw fa4,64(a4)
|
||||
4a: 3665 jal fffffbf2 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xfffffb6e>
|
||||
4c: 3939 jal fffffc6a <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xfffffbe6>
|
||||
4e: 32636633 0x32636633
|
||||
52: 3635 jal fffffb7e <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xfffffafa>
|
||||
54: 64386537 lui a0,0x64386
|
||||
58: 3665 jal fffffc00 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xfffffb7c>
|
||||
5a: 6631 lui a2,0xc
|
||||
5c: 6236 flw ft4,76(sp)
|
||||
5e: 64663033 0x64663033
|
||||
62: 6330 flw fa2,64(a4)
|
||||
64: 3762 fld fa4,56(sp)
|
||||
66: 2935 jal 4a2 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0x41e>
|
||||
68: 2820 fld fs0,80(s0)
|
||||
6a: 7468 flw fa0,108(s0)
|
||||
6c: 7074 flw fa3,100(s0)
|
||||
6e: 2f2f3a73 csrrc s4,0x2f2,t5
|
||||
72: 68746967 0x68746967
|
||||
76: 6275 lui tp,0x1d
|
||||
78: 632e flw ft6,200(sp)
|
||||
7a: 6c2f6d6f jal s10,f673c <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xf66b8>
|
||||
7e: 766c flw fa1,108(a2)
|
||||
80: 2d6d jal 73a <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0x6b6>
|
||||
82: 696d lui s2,0x1b
|
||||
84: 7272 flw ft4,60(sp)
|
||||
86: 6c2f726f jal tp,f7748 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xf76c4>
|
||||
8a: 766c flw fa1,108(a2)
|
||||
8c: 2e6d jal 446 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0x3c2>
|
||||
8e: 20746967 0x20746967
|
||||
92: 35663263 0x35663263
|
||||
96: 62393033 0x62393033
|
||||
9a: 3132 fld ft2,296(sp)
|
||||
9c: 6336 flw ft6,76(sp)
|
||||
9e: 3062 fld ft0,56(sp)
|
||||
a0: 6132 flw ft2,12(sp)
|
||||
a2: 6130 flw fa2,64(a0)
|
||||
a4: 6561 lui a0,0x18
|
||||
a6: 3731 jal ffffffb2 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xffffff2e>
|
||||
a8: 35333533 0x35333533
|
||||
ac: 3934 fld fa3,112(a0)
|
||||
ae: 3964 fld fs1,240(a0)
|
||||
b0: 3538 fld fa4,104(a0)
|
||||
b2: 3562 fld fa0,56(sp)
|
||||
b4: 3062 fld ft0,56(sp)
|
||||
b6: 3635 jal fffffbe2 <_GLOBAL__sub_I_tempfile_7a_73_15_a5_2b.cc+0xfffffb5e>
|
||||
b8: 00293533 sltu a0,s2,sp
|
||||
|
||||
Disassembly of section .llvm_addrsig:
|
||||
|
||||
00000000 <.llvm_addrsig>:
|
||||
0: 0a08 addi a0,sp,272
|
||||
2: 0309 addi t1,t1,2
|
||||
4: 0705 addi a4,a4,1
|
||||
6: 06 Address 0x0000000000000006 is out of bounds.
|
||||
|
||||
|
||||
tempfile-36-3d-1d-4c-cd.so.o: file format elf32-littleriscv
|
||||
|
||||
|
||||
Disassembly of section .text:
|
||||
|
||||
00000000 <_pocl_kernel_vecadd>:
|
||||
0: fe010113 addi sp,sp,-32
|
||||
4: 00112e23 sw ra,28(sp)
|
||||
8: 00812c23 sw s0,24(sp)
|
||||
c: 00912a23 sw s1,20(sp)
|
||||
10: 01212823 sw s2,16(sp)
|
||||
14: 01312623 sw s3,12(sp)
|
||||
18: 01412423 sw s4,8(sp)
|
||||
1c: 01512223 sw s5,4(sp)
|
||||
20: 02010413 addi s0,sp,32
|
||||
24: ffc17113 andi sp,sp,-4
|
||||
28: 00068913 mv s2,a3
|
||||
2c: 00060993 mv s3,a2
|
||||
30: 00058a13 mv s4,a1
|
||||
34: 00050a93 mv s5,a0
|
||||
38: 0186a483 lw s1,24(a3)
|
||||
3c: 00048513 mv a0,s1
|
||||
40: 00070593 mv a1,a4
|
||||
44: 00000097 auipc ra,0x0
|
||||
48: 000080e7 jalr ra # 44 <_pocl_kernel_vecadd+0x44>
|
||||
4c: 00c92583 lw a1,12(s2)
|
||||
50: 00a58533 add a0,a1,a0
|
||||
54: 00251513 slli a0,a0,0x2
|
||||
58: 00aa82b3 add t0,s5,a0
|
||||
5c: 00aa0333 add t1,s4,a0
|
||||
60: 00a983b3 add t2,s3,a0
|
||||
64: 02092803 lw a6,32(s2)
|
||||
68: 01c92e03 lw t3,28(s2)
|
||||
6c: 00000893 li a7,0
|
||||
70: 00000e93 li t4,0
|
||||
74: 00028513 mv a0,t0
|
||||
78: 00030593 mv a1,t1
|
||||
7c: 00038613 mv a2,t2
|
||||
80: 00000793 li a5,0
|
||||
84: 00052703 lw a4,0(a0)
|
||||
88: 0005a683 lw a3,0(a1)
|
||||
8c: 00e686b3 add a3,a3,a4
|
||||
90: 00d62023 sw a3,0(a2)
|
||||
94: 00450513 addi a0,a0,4
|
||||
98: 00458593 addi a1,a1,4
|
||||
9c: 00460613 addi a2,a2,4
|
||||
a0: 00178793 addi a5,a5,1
|
||||
a4: fe97e0e3 bltu a5,s1,84 <_pocl_kernel_vecadd+0x84>
|
||||
a8: 001e8e93 addi t4,t4,1
|
||||
ac: fdcee4e3 bltu t4,t3,74 <_pocl_kernel_vecadd+0x74>
|
||||
b0: 00188893 addi a7,a7,1
|
||||
b4: fb08eee3 bltu a7,a6,70 <_pocl_kernel_vecadd+0x70>
|
||||
b8: fe040113 addi sp,s0,-32
|
||||
bc: 00412a83 lw s5,4(sp)
|
||||
c0: 00812a03 lw s4,8(sp)
|
||||
c4: 00c12983 lw s3,12(sp)
|
||||
c8: 01012903 lw s2,16(sp)
|
||||
cc: 01412483 lw s1,20(sp)
|
||||
d0: 01812403 lw s0,24(sp)
|
||||
d4: 01c12083 lw ra,28(sp)
|
||||
d8: 02010113 addi sp,sp,32
|
||||
dc: 00008067 ret
|
||||
|
||||
000000e0 <_pocl_kernel_vecadd_workgroup>:
|
||||
e0: ff010113 addi sp,sp,-16
|
||||
e4: 00112623 sw ra,12(sp)
|
||||
e8: 00812423 sw s0,8(sp)
|
||||
ec: 00912223 sw s1,4(sp)
|
||||
f0: 01212023 sw s2,0(sp)
|
||||
f4: 00058493 mv s1,a1
|
||||
f8: 00050913 mv s2,a0
|
||||
fc: 0185a403 lw s0,24(a1)
|
||||
100: 00040513 mv a0,s0
|
||||
104: 00060593 mv a1,a2
|
||||
108: 00000097 auipc ra,0x0
|
||||
10c: 000080e7 jalr ra # 108 <_pocl_kernel_vecadd_workgroup+0x28>
|
||||
110: 00c4a583 lw a1,12(s1)
|
||||
114: 00a58533 add a0,a1,a0
|
||||
118: 00251513 slli a0,a0,0x2
|
||||
11c: 00892583 lw a1,8(s2)
|
||||
120: 0005a583 lw a1,0(a1)
|
||||
124: 00492603 lw a2,4(s2)
|
||||
128: 00062603 lw a2,0(a2)
|
||||
12c: 00092683 lw a3,0(s2)
|
||||
130: 0006a683 lw a3,0(a3)
|
||||
134: 00a682b3 add t0,a3,a0
|
||||
138: 00a60333 add t1,a2,a0
|
||||
13c: 00a583b3 add t2,a1,a0
|
||||
140: 0204a803 lw a6,32(s1)
|
||||
144: 01c4ae03 lw t3,28(s1)
|
||||
148: 00000893 li a7,0
|
||||
14c: 00000493 li s1,0
|
||||
150: 00028513 mv a0,t0
|
||||
154: 00030593 mv a1,t1
|
||||
158: 00038613 mv a2,t2
|
||||
15c: 00000793 li a5,0
|
||||
160: 00052683 lw a3,0(a0)
|
||||
164: 0005a703 lw a4,0(a1)
|
||||
168: 00d706b3 add a3,a4,a3
|
||||
16c: 00d62023 sw a3,0(a2)
|
||||
170: 00450513 addi a0,a0,4
|
||||
174: 00458593 addi a1,a1,4
|
||||
178: 00460613 addi a2,a2,4
|
||||
17c: 00178793 addi a5,a5,1
|
||||
180: fe87e0e3 bltu a5,s0,160 <_pocl_kernel_vecadd_workgroup+0x80>
|
||||
184: 00148493 addi s1,s1,1
|
||||
188: fdc4e4e3 bltu s1,t3,150 <_pocl_kernel_vecadd_workgroup+0x70>
|
||||
18c: 00188893 addi a7,a7,1
|
||||
190: fb08eee3 bltu a7,a6,14c <_pocl_kernel_vecadd_workgroup+0x6c>
|
||||
194: 00012903 lw s2,0(sp)
|
||||
198: 00412483 lw s1,4(sp)
|
||||
19c: 00812403 lw s0,8(sp)
|
||||
1a0: 00c12083 lw ra,12(sp)
|
||||
1a4: 01010113 addi sp,sp,16
|
||||
1a8: 00008067 ret
|
||||
|
||||
000001ac <_pocl_kernel_vecadd_workgroup_fast>:
|
||||
1ac: ff010113 addi sp,sp,-16
|
||||
1b0: 00112623 sw ra,12(sp)
|
||||
1b4: 00812423 sw s0,8(sp)
|
||||
1b8: 00912223 sw s1,4(sp)
|
||||
1bc: 01212023 sw s2,0(sp)
|
||||
1c0: 00058493 mv s1,a1
|
||||
1c4: 00050913 mv s2,a0
|
||||
1c8: 0185a403 lw s0,24(a1)
|
||||
1cc: 00040513 mv a0,s0
|
||||
1d0: 00060593 mv a1,a2
|
||||
1d4: 00000097 auipc ra,0x0
|
||||
1d8: 000080e7 jalr ra # 1d4 <_pocl_kernel_vecadd_workgroup_fast+0x28>
|
||||
1dc: 00c4a583 lw a1,12(s1)
|
||||
1e0: 00a58533 add a0,a1,a0
|
||||
1e4: 00251513 slli a0,a0,0x2
|
||||
1e8: 00892583 lw a1,8(s2)
|
||||
1ec: 00492603 lw a2,4(s2)
|
||||
1f0: 00092683 lw a3,0(s2)
|
||||
1f4: 00a682b3 add t0,a3,a0
|
||||
1f8: 00a60333 add t1,a2,a0
|
||||
1fc: 00a583b3 add t2,a1,a0
|
||||
200: 0204a803 lw a6,32(s1)
|
||||
204: 01c4ae03 lw t3,28(s1)
|
||||
208: 00000893 li a7,0
|
||||
20c: 00000493 li s1,0
|
||||
210: 00028513 mv a0,t0
|
||||
214: 00030593 mv a1,t1
|
||||
218: 00038613 mv a2,t2
|
||||
21c: 00000793 li a5,0
|
||||
220: 00052683 lw a3,0(a0)
|
||||
224: 0005a703 lw a4,0(a1)
|
||||
228: 00d706b3 add a3,a4,a3
|
||||
22c: 00d62023 sw a3,0(a2)
|
||||
230: 00450513 addi a0,a0,4
|
||||
234: 00458593 addi a1,a1,4
|
||||
238: 00460613 addi a2,a2,4
|
||||
23c: 00178793 addi a5,a5,1
|
||||
240: fe87e0e3 bltu a5,s0,220 <_pocl_kernel_vecadd_workgroup_fast+0x74>
|
||||
244: 00148493 addi s1,s1,1
|
||||
248: fdc4e4e3 bltu s1,t3,210 <_pocl_kernel_vecadd_workgroup_fast+0x64>
|
||||
24c: 00188893 addi a7,a7,1
|
||||
250: fb08eee3 bltu a7,a6,20c <_pocl_kernel_vecadd_workgroup_fast+0x60>
|
||||
254: 00012903 lw s2,0(sp)
|
||||
258: 00412483 lw s1,4(sp)
|
||||
25c: 00812403 lw s0,8(sp)
|
||||
260: 00c12083 lw ra,12(sp)
|
||||
264: 01010113 addi sp,sp,16
|
||||
268: 00008067 ret
|
||||
|
||||
Disassembly of section .comment:
|
||||
|
||||
00000000 <.comment>:
|
||||
0: 6300 flw fs0,0(a4)
|
||||
2: 616c flw fa1,68(a0)
|
||||
4: 676e flw fa4,216(sp)
|
||||
6: 7620 flw fs0,104(a2)
|
||||
8: 7265 lui tp,0xffff9
|
||||
a: 6e6f6973 csrrsi s2,0x6e6,30
|
||||
e: 3920 fld fs0,112(a0)
|
||||
10: 302e fld ft0,232(sp)
|
||||
12: 312e fld ft2,232(sp)
|
||||
14: 2820 fld fs0,80(s0)
|
||||
16: 7468 flw fa0,108(s0)
|
||||
18: 7074 flw fa3,100(s0)
|
||||
1a: 2f2f3a73 csrrc s4,0x2f2,t5
|
||||
1e: 68746967 0x68746967
|
||||
22: 6275 lui tp,0x1d
|
||||
24: 632e flw ft6,200(sp)
|
||||
26: 6c2f6d6f jal s10,f66e8 <_pocl_kernel_vecadd_workgroup_fast+0xf653c>
|
||||
2a: 766c flw fa1,108(a2)
|
||||
2c: 2d6d jal 6e6 <_pocl_kernel_vecadd_workgroup_fast+0x53a>
|
||||
2e: 696d lui s2,0x1b
|
||||
30: 7272 flw ft4,60(sp)
|
||||
32: 632f726f jal tp,f7664 <_pocl_kernel_vecadd_workgroup_fast+0xf74b8>
|
||||
36: 616c flw fa1,68(a0)
|
||||
38: 676e flw fa4,216(sp)
|
||||
3a: 672e flw fa4,200(sp)
|
||||
3c: 7469 lui s0,0xffffa
|
||||
3e: 6220 flw fs0,64(a2)
|
||||
40: 6465 lui s0,0x19
|
||||
42: 34643733 0x34643733
|
||||
46: 3162 fld ft2,56(sp)
|
||||
48: 6338 flw fa4,64(a4)
|
||||
4a: 3665 jal fffffbf2 <_pocl_kernel_vecadd_workgroup_fast+0xfffffa46>
|
||||
4c: 3939 jal fffffc6a <_pocl_kernel_vecadd_workgroup_fast+0xfffffabe>
|
||||
4e: 32636633 0x32636633
|
||||
52: 3635 jal fffffb7e <_pocl_kernel_vecadd_workgroup_fast+0xfffff9d2>
|
||||
54: 64386537 lui a0,0x64386
|
||||
58: 3665 jal fffffc00 <_pocl_kernel_vecadd_workgroup_fast+0xfffffa54>
|
||||
5a: 6631 lui a2,0xc
|
||||
5c: 6236 flw ft4,76(sp)
|
||||
5e: 64663033 0x64663033
|
||||
62: 6330 flw fa2,64(a4)
|
||||
64: 3762 fld fa4,56(sp)
|
||||
66: 2935 jal 4a2 <_pocl_kernel_vecadd_workgroup_fast+0x2f6>
|
||||
68: 2820 fld fs0,80(s0)
|
||||
6a: 7468 flw fa0,108(s0)
|
||||
6c: 7074 flw fa3,100(s0)
|
||||
6e: 2f2f3a73 csrrc s4,0x2f2,t5
|
||||
72: 68746967 0x68746967
|
||||
76: 6275 lui tp,0x1d
|
||||
78: 632e flw ft6,200(sp)
|
||||
7a: 6c2f6d6f jal s10,f673c <_pocl_kernel_vecadd_workgroup_fast+0xf6590>
|
||||
7e: 766c flw fa1,108(a2)
|
||||
80: 2d6d jal 73a <_pocl_kernel_vecadd_workgroup_fast+0x58e>
|
||||
82: 696d lui s2,0x1b
|
||||
84: 7272 flw ft4,60(sp)
|
||||
86: 6c2f726f jal tp,f7748 <_pocl_kernel_vecadd_workgroup_fast+0xf759c>
|
||||
8a: 766c flw fa1,108(a2)
|
||||
8c: 2e6d jal 446 <_pocl_kernel_vecadd_workgroup_fast+0x29a>
|
||||
8e: 20746967 0x20746967
|
||||
92: 35663263 0x35663263
|
||||
96: 62393033 0x62393033
|
||||
9a: 3132 fld ft2,296(sp)
|
||||
9c: 6336 flw ft6,76(sp)
|
||||
9e: 3062 fld ft0,56(sp)
|
||||
a0: 6132 flw ft2,12(sp)
|
||||
a2: 6130 flw fa2,64(a0)
|
||||
a4: 6561 lui a0,0x18
|
||||
a6: 3731 jal ffffffb2 <_pocl_kernel_vecadd_workgroup_fast+0xfffffe06>
|
||||
a8: 35333533 0x35333533
|
||||
ac: 3934 fld fa3,112(a0)
|
||||
ae: 3964 fld fs1,240(a0)
|
||||
b0: 3538 fld fa4,104(a0)
|
||||
b2: 3562 fld fa0,56(sp)
|
||||
b4: 3062 fld ft0,56(sp)
|
||||
b6: 3635 jal fffffbe2 <_pocl_kernel_vecadd_workgroup_fast+0xfffffa36>
|
||||
b8: 00293533 sltu a0,s2,sp
|
||||
BIN
runtime/tests/nativevecadd/libs/vecadd
Normal file
BIN
runtime/tests/nativevecadd/libs/vecadd
Normal file
Binary file not shown.
494132
runtime/tests/nativevecadd/libs/vecadd.dump
Normal file
494132
runtime/tests/nativevecadd/libs/vecadd.dump
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
|
||||
#include "../../intrinsics/vx_intrinsics.h"
|
||||
#include "../../io/vx_io.h"
|
||||
#include "../../tests/tests.h"
|
||||
#include "../common/tests.h"
|
||||
#include "../../vx_api/vx_api.h"
|
||||
#include "../../fileio/fileio.h"
|
||||
#include <CL/opencl.h>
|
||||
87702
runtime/tests/nativevecadd/vx_pocl_main.dump
Normal file
87702
runtime/tests/nativevecadd/vx_pocl_main.dump
Normal file
File diff suppressed because it is too large
Load Diff
BIN
runtime/tests/nativevecadd/vx_pocl_main.elf
Normal file
BIN
runtime/tests/nativevecadd/vx_pocl_main.elf
Normal file
Binary file not shown.
5843
runtime/tests/nativevecadd/vx_pocl_main.hex
Normal file
5843
runtime/tests/nativevecadd/vx_pocl_main.hex
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,19 +3,25 @@ RISCV_TOOL_PATH ?= $(wildcard ../../../../riscv-gnu-toolchain/drops)
|
||||
|
||||
COMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gcc
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostdlib
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,../vortex_link.ld -ffreestanding -nostartfiles -nostdlib
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,../../startup/vx_link.ld -ffreestanding -nostartfiles -nostdlib
|
||||
|
||||
DMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objdump
|
||||
CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
|
||||
|
||||
|
||||
<<<<<<< HEAD:runtime/mains/nlTest/Makefile
|
||||
NEWLIB = ../../newlib/newlib.c
|
||||
VX_STR = ../../startup/vx_start.s
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.s
|
||||
VX_IO = ../../io/vx_io.s ../../io/vx_io.c
|
||||
=======
|
||||
NEWLIB = ../../newlib/newlib.c ../../newlib/newlib_notimp.c ../../newlib/newlib.s
|
||||
VX_STR = ../../startup/vx_start.S
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.S
|
||||
VX_IO = ../../io/vx_io.S ../../io/vx_io.c
|
||||
>>>>>>> fpga_synthesis:runtime/tests/nlTest/Makefile
|
||||
VX_API = ../../vx_api/vx_api.c
|
||||
VX_TEST = ../../tests/tests.c
|
||||
VX_FIO = ../../fileio/fileio.s
|
||||
VX_FIO = ../../fileio/fileio.S
|
||||
|
||||
VX_MAIN = ./vx_nl_main.c
|
||||
|
||||
@@ -28,7 +34,11 @@ HEX: ELF
|
||||
$(CPY) -O ihex vx_nl_main.elf vx_nl_main.hex
|
||||
|
||||
ELF:
|
||||
<<<<<<< HEAD:runtime/mains/nlTest/Makefile
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_TEST) $(VX_MAIN) $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libc.a $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc -o vx_nl_main.elf
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.elf *.dump *.hex *.qemu *.log *.debug
|
||||
=======
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_MAIN) /opt/riscv/riscv32-unknown-elf/lib/libc.a /opt/riscv/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc -o vx_nl_main.elf
|
||||
>>>>>>> fpga_synthesis:runtime/tests/nlTest/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#include "../../intrinsics/vx_intrinsics.h"
|
||||
#include "../../io/vx_io.h"
|
||||
#include "../../tests/tests.h"
|
||||
#include "../common/tests.h"
|
||||
#include "../../vx_api/vx_api.h"
|
||||
#include "../../fileio/fileio.h"
|
||||
|
||||
76173
runtime/tests/nlTest/vx_nl_main.dump
Normal file
76173
runtime/tests/nlTest/vx_nl_main.dump
Normal file
File diff suppressed because it is too large
Load Diff
BIN
runtime/tests/nlTest/vx_nl_main.elf
Normal file
BIN
runtime/tests/nlTest/vx_nl_main.elf
Normal file
Binary file not shown.
4675
runtime/tests/nlTest/vx_nl_main.hex
Normal file
4675
runtime/tests/nlTest/vx_nl_main.hex
Normal file
File diff suppressed because it is too large
Load Diff
40
runtime/tests/simple/Makefile
Normal file
40
runtime/tests/simple/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
COMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-g++
|
||||
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O3 -Wl,-Bstatic,-T,../../startup/vx_link.ld
|
||||
CC_FLAGS += -nostartfiles -ffreestanding -fno-rtti -fno-exceptions -Wl,--gc-sections
|
||||
|
||||
CC_FLAGS += -I../../../hw
|
||||
|
||||
DMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objdump
|
||||
CPY = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objcopy
|
||||
|
||||
|
||||
NEWLIB = ../../newlib/newlib.c
|
||||
VX_STR = ../../startup/vx_start.S
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.S
|
||||
VX_IO = ../../io/vx_io.S ../../io/vx_io.c
|
||||
VX_API = ../../vx_api/vx_api.c
|
||||
VX_FIO = ../../fileio/fileio.S
|
||||
|
||||
VX_MAIN = vx_simple_main
|
||||
|
||||
#LIBS += ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a
|
||||
#LIBS += ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libstdc++.a
|
||||
#LIBS += -static-libgcc -lgcc
|
||||
|
||||
VX_SRCS = vx_simple_main.c tests.c
|
||||
|
||||
all: HEX DUMP ELF BIN
|
||||
|
||||
DUMP: ELF
|
||||
$(DMP) -D $(VX_MAIN).elf > $(VX_MAIN).dump
|
||||
|
||||
HEX: ELF
|
||||
$(CPY) -O ihex $(VX_MAIN).elf $(VX_MAIN).hex
|
||||
|
||||
BIN: ELF
|
||||
$(CPY) -O binary $(VX_MAIN).elf $(VX_MAIN).bin
|
||||
|
||||
ELF:
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_SRCS) $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
@@ -1,19 +1,24 @@
|
||||
|
||||
|
||||
#include "tests.h"
|
||||
#include "../intrinsics/vx_intrinsics.h"
|
||||
#include "../io/vx_io.h"
|
||||
#include "../../intrinsics/vx_intrinsics.h"
|
||||
#include "../../io/vx_io.h"
|
||||
|
||||
int tmc_array[4] = {5,5,5,5};
|
||||
|
||||
void test_tmc_impl()
|
||||
{
|
||||
unsigned tid = vx_thread_id(); // Get TID
|
||||
tmc_array[tid] = tid;
|
||||
}
|
||||
|
||||
void test_tmc()
|
||||
{
|
||||
vx_print_str("testing_tmc\n");
|
||||
|
||||
vx_tmc(4);
|
||||
|
||||
unsigned tid = vx_threadID(); // Get TID
|
||||
tmc_array[tid] = tid;
|
||||
test_tmc_impl();
|
||||
|
||||
vx_tmc(1);
|
||||
|
||||
@@ -33,7 +38,7 @@ int div_arr[4];
|
||||
|
||||
void test_divergence()
|
||||
{
|
||||
unsigned tid = vx_threadID(); // Get TID
|
||||
unsigned tid = vx_thread_id(); // Get TID
|
||||
|
||||
bool b = tid < 2;
|
||||
__if (b)
|
||||
@@ -72,16 +77,13 @@ void test_divergence()
|
||||
vx_print_str("\n");
|
||||
vx_print_hex(div_arr[3]);
|
||||
vx_print_str("\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
unsigned wsapwn_arr[4];
|
||||
|
||||
|
||||
void simple_kernel()
|
||||
{
|
||||
unsigned wid = vx_warpID();
|
||||
unsigned wid = vx_warp_id();
|
||||
|
||||
wsapwn_arr[wid] = wid;
|
||||
|
||||
@@ -98,6 +100,8 @@ void test_wsapwn()
|
||||
vx_wspawn(4, func_ptr);
|
||||
simple_kernel();
|
||||
|
||||
for (int i = 0; i < 100; i++) {}
|
||||
|
||||
vx_print_hex(wsapwn_arr[0]);
|
||||
vx_print_str("\n");
|
||||
vx_print_hex(wsapwn_arr[1]);
|
||||
@@ -7,10 +7,8 @@ void test_tmc();
|
||||
|
||||
void test_divergence();
|
||||
|
||||
|
||||
void test_wsapwn();
|
||||
|
||||
void intrinsics_tests();
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#include "../../intrinsics/vx_intrinsics.h"
|
||||
#include "../../io/vx_io.h"
|
||||
#include "../../tests/tests.h"
|
||||
#include "tests.h"
|
||||
#include "../../vx_api/vx_api.h"
|
||||
|
||||
|
||||
@@ -34,29 +34,59 @@ void mat_add_kernel(void * void_arguments)
|
||||
{
|
||||
mat_add_args_t * arguments = (mat_add_args_t *) void_arguments;
|
||||
|
||||
unsigned wid = vx_warpID();
|
||||
unsigned tid = vx_threadID();
|
||||
unsigned wid = vx_warp_id();
|
||||
unsigned tid = vx_thread_id();
|
||||
|
||||
bool valid = (wid < arguments->numRows) && (tid < arguments->numColums);
|
||||
|
||||
__if (valid)
|
||||
{
|
||||
// __if (valid)
|
||||
// {
|
||||
unsigned index = (wid * arguments->numColums) + tid;
|
||||
arguments->z[index] = arguments->x[index] + arguments->y[index];
|
||||
}
|
||||
__endif
|
||||
unsigned val = arguments->x[index] + arguments->y[index];
|
||||
arguments->z[index] = val;
|
||||
// }
|
||||
// __endif
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// Main is called with all threads active of warp 0
|
||||
// ensure single thread
|
||||
vx_tmc(1);
|
||||
|
||||
vx_print_str("Let's start... (This might take a while)\n");
|
||||
unsigned what[36];
|
||||
bool passed = true;
|
||||
for (int i = 0; i < 36; i++)
|
||||
{
|
||||
what[i] = i;
|
||||
// vx_print_hex(i);
|
||||
// vx_printf(": ", what[i]);
|
||||
if (what[i] != i)
|
||||
{
|
||||
passed = false;
|
||||
vx_printf("T1 Fail On ", i);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 36; i++)
|
||||
{
|
||||
// vx_print_hex(i);
|
||||
// vx_printf(": ", what[i]);
|
||||
if (what[i] != i)
|
||||
{
|
||||
passed = false;
|
||||
vx_printf("T2 Fail on ", i);
|
||||
}
|
||||
}
|
||||
|
||||
if (passed)
|
||||
{
|
||||
vx_print_str("Wr->read and repeat(Wr) tests passed!\n");
|
||||
}
|
||||
|
||||
vx_print_str("Simple Main\n");
|
||||
|
||||
|
||||
// // TMC test
|
||||
// TMC test
|
||||
test_tmc();
|
||||
|
||||
// Control Divergence Test
|
||||
@@ -65,7 +95,6 @@ int main()
|
||||
test_divergence();
|
||||
vx_tmc(1);
|
||||
|
||||
|
||||
// Test wspawn
|
||||
vx_print_str("test_wspawn\n");
|
||||
test_wsapwn();
|
||||
@@ -86,7 +115,7 @@ int main()
|
||||
|
||||
}
|
||||
|
||||
vx_print_str("vx_spawnWarps mat_add_kernel\n");
|
||||
vx_print_str("vx_spawn_warps mat_add_kernel\n");
|
||||
|
||||
mat_add_args_t arguments;
|
||||
arguments.x = x;
|
||||
@@ -99,11 +128,14 @@ int main()
|
||||
int numWarps = 4;
|
||||
int numThreads = 4;
|
||||
|
||||
vx_spawnWarps(numWarps, numThreads, mat_add_kernel, &arguments);
|
||||
vx_spawn_warps(numWarps, numThreads, mat_add_kernel, &arguments);
|
||||
|
||||
for (int i = 0; i < arguments.numRows; i++)
|
||||
vx_print_str("Waiting to ensure other warps are done... (Takes a while)\n");
|
||||
for (int i = 0; i < 5000; i++) {}
|
||||
|
||||
for (int i = 0; i < numWarps; i++)
|
||||
{
|
||||
for (int j = 0; j < arguments.numColums; j++)
|
||||
for (int j = 0; j < numThreads; j++)
|
||||
{
|
||||
unsigned index = (i * arguments.numColums) + j;
|
||||
vx_print_hex(z[index]);
|
||||
86758
runtime/tests/simple/vx_simple_main.dump
Normal file
86758
runtime/tests/simple/vx_simple_main.dump
Normal file
File diff suppressed because it is too large
Load Diff
BIN
runtime/tests/simple/vx_simple_main.elf
Executable file
BIN
runtime/tests/simple/vx_simple_main.elf
Executable file
Binary file not shown.
5688
runtime/tests/simple/vx_simple_main.hex
Normal file
5688
runtime/tests/simple/vx_simple_main.hex
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
#include "io/io.h" // Printing functions
|
||||
#include "intrinsics/instrinsics.h" // vx_threadID and vx_WarpID
|
||||
#include "intrinsics/instrinsics.h" // vx_thread_id and vx_WarpID
|
||||
|
||||
struct args
|
||||
{
|
||||
@@ -14,7 +14,7 @@ void function(void * arg)
|
||||
{
|
||||
struct args * real_arg = (struct args *) arg;
|
||||
|
||||
unsigned tid = vx_threadID();
|
||||
unsigned tid = vx_thread_id();
|
||||
unsigned wid = vx_WarpID();
|
||||
|
||||
__if(something) // Control divergent if
|
||||
@@ -36,7 +36,7 @@ int main()
|
||||
struct args arg;
|
||||
arg.data = data;
|
||||
|
||||
vx_spawnWarps(numWarps, numThreads, function, &data);
|
||||
vx_spawn_warps(numWarps, numThreads, function, &data);
|
||||
|
||||
|
||||
}
|
||||
@@ -4,23 +4,28 @@ RISCV_TOOL_PATH ?= $(wildcard ../../../../riscv-gnu-toolchain/drops)
|
||||
COMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-g++
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostdlib
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostartfiles
|
||||
CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostartfiles -nodefaultlibs -Wl,-Bstatic,-T,../vortex_link.ld -march=rv32im -mabi=ilp32
|
||||
CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostartfiles -nodefaultlibs -Wl,-Bstatic,-T,../../startup/vx_link.ld -march=rv32im -mabi=ilp32
|
||||
|
||||
DMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objdump
|
||||
CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
|
||||
|
||||
# VX_STR = ../../startup/vx_start.s
|
||||
# VX_STR = ../../startup/vx_start.S
|
||||
|
||||
|
||||
|
||||
NEWLIB = ../../newlib/newlib.c
|
||||
VX_STR = ../../startup/vx_start.s
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.s
|
||||
VX_IO = ../../io/vx_io.s ../../io/vx_io.c
|
||||
VX_STR = ../../startup/vx_start.S
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.S
|
||||
VX_IO = ../../io/vx_io.S ../../io/vx_io.c
|
||||
VX_API = ../../vx_api/vx_api.c
|
||||
<<<<<<< HEAD:runtime/mains/nativevecadd/Makefile
|
||||
VX_TEST = ../../tests/tests.c
|
||||
VX_FIO = ../../fileio/fileio.s
|
||||
LIBS = -Wl,--whole-archive ./libs/libvecadd.a -Wl,--no-whole-archive ./libs/libOpenCL.a $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libc.a $(RISCV_TOOL_PATH)/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
|
||||
=======
|
||||
VX_FIO = ../../fileio/fileio.S
|
||||
LIBS = -Wl,--whole-archive ./libs/libvecadd.a -Wl,--no-whole-archive ./libs/libOpenCL.a ../../../../riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a ../../../../riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
|
||||
>>>>>>> fpga_synthesis:runtime/tests/vecadd/Makefile
|
||||
|
||||
VX_MAIN = vx_pocl_main
|
||||
|
||||
@@ -33,7 +38,11 @@ HEX: ELF
|
||||
$(CPY) -O ihex $(VX_MAIN).elf $(VX_MAIN).hex
|
||||
|
||||
ELF:
|
||||
<<<<<<< HEAD:runtime/mains/nativevecadd/Makefile
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_TEST) $(VX_MAIN).c $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.elf *.dump *.hex *.qemu *.log *.debug
|
||||
=======
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_MAIN).c $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
>>>>>>> fpga_synthesis:runtime/tests/vecadd/Makefile
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user