Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up code #138

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .gitmodules
Empty file.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ SIM_VSRC = $(shell find ./src/test/vsrc/common -name "*.v" -or -name "*.sv")
include verilator.mk
include vcs.mk

SEED ?= $(shell shuf -i 1-10000 -n 1)

clean: vcs-clean
rm -rf $(BUILD_DIR)

.PHONY: sim-verilog emu difftest_verilog clean$(REF_SO)
.PHONY: sim-verilog emu difftest_verilog clean
51 changes: 0 additions & 51 deletions config/verilator.mk

This file was deleted.

3 changes: 1 addition & 2 deletions vcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ endif
VCS_VSRC_DIR = $(abspath ./src/test/vsrc/vcs)
VCS_VFILES = $(SIM_VSRC) $(shell find $(VCS_VSRC_DIR) -name "*.v")

VCS_SEARCH_DIR = $(abspath $(BUILD_DIR))
VCS_BUILD_DIR = $(abspath $(BUILD_DIR)/simv-compile)

VCS_FLAGS += -full64 +v2k -timescale=1ns/1ns -sverilog -debug_access+all +lint=TFIPC-L
Expand All @@ -64,7 +63,7 @@ VCS_FLAGS += +define+UNIT_DELAY +define+no_warning
# C++ flags
VCS_FLAGS += -CFLAGS "$(VCS_CXXFLAGS)" -LDFLAGS "$(VCS_LDFLAGS)" -j200
# search build for other missing verilog files
VCS_FLAGS += -y $(VCS_SEARCH_DIR) +libext+.v
VCS_FLAGS += -y $(BUILD_DIR) +libext+.v
# build files put into $(VCS_BUILD_DIR)
VCS_FLAGS += -Mdir=$(VCS_BUILD_DIR)
# enable fsdb dump
Expand Down
17 changes: 2 additions & 15 deletions verilator.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
# See the Mulan PSL v2 for more details.
#***************************************************************************************

include config/verilator.mk

EMU_TOP = SimTop

EMU_CSRC_DIR = $(abspath ./src/test/csrc)
Expand All @@ -24,13 +22,15 @@ EMU_CXXFLAGS += -std=c++14 -static -Wall -I$(EMU_CSRC_DIR) -I$(SIM_CSRC_DIR) -I$
EMU_CXXFLAGS += -DVERILATOR -DNUM_CORES=$(NUM_CORES)
EMU_CXXFLAGS += $(shell sdl2-config --cflags) -fPIE

WITH_CHISELDB ?= 1
ifeq ($(WITH_CHISELDB), 1)
CHISELDB_EXTRA_ARG = $(BUILD_DIR)/chisel_db.cpp
EMU_CXXFLAGS += -I$(BUILD_DIR) -DENABLE_CHISEL_DB
else
CHISELDB_EXTRA_ARG =
endif

WITH_CONSTANTIN ?= 1
ifeq ($(WITH_CONSTANTIN), 1)
CONSTANTIN_SRC = $(BUILD_DIR)/constantin.cpp
EMU_CXXFLAGS += -I$(BUILD_DIR) -DENABLE_CONSTANTIN
Expand Down Expand Up @@ -163,21 +163,8 @@ else
ssh -tt $(REMOTE) 'export NOOP_HOME=$(NOOP_HOME); export NEMU_HOME=$(NEMU_HOME); $(MAKE) -C $(NOOP_HOME)/difftest -j230 build_emu_local'
endif

# log will only be printed when (B<=GTimer<=E) && (L < loglevel)
# use 'emu -h' to see more details
B ?= 0
E ?= 0

EMU_FLAGS = -s $(SEED) -b $(B) -e $(E) $(SNAPSHOT_OPTION) $(WAVEFORM) $(EMU_ARGS)

emu: $(EMU)

emu-run: emu
ifneq ($(REMOTE),localhost)
ls build
endif
$(EMU) -i $(IMAGE) --diff=$(REF_SO) $(EMU_FLAGS)

coverage:
verilator_coverage --annotate build/logs/annotated --annotate-min 1 build/logs/coverage.dat
python3 scripts/coverage/coverage.py build/logs/annotated/XSSimTop.v build/XSSimTop_annotated.v
Expand Down
Loading