forked from Github_Repos/cvw
Updated benchmarking code.
This commit is contained in:
parent
fec40a1b75
commit
7e84c3f514
@ -9,7 +9,7 @@ MABI :=-mabi=lp64
|
|||||||
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles
|
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles
|
||||||
|
|
||||||
AFLAGS =$(MARCH) $(MABI) -march=rv64ic -mabi=lp64 -W
|
AFLAGS =$(MARCH) $(MABI) -march=rv64ic -mabi=lp64 -W
|
||||||
CFLAGS =$(MARCH) $(MABI) -march=rv64ic -mabi=lp64 -mcmodel=medany
|
CFLAGS =$(MARCH) $(MABI) -march=rv64ic -mabi=lp64 -mcmodel=medany -O2
|
||||||
AS=riscv64-unknown-elf-as
|
AS=riscv64-unknown-elf-as
|
||||||
CC=riscv64-unknown-elf-gcc
|
CC=riscv64-unknown-elf-gcc
|
||||||
AR=riscv64-unknown-elf-ar
|
AR=riscv64-unknown-elf-ar
|
||||||
@ -19,7 +19,7 @@ all: libcrt0.a
|
|||||||
%.o: %.s
|
%.o: %.s
|
||||||
${AS} ${AFLAGS} -c $< -o $@
|
${AS} ${AFLAGS} -c $< -o $@
|
||||||
|
|
||||||
libcrt0.a: start.o
|
libcrt0.a: start.o pcnt_driver.o pre_main.o
|
||||||
${AR} -r $@ $^
|
${AR} -r $@ $^
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -43,11 +43,10 @@ _start:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# set the stack pointer to the top of memory
|
# set the stack pointer to the top of memory - 8 bytes (pointer size)
|
||||||
# 0x8000_0000 + 64K - 8 bytes
|
li sp, 0x07FFFFF8
|
||||||
li sp, 0x007FFFF8
|
|
||||||
|
|
||||||
jal ra, main
|
jal ra, pre_main
|
||||||
jal ra, _halt
|
jal ra, _halt
|
||||||
|
|
||||||
.section .text
|
.section .text
|
||||||
|
@ -8,7 +8,7 @@ MARCH :=-march=rv64ic
|
|||||||
MABI :=-mabi=lp64
|
MABI :=-mabi=lp64
|
||||||
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
|
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
|
||||||
|
|
||||||
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align
|
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align -O2
|
||||||
|
|
||||||
CC=riscv64-unknown-elf-gcc
|
CC=riscv64-unknown-elf-gcc
|
||||||
DA=riscv64-unknown-elf-objdump -d
|
DA=riscv64-unknown-elf-objdump -d
|
||||||
|
@ -8,7 +8,7 @@ MARCH :=-march=rv64ic
|
|||||||
MABI :=-mabi=lp64
|
MABI :=-mabi=lp64
|
||||||
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
|
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
|
||||||
|
|
||||||
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align
|
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align -O2
|
||||||
|
|
||||||
CC=riscv64-unknown-elf-gcc
|
CC=riscv64-unknown-elf-gcc
|
||||||
DA=riscv64-unknown-elf-objdump -d
|
DA=riscv64-unknown-elf-objdump -d
|
||||||
|
@ -66,21 +66,21 @@ int main () {
|
|||||||
|
|
||||||
ans = sieve ();
|
ans = sieve ();
|
||||||
//gettimeofday(&after , NULL);
|
//gettimeofday(&after , NULL);
|
||||||
if (ans != 1899)
|
/* /\* /\\* if (ans != 1899) *\\/ *\/ */
|
||||||
printf ("Sieve result wrong, ans = %d, expected 1899", ans);
|
/* /\* /\\* printf ("Sieve result wrong, ans = %d, expected 1899", ans); *\\/ *\/ */
|
||||||
|
|
||||||
//printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) );
|
/* /\* //printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) ); *\/ */
|
||||||
|
|
||||||
|
|
||||||
printf("Round 2\n");
|
/* /\* printf("Round 2\n"); *\/ */
|
||||||
//gettimeofday(&before , NULL);
|
/* //gettimeofday(&before , NULL); */
|
||||||
|
|
||||||
ans = sieve ();
|
/* ans = sieve (); */
|
||||||
//gettimeofday(&after , NULL);
|
/* //gettimeofday(&after , NULL); */
|
||||||
if (ans != 1899)
|
/* if (ans != 1899) */
|
||||||
printf ("Sieve result wrong, ans = %d, expected 1899", ans);
|
/* printf ("Sieve result wrong, ans = %d, expected 1899", ans); */
|
||||||
|
|
||||||
//printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) );
|
/* //printf("Total time elapsed : %.0lf us\n" , time_diff(before , after) ); */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ MARCH :=-march=rv64ic
|
|||||||
MABI :=-mabi=lp64
|
MABI :=-mabi=lp64
|
||||||
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
|
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
|
||||||
|
|
||||||
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align
|
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align -O2
|
||||||
CC=riscv64-unknown-elf-gcc
|
CC=riscv64-unknown-elf-gcc
|
||||||
DA=riscv64-unknown-elf-objdump -d
|
DA=riscv64-unknown-elf-objdump -d
|
||||||
|
|
||||||
|
@ -5,4 +5,5 @@ int fail();
|
|||||||
int simple_csrbr_test();
|
int simple_csrbr_test();
|
||||||
int lbu_test();
|
int lbu_test();
|
||||||
int icache_spill_test();
|
int icache_spill_test();
|
||||||
|
void global_hist_test();
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
//int res = icache_spill_test();
|
//int res = icache_spill_test();
|
||||||
|
global_hist_test();
|
||||||
int res = 1;
|
int res = 1;
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
fail();
|
fail();
|
||||||
|
Loading…
Reference in New Issue
Block a user