diff --git a/.gitignore b/.gitignore index 426ace6..a996ec7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # OSACA specific files and folders *.*.pickle +osaca_testfront_venv/ +examples/riscy_asm_files/ # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/examples/add/Makefile b/examples/add/Makefile deleted file mode 100644 index 1cdf2cd..0000000 --- a/examples/add/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# Makefile for RISC-V add example - -CC = gcc -CFLAGS = -O3 -CFLAGS_VEC = -O3 -march=rv64gcv - -# Default target with -O3 -all: add_riscv add_riscv_vec - -# Build with -O3 optimization -add_riscv: add_riscv.c - $(CC) $(CFLAGS) -o add_riscv add_riscv.c - $(CC) $(CFLAGS) -S -o add_riscv.s add_riscv.c - -# Build with vector extensions -add_riscv_vec: add_riscv.c - $(CC) $(CFLAGS_VEC) -o add_riscv_vec add_riscv.c - $(CC) $(CFLAGS_VEC) -S -o add_riscv_vec.s add_riscv.c - -# Clean up -clean: - rm -f add_riscv add_riscv_vec add_riscv.s add_riscv_vec.s - -.PHONY: all clean \ No newline at end of file diff --git a/examples/add/add.s.rv6.gcc.s b/examples/add/add.s.rv6.gcc.s new file mode 100644 index 0000000..3b083ec --- /dev/null +++ b/examples/add/add.s.rv6.gcc.s @@ -0,0 +1,13 @@ +add_riscv: +.L3: + vsetvli a5,a3,e64,m1,ta,ma + vle64.v v2,0(a1) + vle64.v v1,0(a2) + slli a4,a5,3 + sub a3,a3,a5 + add a1,a1,a4 + add a2,a2,a4 + vfadd.vv v1,v1,v2 + vse64.v v1,0(a0) + add a0,a0,a4 + bne a3,zero,.L3 \ No newline at end of file diff --git a/examples/add/add_riscv.c b/examples/add/add_riscv.c deleted file mode 100644 index e584767..0000000 --- a/examples/add/add_riscv.c +++ /dev/null @@ -1,54 +0,0 @@ -// Vector add benchmark for RISC-V testing -// a[i] = b[i] + c[i] - -#include -#include - -#define DTYPE double - -void kernel(DTYPE* a, DTYPE* b, DTYPE* c, const int size) -{ - // OSACA start marker will be added around this loop - for(int i=0; i 1) { - size = atoi(argv[1]); - } - - printf("RISC-V Vector add: a[i] = b[i] + c[i], size=%d\n", size); - - // Allocate memory - DTYPE* a = (DTYPE*)malloc(size * sizeof(DTYPE)); - DTYPE* b = (DTYPE*)malloc(size * sizeof(DTYPE)); - DTYPE* c = (DTYPE*)malloc(size * sizeof(DTYPE)); - - // Initialize arrays - for(int i=0; i -#include - -#define DTYPE double - -void kernel(DTYPE* a, DTYPE* b, DTYPE* c, const DTYPE s, const int size) -{ - // OSACA start marker will be added around this loop - for(int i=0; i 1) { - size = atoi(argv[1]); - } - - printf("RISC-V STREAM triad: a[i] = b[i] + s * c[i], size=%d\n", size); - - // Allocate memory - DTYPE* a = (DTYPE*)malloc(size * sizeof(DTYPE)); - DTYPE* b = (DTYPE*)malloc(size * sizeof(DTYPE)); - DTYPE* c = (DTYPE*)malloc(size * sizeof(DTYPE)); - - // Initialize arrays - for(int i=0; i