cdf6ff8030
ysyx_22040000 李心杨 Linux calcite 6.1.65 #1-NixOS SMP PREEMPT_DYNAMIC Sun Dec 3 06:32:13 UTC 2023 x86_64 GNU/Linux 20:11:04 up 23:09, 2 users, load average: 0.52, 0.64, 0.62
31 lines
773 B
Makefile
31 lines
773 B
Makefile
VSRC := $(wildcard vsrc/*.v)
|
|
CPPSRC := $(addprefix $(PWD)/,$(wildcard csrc/*.cpp))
|
|
PREFIX ?= build
|
|
OBJDIR := $(PREFIX)/obj
|
|
VERILATOR_FLAGS := --cc --exe
|
|
|
|
all: $(OBJDIR)
|
|
$(MAKE) -j -C $(OBJDIR) -f Vexample.mk Vexample
|
|
|
|
sim: $(OBJDIR) $(VSRC) $(CPPSRC)
|
|
$(call git_commit, "sim RTL") # DO NOT REMOVE THIS LINE!!!
|
|
@echo "Running" $(OBJDIR)/Vexample "..."
|
|
@echo "================================"
|
|
@$(OBJDIR)/Vexample +tracing_off
|
|
|
|
trace: VERILATOR_FLAGS += --trace
|
|
trace: $(OBJDIR) $(VSRC) $(CPPSRC)
|
|
$(call git_commit, "trace RTL") # DO NOT REMOVE THIS LINE!!!
|
|
@$(OBJDIR)/Vexample
|
|
|
|
|
|
$(OBJDIR): $(VSRC) $(CPPSRC)
|
|
mkdir -p $(OBJDIR)
|
|
verilator $(VERILATOR_FLAGS) --Mdir $(PWD)/$(OBJDIR) $(VSRC) $(CPPSRC)
|
|
|
|
include ../Makefile
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
$(RM) -r $(OBJDIR)
|