- use either VCD or GHW for sim and run

git-svn-id: http://moon:8086/svn/vhdl/trunk@1406 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2021-03-20 08:55:00 +00:00
parent 398b9be4c1
commit df5ede51c2
3 changed files with 16 additions and 7 deletions
+13 -4
View File
@@ -3,10 +3,19 @@
# SRCS
# ENTITY_RUN
# WITH_VCD
# WITH_VCD ?= y
GHDL := ghdl
GHDL_GCC := ghdl-gcc
RUN_OPTS := --vcd=$(BUILD_DIR)/$(NAME).vcd --wave=$(BUILD_DIR)/$(NAME).ghw --assert-level=error
SIM_FILE-$(WITH_VCD) := $(BUILD_DIR)/$(NAME).vcd
SIM_FILE-$(WITH_GHW) := $(BUILD_DIR)/$(NAME).ghw
GTK_OPTS-$(WITH_VCD) := --vcd=$(SIM_FILE-y)
GTK_OPTS-$(WITH_GHW) := --wave=$(SIM_FILE-y)
RUN_OPTS := --assert-level=error
TS := ps
all: analyze
@@ -19,13 +28,13 @@ analyze: $(BUILD_DIR) $(SRCS)
anaborate: $(BUILD_DIR) $(SRCS)
$(GHDL_GCC) -c -o $(BUILD_DIR)/$(NAME) -Wc,O2 --work=$(NAME) --workdir=$(BUILD_DIR) $(SRCS) -e $(ENTITY_RUN)
-$(BUILD_DIR)/$(NAME) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log
-$(BUILD_DIR)/$(NAME) $(GTK_OPTS-y) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log
run: analyze
-$(GHDL) -r --work=$(NAME) --workdir=$(BUILD_DIR) --time-resolution=$(TS) $(ENTITY_RUN) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log
-$(GHDL) -r --work=$(NAME) --workdir=$(BUILD_DIR) --time-resolution=$(TS) $(ENTITY_RUN) $(GTK_OPTS-y) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log
sim: run
exec gtkwave -f $(BUILD_DIR)/$(NAME).ghw -a $(BUILD_DIR)/$(NAME).gtkw &
exec gtkwave -f $(SIM_FILE-y) -a $(BUILD_DIR)/$(NAME).gtkw &
synth: analyze
$(GHDL) --synth --work=$(NAME) --workdir=$(BUILD_DIR) $(ENTITY_SYN)
+2 -3
View File
@@ -14,15 +14,14 @@ tb_cpu_embedded_ENTITY_RUN := tb_cpu_embedded
tb_mul8x8_SRCS := tb_cpu_embedded.vhd cpu_embedded.vhd mul8x8_irom.vhdl
tb_mul8x8_ENTITY_RUN := tb_cpu_embedded
SRCS := $(JCPU_CORE_SRCS)
SRCS += ../../../PCK_FIO-2002.7/PCK_FIO_1993.vhd ../../../PCK_FIO-2002.7/PCK_FIO_1993_BODY.vhd
SRCS += $(addprefix ../src/,$($(NAME)_SRCS))
# Compile
ENTITY_RUN = $($(NAME)_ENTITY_RUN)
BUILD_DIR := build
WITH_GHW := y
include ../../../../Common/make/ghdl.mk
+1
View File
@@ -44,6 +44,7 @@ SRCS += ../src/$(NAME).vhd
# Compile
ENTITY_RUN = $(NAME)
BUILD_DIR := build
WITH_VCD := y
include ../../../../Common/make/ghdl.mk