f0177f7cea
ysyx_22040000 李心杨 Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux 11:10:11 up 19:49, 2 users, load average: 0.77, 0.64, 0.85
41 lines
1.1 KiB
Makefile
41 lines
1.1 KiB
Makefile
VSRC := $(wildcard vsrc/*.v)
|
|
CPPSRC := $(addprefix $(PWD)/,$(wildcard csrc/*.cpp))
|
|
CPPSRC += $(SRC_AUTO_BIND)
|
|
NXDC_FILES = $(abspath constr/top.nxdc)
|
|
|
|
PREFIX ?= build
|
|
OBJDIR := $(PREFIX)/obj
|
|
SUBMAKE := $(OBJDIR)/Vexample.mk
|
|
VERILATOR_FLAGS := --cc --exe
|
|
NVBOARD_HOME ?= $(abspath ../nvboard)
|
|
|
|
all: sim $(SRC_AUTO_BIND)
|
|
|
|
sim: VERILATOR_FLAGS += --trace
|
|
sim: $(VSRC) $(CPPSRC) $(OBJDIR)/Vexample
|
|
$(call git_commit, "sim RTL") # DO NOT REMOVE THIS LINE!!!
|
|
@echo "Running" $(OBJDIR)/Vexample "..."
|
|
@echo "================================"
|
|
@$(OBJDIR)/Vexample
|
|
|
|
$(OBJDIR)/Vexample: $(SUBMAKE)
|
|
$(MAKE) -C $(OBJDIR) -f $(notdir $(SUBMAKE)) Vexample
|
|
|
|
$(SUBMAKE): $(VSRC) $(CPPSRC) $(OBJDIR)
|
|
verilator $(VERILATOR_FLAGS) \
|
|
--Mdir $(abspath $(OBJDIR)) $(VSRC) $(CPPSRC)
|
|
# $(addprefix -CFLAGS , $(CXXFLAGS)) $(addprefix -LDFLAGS , $(LDFLAGS)) \
|
|
|
|
$(OBJDIR):
|
|
mkdir -p $(OBJDIR)
|
|
|
|
SRC_AUTO_BIND = $(abspath $(PREFIX)/auto_bind.cpp)
|
|
$(SRC_AUTO_BIND): $(NXDC_FILES)
|
|
python3 $(NVBOARD_HOME)/scripts/auto_pin_bind.py $^ $@
|
|
|
|
include ../Makefile
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
$(RM) -r $(OBJDIR)
|