diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -2,9 +2,9 @@ IV := iverilog IVFLAGS := -g2005-sv SIM_SRCS := $(wildcard *_tb.v) -SIMS := $(SIM_SRCS:.v=.sim) +SIMS := $(addprefix sims/,$(SIM_SRCS:.v=.sim)) WAVES := $(addprefix waves/,$(SIM_SRCS:.v=.vcd)) -DIRS := waves +DIRS := sims waves DEPS = $(sort $(1) $(foreach d,$(1),$(DEPS-$(d)))) DEPS-alu := $(call DEPS,shifter) @@ -18,18 +18,17 @@ all: simulate simulate: $(WAVES) clean: - rm -f $(SIMS) rm -rf $(DIRS) $(DIRS): mkdir -p $@ -waves/%.vcd: %.sim | waves +waves/%.vcd: sims/%.sim | waves vvp $< .SECONDEXPANSION: pc := % -%_tb.sim: %_tb.v %.v testbench.vh $$(patsubst $$(pc),$$(pc).v,$$(DEPS-$$*)) +sims/%_tb.sim: %_tb.v %.v testbench.vh $$(patsubst $$(pc),$$(pc).v,$$(DEPS-$$*)) | sims $(IV) $(IVFLAGS) -o $@ $(filter-out %.vh,$^) .PHONY: all simulate clean |