Skip to content

Commit c795110

Browse files
committedOct 19, 2024·
Publish version 1.0
Version 1.0 marks the first public release of the rv32emu project, aligning with the research paper "Accelerating RISC-V Instruction Set Simulation with Tiered JIT Compilation," [1] which was presented at the VMIL'24 conference [2]. [1] https://dl.acm.org/doi/10.1145/3689490.3690399 [2] https://2024.splashcon.org/home/vmil-2024
1 parent a00c49f commit c795110

File tree

3 files changed

+6
-74
lines changed

3 files changed

+6
-74
lines changed
 

‎Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ AR = emar
6060
endif
6161
SOFTFLOAT_OUT = $(abspath $(OUT)/softfloat)
6262
src/softfloat/build/Linux-RISCV-GCC/Makefile:
63-
git submodule update --init src/softfloat/
63+
git clone https://github.com/sysprog21/berkeley-softfloat-3 src/softfloat --depth=1
6464
SOFTFLOAT_LIB := $(SOFTFLOAT_OUT)/softfloat.a
6565
$(SOFTFLOAT_LIB): src/softfloat/build/Linux-RISCV-GCC/Makefile
6666
$(MAKE) -C $(dir $<) BUILD_DIR=$(SOFTFLOAT_OUT) CC=$(CC) AR=$(AR)
@@ -120,7 +120,7 @@ ifeq ($(call has, GDBSTUB), 1)
120120
GDBSTUB_OUT = $(abspath $(OUT)/mini-gdbstub)
121121
GDBSTUB_COMM = 127.0.0.1:1234
122122
src/mini-gdbstub/Makefile:
123-
git submodule update --init $(dir $@)
123+
git clone https://github.com/RinHizakura/mini-gdbstub $(dir $@) --depth=1
124124
GDBSTUB_LIB := $(GDBSTUB_OUT)/libgdbstub.a
125125
$(GDBSTUB_LIB): src/mini-gdbstub/Makefile
126126
$(MAKE) -C $(dir $<) O=$(dir $@)

‎mk/artifact.mk

+3-71
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
ENABLE_PREBUILT ?= 1
2-
31
CC ?= gcc
42
CROSS_COMPILE ?= riscv-none-elf-
53

@@ -36,22 +34,11 @@ SCIMARK2_SHA1 := de278c5b8cef84ab6dda41855052c7bfef919e36
3634

3735
SHELL_HACK := $(shell mkdir -p $(BIN_DIR)/linux-x86-softfp $(BIN_DIR)/riscv32)
3836

39-
ifeq ($(call has, PREBUILT), 1)
40-
LATEST_RELEASE := $(shell wget -q https://api.github.com/repos/sysprog21/rv32emu-prebuilt/releases/latest -O- | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
41-
else
42-
# Since rv32emu only supports the dynamic binary translation of integer instruction in tiered compilation currently,
43-
# we disable the hardware floating-point and the related SIMD operation of x86.
44-
CFLAGS := -m32 -mno-sse -mno-sse2 -msoft-float -O2 -Wno-unused-result -L$(BIN_DIR)
45-
LDFLAGS := -lsoft-fp -lm
46-
47-
CFLAGS_CROSS := -march=rv32im -mabi=ilp32 -O2 -Wno-implicit-function-declaration
48-
LDFLAGS_CROSS := -lm -lsemihost
49-
endif
37+
LATEST_RELEASE := $(shell wget -q https://api.github.com/repos/sysprog21/rv32emu-prebuilt/releases/latest -O- | grep '"tag_name"' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
5038

51-
.PHONY: artifact fetch-checksum scimark2 ieeelib
39+
.PHONY: artifact fetch-checksum
5240

53-
artifact: fetch-checksum ieeelib scimark2
54-
ifeq ($(call has, PREBUILT), 1)
41+
artifact: fetch-checksum
5542
$(Q)$(PRINTF) "Checking SHA-1 of prebuilt binaries ... "
5643

5744
$(Q)$(eval PREBUILT_X86_FILENAME := $(shell cat $(BIN_DIR)/sha1sum-linux-x86-softfp | awk '{ print $$2 };'))
@@ -71,64 +58,9 @@ ifeq ($(call has, PREBUILT), 1)
7158
else \
7259
$(call notice, [OK]); \
7360
fi
74-
else
75-
git submodule update --init $(addprefix ./tests/,$(foreach tb,$(TEST_SUITES),$(tb)))
76-
$(Q)for tb in $(TEST_SUITES); do \
77-
CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" BINDIR=$(BIN_DIR)/linux-x86-softfp $(MAKE) -C ./tests/$$tb; \
78-
done
79-
$(Q)for tb in $(TEST_SUITES); do \
80-
CC=$(CROSS_COMPILE)gcc CFLAGS="$(CFLAGS_CROSS)" LDFLAGS="$(LDFLAGS_CROSS)" BINDIR=$(BIN_DIR)/riscv32 $(MAKE) -C ./tests/$$tb; \
81-
done
82-
83-
$(Q)$(PRINTF) "Building standalone testbenches ...\n"
84-
$(Q)for tb in $(TEST_BENCHES); do \
85-
$(CC) $(CFLAGS) -o $(BIN_DIR)/linux-x86-softfp/$$tb ./tests/$$tb.c $(LDFLAGS); \
86-
done
87-
$(Q)for tb in $(TEST_BENCHES); do \
88-
$(CROSS_COMPILE)gcc $(CFLAGS_CROSS) -o $(BIN_DIR)/riscv32/$$tb ./tests/$$tb.c $(LDFLAGS_CROSS); \
89-
done
90-
91-
git submodule update --init ./tests/doom ./tests/quake
92-
$(Q)$(PRINTF) "Building doom ...\n"
93-
$(Q)$(MAKE) -C ./tests/doom/src/riscv CROSS=$(CROSS_COMPILE)
94-
$(Q)cp ./tests/doom/src/riscv/doom-riscv.elf $(BIN_DIR)/riscv32/doom
95-
$(Q)$(PRINTF) "Building quake ...\n"
96-
$(Q)cd ./tests/quake && mkdir -p build && cd build && \
97-
cmake -DCMAKE_TOOLCHAIN_FILE=../port/boards/rv32emu/toolchain.cmake \
98-
-DCROSS_COMPILE=$(CROSS_COMPILE) \
99-
-DCMAKE_BUILD_TYPE=RELEASE -DBOARD_NAME=rv32emu .. && \
100-
make
101-
$(Q)cp ./tests/quake/build/port/boards/rv32emu/quake $(BIN_DIR)/riscv32/quake
102-
103-
$(Q)(cd $(BIN_DIR)/linux-x86-softfp; for fd in *; do $(SHA1SUM) "$$fd"; done) >> $(BIN_DIR)/sha1sum-linux-x86-softfp
104-
$(Q)(cd $(BIN_DIR)/riscv32; for fd in *; do $(SHA1SUM) "$$fd"; done) >> $(BIN_DIR)/sha1sum-riscv32
105-
endif
10661

10762
fetch-checksum:
108-
ifeq ($(call has, PREBUILT), 1)
10963
$(Q)$(PRINTF) "Fetching SHA-1 of prebuilt binaries ... "
11064
$(Q)wget -q -O $(BIN_DIR)/sha1sum-linux-x86-softfp https://github.com/sysprog21/rv32emu-prebuilt/releases/download/$(LATEST_RELEASE)/sha1sum-linux-x86-softfp
11165
$(Q)wget -q -O $(BIN_DIR)/sha1sum-riscv32 https://github.com/sysprog21/rv32emu-prebuilt/releases/download/$(LATEST_RELEASE)/sha1sum-riscv32
11266
$(Q)$(call notice, [OK])
113-
endif
114-
115-
scimark2:
116-
ifeq ($(call has, PREBUILT), 0)
117-
$(Q)$(call prologue,"scimark2")
118-
$(Q)$(call download,$(SCIMARK2_URL))
119-
$(Q)$(call verify,$(SCIMARK2_SHA1),$(notdir $(SCIMARK2_URL)))
120-
$(Q)$(call extract,"./tests/scimark2",$(notdir $(SCIMARK2_URL)))
121-
$(Q)$(call epilogue,$(notdir $(SCIMARK2_URL)),$(SHA1_FILE1),$(SHA1_FILE2))
122-
$(Q)$(PRINTF) "Building scimark2 ...\n"
123-
$(Q)$(MAKE) -C ./tests/scimark2 CC=$(CC) CFLAGS="-m32 -O2"
124-
$(Q)cp ./tests/scimark2/scimark2 $(BIN_DIR)/linux-x86-softfp/scimark2
125-
$(Q)$(MAKE) -C ./tests/scimark2 clean && $(RM) ./tests/scimark2/scimark2.o
126-
$(Q)$(MAKE) -C ./tests/scimark2 CC=$(CROSS_COMPILE)gcc CFLAGS="-march=rv32imf -mabi=ilp32 -O2"
127-
$(Q)cp ./tests/scimark2/scimark2 $(BIN_DIR)/riscv32/scimark2
128-
endif
129-
130-
ieeelib:
131-
ifeq ($(call has, PREBUILT), 0)
132-
git submodule update --init ./src/ieeelib
133-
$(Q)$(MAKE) -C ./src/ieeelib CC=$(CC) CFLAGS="$(CFLAGS)" BINDIR=$(BIN_DIR)
134-
endif

‎mk/riscv-arch-test.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ arch-test: $(BIN) artifact
1313
ifeq ($(CROSS_COMPILE),)
1414
$(error GNU Toolchain for RISC-V is required to build architecture tests. Please check package installation)
1515
endif
16-
git submodule update --init $(dir $(ARCH_TEST_DIR))
16+
git clone https://github.com/riscv-non-isa/riscv-arch-test $(dir $(ARCH_TEST_DIR)) --depth=1
1717
$(Q)cp $(OUT)/sail_cSim/riscv_sim_RV32 tests/arch-test-target/sail_cSim/riscv_sim_RV32
1818
$(Q)python3 -B $(RISCV_TARGET)/setup.py --riscv_device=$(RISCV_DEVICE)
1919
$(Q)riscof run --work-dir=$(WORK) \

0 commit comments

Comments
 (0)
Please sign in to comment.