Add benchmark

This commit is contained in:
Jeehoon Kang
2020-07-01 14:23:41 +09:00
parent c3237276dc
commit 114f38cbb6
7 changed files with 190 additions and 1 deletions

28
bench/Makefile Normal file
View File

@@ -0,0 +1,28 @@
CC=riscv64-linux-gnu-gcc-10
CXX=riscv64-linux-gnu-g++-10
KECC=../target/release/kecc
CFLAGS=-O
RM=rm -f
SRCS=$(shell find . -name "*.c")
OBJS=$(subst .c,.s,$(SRCS))
all: bench
bench: $(OBJS) driver.o
$(CXX) -o bench $(OBJS) driver.o
run: bench
qemu-riscv64-static -L /usr/riscv64-linux-gnu ./bench
driver.o: driver.cpp
$(CXX) $(CFLAGS) -o driver.o -c -I. driver.cpp
.c.s:
($(KECC) -O $< >$@) || (rm $@ -rf; exit 1)
$(KECC):
cargo build --manifest-path=../Cargo.toml --release --bin kecc
clean:
$(RM) $(OBJS) driver.o bench