1
0
rocket-chip/emulator/Makefile

57 lines
1.9 KiB
Makefile
Raw Normal View History

default: all
2014-09-01 05:26:55 +02:00
base_dir = $(abspath ..)
generated_dir = $(abspath ./generated-src)
generated_dir_debug = $(abspath ./generated-src-debug)
2013-05-01 11:58:53 +02:00
sim_dir = .
2014-09-01 05:26:55 +02:00
output_dir = $(sim_dir)/output
2013-05-01 11:58:53 +02:00
include $(base_dir)/Makefrag
2012-10-02 04:30:11 +02:00
CXXSRCS := emulator SimDTM
CXXFLAGS := $(CXXFLAGS) -std=c++11 -I$(RISCV)/include -I$(base_dir)/csrc
LDFLAGS := $(LDFLAGS) -L$(RISCV)/lib -Wl,-rpath,$(RISCV)/lib -L$(abspath $(sim_dir)) -lfesvr -lpthread
2014-01-31 21:25:19 +01:00
emu = emulator-$(PROJECT)-$(CONFIG)
emu_debug = emulator-$(PROJECT)-$(CONFIG)-debug
include $(sim_dir)/Makefrag-verilator
all: $(emu)
debug: $(emu_debug)
2012-10-02 04:30:11 +02:00
clean:
rm -rf *.o *.a emulator-* $(generated_dir) $(generated_dir_debug) DVEfiles $(output_dir)
.PHONY: default all debug clean
2012-10-02 04:30:11 +02:00
#--------------------------------------------------------------------
# Run assembly tests and benchmarks
#--------------------------------------------------------------------
ifneq ($(filter run% %.run %.out %.vpd %.vcd,$(MAKECMDGOALS)),)
-include $(generated_dir)/$(long_name).d
endif
$(output_dir)/%.run: $(output_dir)/% $(emu)
./$(emu) +max-cycles=$(timeout_cycles) $< 2> /dev/null 2> $@ && [ $$PIPESTATUS -eq 0 ]
2012-10-02 04:30:11 +02:00
$(output_dir)/%.out: $(output_dir)/% $(emu)
./$(emu) +max-cycles=$(timeout_cycles) +verbose $< $(disasm) $@ && [ $$PIPESTATUS -eq 0 ]
2012-10-02 04:30:11 +02:00
$(output_dir)/%.vcd: $(output_dir)/% $(emu_debug)
./$(emu_debug) +max-cycles=$(timeout_cycles) +verbose -v$@ $< $(disasm) $(patsubst %.vcd,%.out,$@) && [ $$PIPESTATUS -eq 0 ]
2012-10-02 04:30:11 +02:00
$(output_dir)/%.vpd: $(output_dir)/% $(emu_debug)
rm -rf $@.vcd && mkfifo $@.vcd
2013-03-26 01:01:13 +01:00
vcd2vpd $@.vcd $@ > /dev/null &
./$(emu_debug) +max-cycles=$(timeout_cycles) +verbose -v$@.vcd $< $(disasm) $(patsubst %.vpd,%.out,$@) && [ $$PIPESTATUS -eq 0 ]
2012-10-02 04:30:11 +02:00
2015-07-13 23:54:26 +02:00
run: run-asm-tests run-bmark-tests
run-debug: run-asm-tests-debug run-bmark-tests-debug
run-fast: run-asm-tests-fast run-bmark-tests-fast
.PHONY: run-asm-tests run-bmarks-test
.PHONY: run-asm-tests-debug run-bmark-tests-debug
.PHONY: run run-debug run-fast