redesigned driver demo, fixed startup code, removed --cpu from simx,

This commit is contained in:
Blaise Tine 2020-03-29 00:38:17 -04:00
parent 2d5cf89e00
commit c8a6470595
63 changed files with 40963 additions and 364160 deletions

View file

@ -1,7 +0,0 @@
# Dynamic Instructions: -1
# of total cycles: 2519
# of forwarding stalls: 0
# of branch stalls: 0
# CPI: -2519
# time to simulate: 4.94066e-323 milliseconds
# GRADE: Failed on test: 0

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -12,7 +12,7 @@ HEX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
GDB = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gdb
VX_SRCS = $(VX_RT_PATH)/newlib/newlib.c
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.s
VX_SRCS += $(VX_RT_PATH)/startup/vx_start.S
VX_SRCS += $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_SRCS += $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_SRCS += $(VX_RT_PATH)/fileio/fileio.s

View file

@ -7,10 +7,10 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objdump
CPY = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objcopy
# VX_STR = ../../startup/vx_start.s
# VX_STR = ../../startup/vx_start.S
NEWLIB = $(LIB_PATH)/newlib/newlib.c
VX_STR = $(LIB_PATH)/startup/vx_start.s
VX_STR = $(LIB_PATH)/startup/vx_start.S
VX_INT = $(LIB_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(LIB_PATH)/io/vx_io.s $(LIB_PATH)/io/vx_io.c
VX_API = $(LIB_PATH)/vx_api/vx_api.c

View file

@ -7,10 +7,10 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objdump
CPY = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objcopy
# VX_STR = ../../startup/vx_start.s
# VX_STR = ../../startup/vx_start.S
NEWLIB = $(LIB_PATH)/newlib/newlib.c
VX_STR = $(LIB_PATH)/startup/vx_start.s
VX_STR = $(LIB_PATH)/startup/vx_start.S
VX_INT = $(LIB_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(LIB_PATH)/io/vx_io.s $(LIB_PATH)/io/vx_io.c
VX_API = $(LIB_PATH)/vx_api/vx_api.c

View file

@ -7,10 +7,10 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objdump
CPY = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objcopy
# VX_STR = ../../startup/vx_start.s
# VX_STR = ../../startup/vx_start.S
NEWLIB = $(LIB_PATH)/newlib/newlib.c
VX_STR = $(LIB_PATH)/startup/vx_start.s
VX_STR = $(LIB_PATH)/startup/vx_start.S
VX_INT = $(LIB_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(LIB_PATH)/io/vx_io.s $(LIB_PATH)/io/vx_io.c
VX_API = $(LIB_PATH)/vx_api/vx_api.c

View file

@ -7,10 +7,10 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = /nethome/ekim79/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objdump
CPY = /nethome/ekim79/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objcopy
# VX_STR = ../../startup/vx_start.s
# VX_STR = ../../startup/vx_start.S
NEWLIB = $(LIB_PATH)/newlib/newlib.c
VX_STR = $(LIB_PATH)/startup/vx_start.s
VX_STR = $(LIB_PATH)/startup/vx_start.S
VX_INT = $(LIB_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(LIB_PATH)/io/vx_io.s $(LIB_PATH)/io/vx_io.c
VX_API = $(LIB_PATH)/vx_api/vx_api.c

View file

@ -11,13 +11,18 @@ typedef void* vx_device_h;
typedef void* vx_buffer_h;
#define VX_LOCAL_MEM_SIZE 0xffffffff
// device caps ids
#define VX_CAPS_VERSION 0x0
#define VX_CAPS_MAX_CORES 0x1
#define VX_CAPS_MAX_WARPS 0x2
#define VX_CAPS_MAX_THREADS 0x3
#define VX_CAPS_CACHE_LINESIZE 0x4
#define VX_CAPS_LOCAL_MEM_SIZE 0x5
#define VX_CAPS_ALLOC_BASE_ADDR 0x6
#define VX_CAPS_KERNEL_BASE_ADDR 0x7
#define VX_ALLOC_BASE_ADDR 0x10000000
#define VX_KERNEL_BASE_ADDR 0x80000000
#define VX_CACHE_LINESIZE 64
// return device configurations
int vx_dev_caps(int caps_id);
// open the device and connect to it
int vx_dev_open(vx_device_h* hdevice);

View file

@ -47,7 +47,8 @@ typedef struct vx_buffer_ {
} vx_buffer_t;
static size_t align_size(size_t size) {
return VX_CACHE_LINESIZE * ((size + VX_CACHE_LINESIZE - 1) / VX_CACHE_LINESIZE);
uint32_t cache_block_size = vx_dev_caps(VX_CAPS_CACHE_LINESIZE);
return cache_block_size * ((size + cache_block_size - 1) / cache_block_size);
}
///////////////////////////////////////////////////////////////////////////////
@ -103,7 +104,7 @@ extern int vx_dev_open(vx_device_h* hdevice) {
}
device->fpga = accel_handle;
device->mem_allocation = VX_ALLOC_BASE_ADDR;
device->mem_allocation = vx_dev_caps(VX_CAPS_ALLOC_BASE_ADDR);
*hdevice = device;
@ -133,7 +134,8 @@ extern int vx_alloc_dev_mem(vx_device_h hdevice, size_t size, size_t* dev_maddr)
vx_device_t *device = ((vx_device_t*)hdevice);
size_t asize = align_size(size);
if (device->mem_allocation + asize > VX_ALLOC_BASE_ADDR)
auto dev_mem_size = vx_dev_caps(VX_CAPS_LOCAL_MEM_SIZE);
if (device->mem_allocation + asize > dev_mem_size)
return -1;
*dev_maddr = device->mem_allocation;
@ -245,7 +247,7 @@ extern int vx_copy_to_dev(vx_buffer_h hbuffer, size_t dev_maddr, size_t size, si
return -1;
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_AVM_ADDRESS, dev_maddr));
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_IO_ADDRESS, (buffer->io_addr + src_offset)/VX_CACHE_LINESIZE));
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_IO_ADDRESS, buffer->io_addr + src_offset);
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_DATA_SIZE, size));
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_CMD_TYPE, MMIO_CMD_TYPE_WRITE));
@ -269,7 +271,7 @@ extern int vx_copy_from_dev(vx_buffer_h hbuffer, size_t dev_maddr, size_t size,
return -1;
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_AVM_ADDRESS, dev_maddr));
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_IO_ADDRESS, (buffer->io_addr + dest_offset)/VX_CACHE_LINESIZE));
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_IO_ADDRESS, buffer->io_addr + dest_offset);
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_COPY_DATA_SIZE, size));
CHECK_RES(fpgaWriteMMIO64(buffer->fpga, 0, MMIO_CMD_TYPE, MMIO_CMD_TYPE_READ));

View file

@ -3,7 +3,7 @@ CFLAGS += -std=c++11 -g -O0 -Wall -Wextra -pedantic -Wfatal-errors
#USE_MULTICORE=1
CFLAGS += -I../../include -I../../../../rtl/simulate
CFLAGS += -I../../include -I../../../../rtl/simulate -I../../../../runtime
CFLAGS += -fPIC

View file

@ -30,7 +30,8 @@
///////////////////////////////////////////////////////////////////////////////
static size_t align_size(size_t size) {
return VX_CACHE_LINESIZE * ((size + VX_CACHE_LINESIZE - 1) / VX_CACHE_LINESIZE);
uint32_t cache_block_size = vx_dev_caps(VX_CAPS_CACHE_LINESIZE);
return cache_block_size * ((size + cache_block_size - 1) / cache_block_size);
}
///////////////////////////////////////////////////////////////////////////////
@ -76,10 +77,10 @@ class vx_device {
public:
vx_device()
: is_done_(false)
, mem_allocation_(VX_ALLOC_BASE_ADDR)
, vortex_(&ram_) {
vortex_.reset();
thread_ = new std::thread(__thread_proc__, this);
mem_allocation_ = vx_dev_caps(VX_CAPS_ALLOC_BASE_ADDR);
}
~vx_device() {
@ -95,7 +96,8 @@ public:
int alloc_local_mem(size_t size, size_t* dev_maddr) {
size_t asize = align_size(size);
if (mem_allocation_ + asize > VX_LOCAL_MEM_SIZE)
auto dev_mem_size = vx_dev_caps(VX_CAPS_LOCAL_MEM_SIZE);
if (mem_allocation_ + asize > dev_mem_size)
return -1;
*dev_maddr = mem_allocation_;
mem_allocation_ += asize;

View file

@ -1,17 +1,12 @@
CFLAGS += -std=c++11 -O3 -Wall -Wextra -pedantic -Wfatal-errors
#CFLAGS += -std=c++11 -g -O0 -Wall -Wextra -pedantic -Wfatal-errors
MAX_WARPS ?= 8
MAX_THREADS ?= 4
CFLAGS += -I../../include -I../../../../simX/include
CFLAGS += -I../../include -I../../../../simX/include -I../../../../runtime
CFLAGS += -fPIC
CFLAGS += -DUSE_SIMX
CFLAGS += -DMAX_WARPS=$(MAX_WARPS) -DMAX_THREADS=$(MAX_THREADS)
LDFLAGS += -shared -pthread
SRCS = vortex.cpp ../vx_utils.cpp ../../../simX/args.cpp ../../../simX/mem.cpp ../../../simX/core.cpp ../../../simX/instruction.cpp ../../../simX/enc.cpp ../../../simX/util.cpp

View file

@ -8,7 +8,8 @@
#include <chrono>
#include <vortex.h>
#include "core.h"
#include <core.h>
#include <config.h>
#define PAGE_SIZE 4096
@ -24,7 +25,8 @@
///////////////////////////////////////////////////////////////////////////////
static size_t align_size(size_t size) {
return VX_CACHE_LINESIZE * ((size + VX_CACHE_LINESIZE - 1) / VX_CACHE_LINESIZE);
uint32_t cache_block_size = vx_dev_caps(VX_CAPS_CACHE_LINESIZE);
return cache_block_size * ((size + cache_block_size - 1) / cache_block_size);
}
///////////////////////////////////////////////////////////////////////////////
@ -71,9 +73,9 @@ public:
vx_device()
: is_done_(false)
, is_running_(false)
, mem_allocation_(VX_ALLOC_BASE_ADDR)
, thread_(__thread_proc__, this)
{}
, thread_(__thread_proc__, this) {
mem_allocation_ = vx_dev_caps(VX_CAPS_ALLOC_BASE_ADDR);
}
~vx_device() {
mutex_.lock();
@ -84,8 +86,9 @@ public:
}
int alloc_local_mem(size_t size, size_t* dev_maddr) {
size_t asize = align_size(size);
if (mem_allocation_ + asize > VX_LOCAL_MEM_SIZE)
auto asize = align_size(size);
auto dev_mem_size = vx_dev_caps(VX_CAPS_LOCAL_MEM_SIZE);
if (mem_allocation_ + asize > dev_mem_size)
return -1;
*dev_maddr = mem_allocation_;
mem_allocation_ += asize;
@ -93,7 +96,7 @@ public:
}
int upload(void* src, size_t dest_addr, size_t size, size_t src_offset) {
size_t asize = align_size(size);
auto asize = align_size(size);
if (dest_addr + asize > ram_.size())
return -1;
@ -148,7 +151,7 @@ public:
private:
void run() {
Harp::ArchDef arch("rv32i", false, MAX_WARPS, MAX_THREADS);
Harp::ArchDef arch("rv32i", NW, NT);
Harp::WordDecoder dec(arch);
Harp::MemoryUnit mu(PAGE_SIZE, arch.getWordSize(), true);
Harp::Core core(arch, dec, mu);

View file

@ -2,18 +2,45 @@
#include <fstream>
#include <cstring>
#include <vortex.h>
#include <config.h>
int vx_upload_kernel_bytes(vx_device_h device, const void* content, size_t size) {
extern int vx_dev_caps(int caps_id) {
switch (caps_id) {
case VX_CAPS_VERSION:
return 0;
case VX_CAPS_MAX_CORES:
return NUMBER_CORES;
case VX_CAPS_MAX_WARPS:
return NW;
case VX_CAPS_MAX_THREADS:
return NT;
case VX_CAPS_CACHE_LINESIZE:
return GLOBAL_BLOCK_SIZE_BYTES;
case VX_CAPS_LOCAL_MEM_SIZE:
return 0xffffffff;
case VX_CAPS_ALLOC_BASE_ADDR:
return 0x10000000;
case VX_CAPS_KERNEL_BASE_ADDR:
return 0x80000000;
default:
std::cout << "invalid caps id: " << caps_id << std::endl;
std::abort();
return 0;
}
}
extern int vx_upload_kernel_bytes(vx_device_h device, const void* content, size_t size) {
int err = 0;
if (NULL == content || 0 == size)
return -1;
static constexpr uint32_t TRANSFER_SIZE = 4096;
uint32_t buffer_transfer_size = 4096;
uint32_t kernel_base_addr = vx_dev_caps(VX_CAPS_KERNEL_BASE_ADDR);
// allocate device buffer
vx_buffer_h buffer;
err = vx_alloc_shared_mem(device, TRANSFER_SIZE, &buffer);
err = vx_alloc_shared_mem(device, buffer_transfer_size, &buffer);
if (err != 0)
return -1;
@ -48,9 +75,9 @@ int vx_upload_kernel_bytes(vx_device_h device, const void* content, size_t size)
size_t offset = 0;
while (offset < size) {
auto chunk_size = std::min<size_t>(TRANSFER_SIZE, size - offset);
auto chunk_size = std::min<size_t>(buffer_transfer_size, size - offset);
std::memcpy(buf_ptr, (uint8_t*)content + offset, chunk_size);
err = vx_copy_to_dev(buffer, VX_KERNEL_BASE_ADDR + offset, chunk_size, 0);
err = vx_copy_to_dev(buffer, kernel_base_addr + offset, chunk_size, 0);
if (err != 0) {
vx_buf_release(buffer);
return err;
@ -63,7 +90,7 @@ int vx_upload_kernel_bytes(vx_device_h device, const void* content, size_t size)
return 0;
}
int vx_upload_kernel_file(vx_device_h device, const char* filename) {
extern int vx_upload_kernel_file(vx_device_h device, const char* filename) {
std::ifstream ifs(filename);
if (!ifs) {
std::cout << "error: " << filename << " not found" << std::endl;

View file

@ -1,28 +1,23 @@
RISCV_TOOL_PATH ?= $(wildcard ~/dev/riscv-gnu-toolchain/drops)
VX_RT_PATH ?= $(wildcard ../../../runtime)
MAX_WARPS ?= 8
MAX_THREADS ?= 4
VX_CC = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gcc
VX_CXX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-g++
VX_DMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objdump
VX_CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
VX_CC = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-gcc
VX_CXX = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-g++
VX_DMP = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objdump
VX_CPY = $(RISCV_TOOL_PATH)/bin/riscv32-unknown-elf-objcopy
VX_NEWLIB = $(VX_RT_PATH)/newlib/newlib.c
VX_STR = $(VX_RT_PATH)/startup/vx_start.s
VX_INT = $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_API = $(VX_RT_PATH)/vx_api/vx_api.c
VX_FIO = $(VX_RT_PATH)/fileio/fileio.s
VX_STR = $(VX_RT_PATH)/startup/vx_start.S
VX_INT = $(VX_RT_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(VX_RT_PATH)/io/vx_io.s $(VX_RT_PATH)/io/vx_io.c
VX_API = $(VX_RT_PATH)/vx_api/vx_api.c
VX_FIO = $(VX_RT_PATH)/fileio/fileio.s
VX_CFLAGS = -v -march=rv32im -mabi=ilp32 -O3 -Wl,-Bstatic,-T,$(VX_RT_PATH)/mains/vortex_link.ld -ffreestanding -nostartfiles -Wl,--gc-sections
VX_CFLAGS += -DMAX_WARPS=$(MAX_WARPS) -DMAX_THREADS=$(MAX_THREADS)
VX_CFLAGS = -march=rv32im -mabi=ilp32 -O3 -Wl,-Bstatic,-T,$(VX_RT_PATH)/mains/vortex_link.ld -ffreestanding -nostartfiles -Wl,--gc-sections
VX_SRCS = kernel.c
CXXFLAGS += -std=c++17 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors
CXXFLAGS += -std=c++11 -O0 -g -Wall -Wextra -pedantic -Wfatal-errors
CXXFLAGS += -I../../sw/include
@ -32,32 +27,32 @@ SRCS = demo.cpp
all: $(PROJECT)
$(PROJECT).dump: $(PROJECT).elf
$(VX_DMP) -D $(PROJECT).elf > $(PROJECT).dump
kernel.dump: kernel.elf
$(VX_DMP) -D kernel.elf > kernel.dump
$(PROJECT).hex: $(PROJECT).elf
$(VX_CPY) -O ihex $(PROJECT).elf $(PROJECT).hex
kernel.hex: kernel.elf
$(VX_CPY) -O ihex kernel.elf kernel.hex
$(PROJECT).bin: $(PROJECT).elf
$(VX_CPY) -O binary $(PROJECT).elf $(PROJECT).bin
kernel.bin: kernel.elf
$(VX_CPY) -O binary kernel.elf kernel.bin
$(PROJECT).elf: $(SRCS)
$(VX_CC) $(VX_CFLAGS) $(VX_STR) $(VX_FIO) $(VX_NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_SRCS) -I$(VX_RT_PATH) -o $(PROJECT).elf
kernel.elf: $(SRCS)
$(VX_CC) $(VX_CFLAGS) $(VX_STR) $(VX_FIO) $(VX_NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_SRCS) -I$(VX_RT_PATH) -o kernel.elf
$(PROJECT): $(SRCS)
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -L../../sw/simx -lvortex -o $@
run-fpga: $(PROJECT)
LD_LIBRARY_PATH=../../sw/opae:$(LD_LIBRARY_PATH) ./$(PROJECT) -f $(PROJECT).bin
LD_LIBRARY_PATH=../../sw/opae:$(LD_LIBRARY_PATH) ./$(PROJECT) -f kernel.bin
run-ase: $(PROJECT)
LD_LIBRARY_PATH=../../sw/opae/ase:$(LD_LIBRARY_PATH) ./$(PROJECT) -f $(PROJECT).bin
LD_LIBRARY_PATH=../../sw/opae/ase:$(LD_LIBRARY_PATH) ./$(PROJECT) -f kernel.bin
run-rtlsim: $(PROJECT)
LD_LIBRARY_PATH=../../sw/rtlsim:$(LD_LIBRARY_PATH) ./$(PROJECT) -f $(PROJECT).bin
LD_LIBRARY_PATH=../../sw/rtlsim:$(LD_LIBRARY_PATH) ./$(PROJECT) -f kernel.bin
run-simx: $(PROJECT)
LD_LIBRARY_PATH=../../sw/simx:$(LD_LIBRARY_PATH) ./$(PROJECT) -f $(PROJECT).bin
LD_LIBRARY_PATH=../../sw/simx:$(LD_LIBRARY_PATH) ./$(PROJECT) -f kernel.bin
.depend: $(SRCS)
$(CXX) $(CXXFLAGS) -MM $^ > .depend;

View file

@ -0,0 +1,21 @@
#ifndef _COMMON_H_
#define _COMMON_H_
#include "../../../runtime/config.h"
#define MAX_WARPS NW
#define MAX_THREADS NT
#define BLOCK_SIZE GLOBAL_BLOCK_SIZE_BYTES
#define KERNEL_ARG_DEV_MEM_ADDR 0x7fffff00
struct kernel_arg_t {
uint32_t src0_ptr;
uint32_t src1_ptr;
uint32_t dst_ptr;
uint32_t stride;
};
#endif

Binary file not shown.

Binary file not shown.

View file

@ -1,6 +1,9 @@
#include <iostream>
#include <unistd.h>
#include <unistd.h>
#include <string.h>
#include <vortex.h>
#include "common.h"
const char* program_file = nullptr;
@ -33,43 +36,161 @@ static void parse_args(int argc, char **argv) {
}
}
vx_device_h device;
vx_buffer_h buffer;
void cleanup() {
if (device) {
vx_dev_close(device);
}
if (buffer) {
vx_buf_release(buffer);
}
}
int main(int argc, char *argv[]) {
int err;
int ret;
int errors = 0;
size_t value;
kernel_arg_t kernel_arg;
uint32_t stride = BLOCK_SIZE / sizeof(uint32_t);
uint32_t num_points = MAX_WARPS * MAX_THREADS * stride;
uint32_t buf_size = num_points * sizeof(uint32_t);
// parse command arguments
parse_args(argc, argv);
// open device connection
vx_device_h device;
err = vx_dev_open(&device);
if (err != 0)
std::cout << "open device connection" << std::endl;
ret = vx_dev_open(&device);
if (ret != 0)
return -1;
// upload program
err = vx_upload_kernel_file(device, program_file);
if (err != 0) {
vx_dev_close(device);
std::cout << "upload program" << std::endl;
ret = vx_upload_kernel_file(device, program_file);
if (ret != 0) {
cleanup();
return -1;
}
// allocate device memory
std::cout << "allocate device memory" << std::endl;
ret = vx_alloc_dev_mem(device, buf_size, &value);
if (ret != 0) {
cleanup();
return -1;
}
kernel_arg.src0_ptr = value;
ret = vx_alloc_dev_mem(device, buf_size, &value);
if (ret != 0) {
cleanup();
return -1;
}
kernel_arg.src1_ptr = value;
ret = vx_alloc_dev_mem(device, buf_size, &value);
if (ret != 0) {
cleanup();
return -1;
}
kernel_arg.dst_ptr = value;
// allocate shared memory
std::cout << "allocate shared memory" << std::endl;
ret = vx_alloc_shared_mem(device, buf_size, &buffer);
if (ret != 0) {
cleanup();
return -1;
}
// populate source buffer values
std::cout << "populate source buffer values" << std::endl;
{
auto buf_ptr = (int*)vx_host_ptr(buffer);
for (uint32_t i = 0; i < num_points; ++i) {
buf_ptr[i] = i;
}
}
// upload source buffers
std::cout << "upload source buffers" << std::endl;
ret = vx_copy_to_dev(buffer, kernel_arg.src0_ptr, buf_size, 0);
if (ret != 0) {
cleanup();
return -1;
}
ret = vx_copy_to_dev(buffer, kernel_arg.src1_ptr, buf_size, 0);
if (ret != 0) {
cleanup();
return -1;
}
// upload kernel argument
std::cout << "upload kernel argument" << std::endl;
{
kernel_arg.stride = stride;
auto buf_ptr = (int*)vx_host_ptr(buffer);
memcpy(buf_ptr, &kernel_arg, sizeof(kernel_arg_t));
ret = vx_copy_to_dev(buffer, KERNEL_ARG_DEV_MEM_ADDR, sizeof(kernel_arg_t), 0);
if (ret != 0) {
cleanup();
return -1;
}
}
// start device
err = vx_start(device);
if (err != 0) {
vx_dev_close(device);
std::cout << "start device" << std::endl;
ret = vx_start(device);
if (ret != 0) {
cleanup();
return -1;
}
// wait for completion
err = vx_ready_wait(device, -1);
if (err != 0) {
vx_dev_close(device);
std::cout << "wait for completion" << std::endl;
ret = vx_ready_wait(device, -1);
if (ret != 0) {
cleanup();
return -1;
}
// close device
vx_dev_close(device);
// download destination buffer
std::cout << "download destination buffer" << std::endl;
ret = vx_copy_from_dev(buffer, kernel_arg.dst_ptr, buf_size, 0);
if (ret != 0) {
cleanup();
return -1;
}
printf("done!\n");
// verify result
std::cout << "verify result" << std::endl;
{
auto buf_ptr = (int*)vx_host_ptr(buffer);
for (uint32_t i = 0; i < num_points; ++i) {
int ref = i * i;
int cur = buf_ptr[i];
if (cur != ref) {
++errors;
}
}
}
return 0;
// cleanup
std::cout << "cleanup" << std::endl;
cleanup();
if (0 == errors) {
printf("PASSED!\n");
} else {
printf("FAILED!\n");
}
return errors;
}

Binary file not shown.

View file

@ -1,269 +0,0 @@
:0200000480007A
:10000000970500009385C50B130540006B10B500E4
:10001000EF00C00A130510006B0005001385C1C373
:10002000138601C43306A64093050000EF00901329
:10003000171500001305C583EF00007FEF00D008FF
:08004000EF0080006F00807FDB
:10004800130101FF2326110023248100EF004073D0
:100058001304050013142400EF0000733304A400F4
:100068001315240037070010B7070020B387A7002F
:100078003307A70083A60700032707008320C100D2
:1000880003248100B70700303385A700B307D700E2
:100098002320F50013010101678000009307000089
:1000A80063880700371500801305C5866F00407701
:1000B80067800000130500026B000500971100001F
:1000C80093814174F32610029396A60173260002C9
:1000D8009315A6001316260037F1FF6F3301B140C0
:1000E8003301D1403301C100F326100263860600B4
:1000F800130500006B0005006780000083270500DA
:100108001358860093560601135786012380C700AB
:10011800A38007012381D700A381E70093884700C4
:100128006352C00A1388870033B80501B3B6B70015
:100138001307F6FF1348180093C6160013379700E5
:10014800B366D800134717003377D700630407084E
:1001580033E7B80013773700631E07061378C6FF26
:1001680093870500138708003308B80083A60700A3
:100178009387470013074700232ED7FEE39807FF0E
:100188009377C6FFB386F800630CF6023387F50051
:100198000348070013871700238006016352C7022C
:1001A8003387E5000347070093872700A380E6000D
:1001B80063D8C700B387F50083C707002381F6001B
:1001C800B388C80093F73800B388170123201501B6
:1001D8006780000013074600B387E700138708000D
:1001E80083C605001307170093851500A30FD7FED4
:1001F800E318F7FE6FF0DFFC83270500130101FF0A
:1002080003C8070003C6170083C6270003C73700C3
:1002180023060101A306C1002307D100A307E100BB
:100228008328C100138847006352100B1386870088
:1002380033B6C500B3B6B7001387F8FF13461600E8
:1002480093C6160013379700B366D60013471700F6
:100258003377D7006306070833E7050113773700BC
:100268006310070813F6C8FF1307080093870500F3
:100278003306B60083260700938747001307470015
:1002880023AED7FEE398C7FE93F7C8FFB306F8007E
:10029800638CF80203C306003386F5001387170042
:1002A800230066006352170303C616003387E50070
:1002B800938727002300C70063D8170103C72600C8
:1002C800B387F5002380E7003308180193773800D7
:1002D800338807012320050113010101678000000D
:1002E80013874800B387E700130708008346070011
:1002F8001307170093851500A38FD5FEE318F7FEA3
:100308006FF09FFC67800000B727000023A2F5006C
:1003180013050000678000001305100067800000C7
:10032800130101FE232E1100B707007113074000C7
:1003380093588600135806019356860193DE85006C
:1003480013DE050113D38501130F300023A0E70046
:100358002388E70023A4E700238CE7002382E70132
:10036800A38207002393070023A6A700A3880700FA
:1003780023890700A3890700A38C0700238D0700A2
:10038800A38D0700238EC700238AB700A38AD7014D
:10039800238BC701A38B6700A38E1701238F070147
:1003A800A38FD70083A781C3E7800700B707007230
:1003B80003C707002306E10003C71700A306E100EF
:1003C80003C727002307E10003C73700A307E1009D
:1003D8000326C1006358C00293874700B705008E03
:1003E8003306F6009385C5FF83C607003387B70039
:1003F800130581003307E5002300D7009387170012
:10040800E394C7FE8320C101032581001301010283
:1004180067800000130101FF2324810013040600F4
:1004280023261100B70700711307400013588600F0
:100438009356840113DE850013D3050193D88501F3
:100448001356060123A6A70023A0E7002382E7008E
:10045800A38207002388E7002393070023A4E7006B
:10046800A388070023890700A3890700238CE700D6
:10047800A38C0700238D0700A38D0700238E870018
:10048800238AB700A38AC701238B6700A38B1701B0
:10049800A38E0701238FC700A38FD70083A781C32B
:1004A800E78007008320C1001305040003248100AE
:1004B8001301010167800000130101FF232481005B
:1004C800B707007123261100130406001307400024
:1004D800130350001388070123A0E7002382670055
:1004E800A3820700238887009358860093568401C7
:1004F80013560601A30018012301C800A301D80060
:100508002393070023A4E70023A6A7006352800AC9
:100518009386470193878701B3B7F5003335B80051
:100528001306F4FF13C717001336960093471500F8
:10053800B367F70013471600B377F7006388070817
:10054800B3E7B60093F73700639207081375C4FF43
:100558003305B500938705003388B64003A6070026
:100568003307F800938747002320C700E318F5FEF8
:100578009377C4FFB386F600630CF4023387F50063
:1005880003460700138717002380C60063528702BB
:100598003387E5000347070093872700A380E60019
:1005A80063D88700B387F50083C707002381F60067
:1005B80083A781C3E78007008320C10013050400D7
:1005C800032481001301010167800000130748001C
:1005D80033078700B3870641B387F50083C7C7FF92
:1005E80093861600A38FF6FEE316D7FE6FF05FFC26
:1005F8009307050003A541C393D6F741B3C7F60097
:10060800B387D740B387A70023AAF1C26780000049
:10061800130500006F00C014130101FE232E110002
:10062800B707007113074000935886001358060156
:100638009356860193528500935F0501135F8501E8
:1006480093DE850013DE050113D385019303700043
:1006580023A0E7002388E70023A4E700238CE70012
:1006680023827700A3820700239307002386A7002D
:10067800A38657002387F701A387E701A38807000C
:1006880023890700A3890700A38C0700238D07008F
:10069800A38D0700238EC700238AB700A38AD7013A
:1006A800238BC701A38B6700A38E1701238F070134
:1006B800A38FD70083A781C3E7800700B70700721D
:1006C80003C707002306E10003C71700A306E100DC
:1006D80003C727002307E10003C73700A307E1008A
:1006E8000326C1006358C00293874700B705008EF0
:1006F8003306F6009385C5FF83C607003387B70026
:10070800130581003307E5002300D70093871700FE
:10071800E394C7FE8320C101032581001301010270
:1007280067800000130500006F0080036F00C0059C
:1007380037150080130585BF6F00800A03A5C1C364
:100748001307150023AEE1C267800000371500804B
:100758001305C5C16F00C0086B10B50067800000A5
:100768006B000500678000006B40B50067800000E3
:100778006B200500678000006B3000006780000078
:10078800732510026780000073250002678000004F
:10079800732560026780000073255002678000009F
:1007A800130540006B000500F32610029396F6002F
:1007B800732600029315A6001316260037F1FF6F63
:1007C8003301B1403301D1403301C100F326100297
:1007D80063860600130500006B00050067800000B3
:1007E800130141FF232011002322B1008345050096
:1007F80063880500EF00C001130515006FF01FFFA7
:1008080083200100832541001301C1006780000097
:10081800970200009382027F23A0B2006780000045
:100828009305050093060000130600001305000059
:100838006F008020130101FF93050000232481002D
:100848002326110013040500EF00802803A501C327
:100858008327C50363840700E780070013050400A6
:10086800EFF01FDB130101FF23248100B71700807D
:10087800371400801304440093874700B3878740E8
:10088800232291002326110093D427406380040279
:100898009387C7FF33848700832704009384F4FF7A
:1008A8001304C4FFE7800700E39804FE8320C10017
:1008B80003248100832441001301010167800000A3
:1008C800130101FF23248100232021013714008014
:1008D8003719008093070400130909003309F94008
:1008E800232611002322910013592940630009028D
:1008F8001304040093040000832704009384140065
:1009080013044400E7800700E31899FE37140080B9
:100918003719008093070400130949003309F94087
:1009280013592940630009021304040093040000CA
:10093800832704009384140013044400E78007000D
:10094800E31899FE8320C100032481008324410019
:100958000329010013010101678000001303F0005F
:1009680013070500637EC3029377F7006390070AB5
:1009780063920508937606FF1376F600B386E600C1
:100988002320B7002322B7002324B7002326B7006B
:1009980013070701E366D7FE6314060067800000AB
:1009A800B306C3409396260097020000B38656000C
:1009B8006780C6002307B700A306B7002306B70061
:1009C800A305B7002305B700A304B7002304B700A5
:1009D800A303B7002303B700A302B7002302B7009D
:1009E800A301B7002301B700A300B7002300B70095
:1009F8006780000093F5F50F93968500B3E5D50061
:100A080093960501B3E5D5006FF0DFF693962700BE
:100A180097020000B386560093820000E78006FA2A
:100A280093800200938707FF3307F7403306F600E9
:100A3800E378C3F66FF0DFF303A701C383278714B6
:100A4800638C070403A747001308F001634EE80608
:100A58001318270063060502338307012324C308FC
:100A680083A88718130610003316E600B3E8C800F9
:100A780023A417192324D310930620006304D50256
:100A88001307170023A2E700B387070123A4B700C1
:100A980013050000678000009307C7142324F71488
:100AA8006FF05FFA83A6C7181307170023A2E700A1
:100AB80033E6C60023A6C718B387070123A4B700E7
:100AC80013050000678000001305F0FF6780000031
:100AD800130101FD232C410103AA01C32320210393
:100AE8002326110203298A14232481022322910236
:100AF800232E3101232A5101232861012326710164
:100B08002324810163000904130B0500938B05005E
:100B1800930A10009309F0FF832449001384F4FF1B
:100B28006342040293942400B304990063840B0481
:100B380083A74410638077051304F4FF9384C4FFEC
:100B4800E31634FF8320C102032481028324410277
:100B5800032901028329C101032A8101832A410152
:100B6800032B0101832BC100032C81001301010316
:100B7800678000008327490083A644009387F7FF16
:100B8800638E870423A20400E38806FA8327891862
:100B980033978A00032C4900B377F7006392070262
:100BA800E78006000327490083278A146314870116
:100BB800E304F9F8E38807F8138907006FF0DFF515
:100BC8008327C91883A544083377F700631C0700F7
:100BD80013050B00E78006006FF0DFFC2322890075
:100BE8006FF09FFA13850500E78006006FF09FFB02
:100BF8004552524F523A205F756E6C696E6B206E8B
:100C08006F742079657420696D706C656D656E749C
:100C180065640A004552524F523A205F6C696E6B08
:100C2800206E6F742079657420696D706C656D65D0
:060C38006E7465640A0001
:04100000A4000080C8
:10100800000001000000000000000000FC12008049
:1010180064130080CC130080000000000000000072
:1010280000000000000000000000000000000000B8
:1010380000000000000000000000000000000000A8
:101048000000000000000000000000000000000098
:101058000000000000000000000000000000000088
:101068000000000000000000000000000000000078
:101078000000000000000000000000000000000068
:101088000000000000000000000000000000000058
:101098000000000000000000000000000000000048
:1010A8000000000000000000000000000000000038
:1010B80001000000000000000E33CDAB34126DE6D5
:1010C800ECDE05000B00000000000000000000003E
:1010D8000000000000000000000000000000000008
:1010E80000000000000000000000000000000000F8
:1010F80000000000000000000000000000000000E8
:1011080000000000000000000000000000000000D7
:1011180000000000000000000000000000000000C7
:1011280000000000000000000000000000000000B7
:1011380000000000000000000000000000000000A7
:101148000000000000000000000000000000000097
:101158000000000000000000000000000000000087
:101168000000000000000000000000000000000077
:101178000000000000000000000000000000000067
:101188000000000000000000000000000000000057
:101198000000000000000000000000000000000047
:1011A8000000000000000000000000000000000037
:1011B8000000000000000000000000000000000027
:1011C8000000000000000000000000000000000017
:1011D8000000000000000000000000000000000007
:1011E80000000000000000000000000000000000F7
:1011F80000000000000000000000000000000000E7
:1012080000000000000000000000000000000000D6
:1012180000000000000000000000000000000000C6
:1012280000000000000000000000000000000000B6
:1012380000000000000000000000000000000000A6
:101248000000000000000000000000000000000096
:101258000000000000000000000000000000000086
:101268000000000000000000000000000000000076
:101278000000000000000000000000000000000066
:101288000000000000000000000000000000000056
:101298000000000000000000000000000000000046
:1012A8000000000000000000000000000000000036
:1012B8000000000000000000000000000000000026
:1012C8000000000000000000000000000000000016
:1012D8000000000000000000000000000000000006
:1012E80000000000000000000000000000000000F6
:1012F80000000000000000000000000000000000E6
:1013080000000000000000000000000000000000D5
:1013180000000000000000000000000000000000C5
:1013280000000000000000000000000000000000B5
:1013380000000000000000000000000000000000A5
:101348000000000000000000000000000000000095
:101358000000000000000000000000000000000085
:101368000000000000000000000000000000000075
:101378000000000000000000000000000000000065
:101388000000000000000000000000000000000055
:101398000000000000000000000000000000000045
:1013A8000000000000000000000000000000000035
:1013B8000000000000000000000000000000000025
:1013C8000000000000000000000000000000000015
:1013D8000000000000000000000000000000000005
:1013E80000000000000000000000000000000000F5
:1013F80000000000000000000000000000000000E5
:1014080000000000000000000000000000000000D4
:1014180000000000000000000000000000000000C4
:1014280000000000000000000000000000000000B4
:0C14380010100080000000100000007088
:040000058000000077
:00000001FF

View file

@ -1,25 +1,26 @@
#include <stdlib.h>
#include <stdio.h>
#include "intrinsics/vx_intrinsics.h"
#include "vx_api/vx_api.h"
#include "common.h"
void main() {
unsigned *x = (unsigned*)0x10000000;
unsigned *y = (unsigned*)0x20000000;
unsigned *z = (unsigned*)0x30000000;
unsigned wid = vx_warpID();
void kernel_body(void* arg) {
struct kernel_arg_t* _arg = (struct kernel_arg_t*)(arg);
int* x = (int*)_arg->src0_ptr;
int* y = (int*)_arg->src1_ptr;
int* z = (int*)_arg->dst_ptr;
unsigned wNo = vx_warpNum();
unsigned tid = vx_threadID();
unsigned i = (wid * MAX_THREADS) + tid;
unsigned i = ((wNo * MAX_THREADS) + tid) * _arg->stride;
//if (i == 0) {
// printf("begin\n");
//}
for (unsigned j = 0; j < _arg->stride; ++j) {
z[i+j] = x[i+j] * y[i+j];
}
}
z[i] = x[i] + y[i];
//if (i == 0) {
// printf("end\n");
//}
void main() {
struct kernel_arg_t* arg = (struct kernel_arg_t*)KERNEL_ARG_DEV_MEM_ADDR;
vx_spawnWarps(MAX_WARPS, MAX_THREADS, kernel_body, arg);
}

File diff suppressed because it is too large Load diff

View file

@ -8,29 +8,27 @@ extern "C" {
#endif
// Spawns Warps
void vx_wspawn (unsigned numWarps, unsigned PC_spawn);
void vx_wspawn(unsigned numWarps, unsigned PC_spawn);
// Changes thread mask (activated/deactivates threads)
void vx_tmc (unsigned numThreads);
void vx_tmc(unsigned numThreads);
// Warp Barrier
void vx_barrier(unsigned barriedID, unsigned numWarps);
// split on a predicate
void vx_split (unsigned predicate);
void vx_split(unsigned predicate);
// Join
void vx_join (void);
void vx_join(void);
// Get Hardware thread ID
unsigned vx_threadID(void);
// Get hardware warp ID
unsigned vx_warpID(void);
// Get global warp number
unsigned vx_warpNum(void);
// Get Number cycles/Inst
@ -39,16 +37,13 @@ unsigned vx_getInst(void);
void vx_resetStack(void);
#define __if(b) vx_split(b); \
if (b)
#define __else else
#define __endif vx_join();
#ifdef __cplusplus
}
#endif

View file

@ -1,9 +1,5 @@
.section .text
.type vx_wspawn, @function
.global vx_wspawn
vx_wspawn:
@ -16,7 +12,6 @@ vx_tmc:
.word 0x0005006b # tmc a0
ret
.type vx_barrier, @function
.global vx_barrier
vx_barrier:
@ -35,12 +30,12 @@ vx_join:
.word 0x0000306b #join
ret
.type vx_warpID, @function
.global vx_warpID
vx_warpID:
csrr a0, 0x21 # read warp IDs
ret
.type vx_warpNum, @function
.global vx_warpNum
vx_warpNum:
@ -59,14 +54,12 @@ 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:
@ -89,4 +82,4 @@ vx_resetStack:
.word 0x0005006b # tmc 0
RETURN:
ret

View file

@ -11,7 +11,7 @@ DMP = $(TOOLPATH)/riscv32-unknown-elf-objdump
CPY = $(TOOLPATH)/riscv32-unknown-elf-objcopy
VX_STR = ../../startup/vx_start.s
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

View file

@ -7,12 +7,12 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = ../../../../riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objdump
CPY = ../../../../riscv-gnu-toolchain/drops/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_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

View file

@ -8,7 +8,7 @@ CPY = /opt/riscv/bin/riscv32-unknown-elf-objcopy
NEWLIB = ../../newlib/newlib.c ../../newlib/newlib_notimp.c ../../newlib/newlib.s
VX_STR = ../../startup/vx_start.s
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

View file

@ -7,7 +7,7 @@ CPY = /opt/riscv-new/drops/bin/riscv32-unknown-elf-objcopy
NEWLIB = ../../newlib/newlib.c
VX_STR = ../../startup/vx_start.s
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

View file

@ -7,12 +7,12 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = ../../../../riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objdump
CPY = ../../../../riscv-gnu-toolchain/drops/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_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

View file

@ -9,12 +9,12 @@ DMP = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objdump
CPY = /home/priya/dev/riscv_vec/riscv-gnu/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_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

View file

@ -0,0 +1,63 @@
#include "../config.h"
.section .init, "ax"
.global _start
.type _start, @function
_start:
la a1, vx_set_sp
li a0, NW # activate all 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 vx_set_sp, @function
.global vx_set_sp
vx_set_sp:
li a0, NT
.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 a3, 0x22 # get global warp number
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

View file

@ -1,87 +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:
# li a0, 4
# .word 0x0005006b # tmc 4
# csrr a2, 0x20 # get tid
# slli a2, a2, 2
# la a3, 0x80000000
# add a3, a3, a2
# lw a4, 0(a3)
la a1, vx_set_sp
li a0, 4
.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, 4
.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, 0x22 # 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

View file

@ -1,4 +1,4 @@
#include "../config.h"
#include "../intrinsics/vx_intrinsics.h"
#include "vx_api.h"
#include <inttypes.h>
@ -11,24 +11,27 @@ func_t global_function_pointer;
void * global_argument_struct;
unsigned global_num_threads;
void setup_call() {
void spawn_warp_runonce() {
// active all threads
vx_tmc(global_num_threads);
// call user routine
global_function_pointer(global_argument_struct);
// resume single-thread execution on exit
unsigned wid = vx_warpID();
if (wid != 0) {
vx_tmc(0); // Halt Warp Execution
} else {
vx_tmc(1); // Only activate one thread
}
unsigned tmask = (0 == wid) ? 0x1 : 0x0;
vx_tmc(tmask);
}
void vx_spawnWarps(unsigned numWarps, unsigned numThreads, func_t func_ptr, void * args) {
global_function_pointer = func_ptr;
global_argument_struct = args;
global_num_threads = numThreads;
vx_wspawn(numWarps, (unsigned) setup_call);
setup_call();
if (numWarps > 1) {
vx_wspawn(numWarps, (unsigned)spawn_warp_runonce);
}
spawn_warp_runonce();
}
unsigned pocl_threads;
@ -36,20 +39,20 @@ struct context_t * pocl_ctx;
vx_pocl_workgroup_func pocl_pfn;
const void * pocl_args;
void pocl_spawn_runonce() {
void pocl_spawn_warp_runonce() {
// active all threads
vx_tmc(pocl_threads);
int x = vx_threadID();
int y = vx_warpID();
int y = vx_warpNum();
// call kernel routine
(pocl_pfn)(pocl_args, pocl_ctx, x, y, 0);
if (y != 0) {
vx_tmc(0);
}
vx_tmc(1);
// resume single-thread execution on exit
int wid = vx_warpID();
unsigned tmask = (0 == wid) ? 0x1 : 0x0;
vx_tmc(tmask);
}
void pocl_spawn(struct context_t * ctx, vx_pocl_workgroup_func pfn, const void * args) {
@ -64,10 +67,10 @@ void pocl_spawn(struct context_t * ctx, vx_pocl_workgroup_func pfn, const void *
pocl_args = args;
if (ctx->num_groups[1] > 1) {
vx_wspawn(ctx->num_groups[1], (unsigned)&pocl_spawn_runonce);
vx_wspawn(ctx->num_groups[1], (unsigned)&pocl_spawn_warp_runonce);
}
pocl_spawn_runonce();
pocl_spawn_warp_runonce();
}
#ifdef __cplusplus

View file

@ -9,12 +9,12 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = /home/fares/dev/riscv-gnu-toolchain-vector/drops/bin/riscv32-unknown-elf-objdump
CPY = /home/fares/dev/riscv-gnu-toolchain-vector/drops/bin/riscv32-unknown-elf-objcopy
# VX_STR = ../../startup/vx_start.s
# VX_STR = ../../startup/vx_start.S
NEWLIB = $(LIB_PATH)/newlib/newlib.c
VX_STR = $(LIB_PATH)/startup/vx_start.s
VX_STR = $(LIB_PATH)/startup/vx_start.S
VX_INT = $(LIB_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(LIB_PATH)/io/vx_io.s $(LIB_PATH)/io/vx_io.c
VX_API = $(LIB_PATH)/vx_api/vx_api.c

View file

@ -7,10 +7,10 @@ CC_FLAGS = -ffreestanding -O0 -Wl,--gc-sections -nostartfiles -nostdlib -nostart
DMP = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objdump
CPY = /home/priya/dev/riscv_vec/riscv-gnu/bin/riscv32-unknown-elf-objcopy
# VX_STR = ../../startup/vx_start.s
# VX_STR = ../../startup/vx_start.S
NEWLIB = $(LIB_PATH)/newlib/newlib.c
VX_STR = $(LIB_PATH)/startup/vx_start.s
VX_STR = $(LIB_PATH)/startup/vx_start.S
VX_INT = $(LIB_PATH)/intrinsics/vx_intrinsics.s
VX_IO = $(LIB_PATH)/io/vx_io.s $(LIB_PATH)/io/vx_io.c
VX_API = $(LIB_PATH)/vx_api/vx_api.c

View file

@ -16,17 +16,16 @@ namespace Harp {
public:
struct Undefined {};
ArchDef(const std::string &s, bool cpu_mode = false, int num_warps =32, int num_threads = 32)
: cpu_mode_(cpu_mode) {
ArchDef(const std::string &s, int num_warps = 32, int num_threads = 32) {
std::istringstream iss(s.c_str());
wordSize = 4;
encChar = 'w';
nRegs = 32;
nPRegs = 0;
nThds = num_warps;
nWarps = num_threads;
nWarps = num_warps;
nThds = num_threads;
extent = EXT_WARPS;
// if (!iss) { extent = EXT_NULL; return; }
@ -99,10 +98,6 @@ namespace Harp {
ThdNum getNWarps() const {
if (extent < EXT_WARPS) throw Undefined(); else return nWarps;
}
bool is_cpu_mode() const {
return cpu_mode_;
}
private:
enum Extent {
@ -115,7 +110,6 @@ namespace Harp {
ThdNum nThds, nWarps;
RegNum nRegs, nPRegs;
char encChar;
bool cpu_mode_;
};
}

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,8 @@
#include "include/args.h"
#include "include/help.h"
#include "../runtime/config.h"
#include <sys/stat.h>
//////////////
@ -58,9 +60,8 @@ int emu_main(int argc, char **argv) {
string archString("rv32i");
string imgFileName("a.dsfsdout.bin");
bool showHelp(false), showStats(false), basicMachine(true);
bool cpu_mode(false);
int max_warps(32);
int max_threads(32);
int max_warps(NW);
int max_threads(NT);
/* Read the command line arguments. */
CommandLineArgFlag fh("-h", "--help", "", showHelp);
@ -68,7 +69,6 @@ int emu_main(int argc, char **argv) {
CommandLineArgSetter<string>fa("-a", "--arch", "", archString);
CommandLineArgFlag fs("-s", "--stats", "", showStats);
CommandLineArgFlag fb("-b", "--basic", "", basicMachine);
CommandLineArgFlag fx("-x", "--cpu", "", cpu_mode);
CommandLineArgSetter<int> fw("-w", "--warps", "", max_warps);
CommandLineArgSetter<int> ft("-t", "--threads", "", max_threads);
@ -80,7 +80,7 @@ int emu_main(int argc, char **argv) {
}
/* Instantiate a Core, RAM, and console output. */
ArchDef arch(archString, cpu_mode, max_warps, max_threads);
ArchDef arch(archString, max_warps, max_threads);
Decoder *dec;

View file

@ -3,139 +3,139 @@ cd obj_dir
echo start > results.txt
echo ./riscv_tests/rv32ui-p-add.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-add.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-add.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-addi.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-addi.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-addi.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-and.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-and.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-and.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-andi.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-andi.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-andi.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-auipc.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-auipc.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-auipc.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-beq.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-beq.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-beq.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-bge.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-bge.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-bge.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-bgeu.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-bgeu.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-bgeu.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-blt.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-blt.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-blt.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-bltu.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-bltu.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-bltu.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-bne.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-bne.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-bne.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-jal.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-jal.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-jal.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-jalr.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-jalr.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-jalr.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-lb.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-lb.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-lb.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-lbu.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-lbu.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-lbu.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-lh.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-lh.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-lh.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-lhu.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-lhu.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-lhu.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-lui.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-lui.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-lui.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-lw.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-lw.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-lw.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-or.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-or.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-or.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-ori.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-ori.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-ori.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sb.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sb.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sb.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sh.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sh.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sh.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-simple.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-simple.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-simple.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sll.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sll.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sll.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-slli.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-slli.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-slli.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-slt.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-slt.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-slt.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-slti.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-slti.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-slti.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sltiu.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sltiu.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sltiu.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sltu.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sltu.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sltu.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sra.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sra.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sra.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-srai.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-srai.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-srai.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-srl.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-srl.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-srl.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-srli.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-srli.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-srli.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sub.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sub.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sub.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-sw.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-sw.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-sw.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-xor.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-xor.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-xor.hex -s -b >> results.txt
echo ./riscv_tests/rv32ui-p-xori.hex >> results.txt
./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32ui-p-xori.hex -s -b >> results.txt
./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32ui-p-xori.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-div.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-div.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-div.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-divu.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-divu.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-divu.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-mul.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-mul.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-mul.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-mulh.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-mulh.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-mulh.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-mulhsu.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-mulhsu.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-mulhsu.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-mulhu.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-mulhu.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-mulhu.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-rem.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-rem.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-rem.hex -s -b >> results.txt
# echo ./riscv_tests/rv32um-p-remu.hex >> results.txt
# ./Vcache_simX -E --cpu -a rv32i --core ../riscv_tests/rv32um-p-remu.hex -s -b >> results.txt
# ./Vcache_simX -E -a rv32i --core ../riscv_tests/rv32um-p-remu.hex -s -b >> results.txt