moving MUL unit into ALU unit
This commit is contained in:
@@ -9,7 +9,7 @@ CP = $(RISCV_TOOLCHAIN_PATH)/bin/riscv32-unknown-elf-objcopy
|
||||
CFLAGS += -march=rv32imf -mabi=ilp32f -O3 -Wstack-usage=1024 -ffreestanding -nostartfiles -fdata-sections -ffunction-sections
|
||||
CFLAGS += -I$(VORTEX_RT_PATH)/include -I$(VORTEX_RT_PATH)/../hw
|
||||
|
||||
LDFLAGS += -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a
|
||||
LDFLAGS += -lm -Wl,-Bstatic,-T,$(VORTEX_RT_PATH)/linker/vx_link.ld -Wl,--gc-sections $(VORTEX_RT_PATH)/libvortexrt.a
|
||||
|
||||
PROJECT = vx_nl_main
|
||||
|
||||
|
||||
@@ -1,16 +1,22 @@
|
||||
#include <vx_intrinsics.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <vx_print.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
// Main is called with all threads active of warp 0
|
||||
vx_tmc(1);
|
||||
const int Num = 9;
|
||||
const float fNum = 9.0f;
|
||||
|
||||
vx_prints("Newlib Main ");
|
||||
vx_printx(456);
|
||||
vx_prints(" \n");
|
||||
int fibonacci(int n) {
|
||||
if (n <= 1)
|
||||
return n;
|
||||
return fibonacci(n-1) + fibonacci(n-2);
|
||||
}
|
||||
|
||||
int main() {
|
||||
int fib = fibonacci(Num);
|
||||
float isq = 1.0f / sqrt(fNum);
|
||||
vx_printf("fibonacci(%d) = %d\n", Num, fib);
|
||||
vx_printf("invAqrt(%f) = %f\n", fNum, isq);
|
||||
vx_prints("Passed!\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user