- 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:
+13
-4
@@ -3,10 +3,19 @@
|
|||||||
# SRCS
|
# SRCS
|
||||||
# ENTITY_RUN
|
# ENTITY_RUN
|
||||||
|
|
||||||
|
# WITH_VCD
|
||||||
|
# WITH_VCD ?= y
|
||||||
|
|
||||||
GHDL := ghdl
|
GHDL := ghdl
|
||||||
GHDL_GCC := ghdl-gcc
|
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
|
TS := ps
|
||||||
|
|
||||||
all: analyze
|
all: analyze
|
||||||
@@ -19,13 +28,13 @@ analyze: $(BUILD_DIR) $(SRCS)
|
|||||||
|
|
||||||
anaborate: $(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)
|
$(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
|
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
|
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
|
synth: analyze
|
||||||
$(GHDL) --synth --work=$(NAME) --workdir=$(BUILD_DIR) $(ENTITY_SYN)
|
$(GHDL) --synth --work=$(NAME) --workdir=$(BUILD_DIR) $(ENTITY_SYN)
|
||||||
|
|||||||
@@ -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_SRCS := tb_cpu_embedded.vhd cpu_embedded.vhd mul8x8_irom.vhdl
|
||||||
tb_mul8x8_ENTITY_RUN := tb_cpu_embedded
|
tb_mul8x8_ENTITY_RUN := tb_cpu_embedded
|
||||||
|
|
||||||
|
|
||||||
SRCS := $(JCPU_CORE_SRCS)
|
SRCS := $(JCPU_CORE_SRCS)
|
||||||
SRCS += ../../../PCK_FIO-2002.7/PCK_FIO_1993.vhd ../../../PCK_FIO-2002.7/PCK_FIO_1993_BODY.vhd
|
SRCS += ../../../PCK_FIO-2002.7/PCK_FIO_1993.vhd ../../../PCK_FIO-2002.7/PCK_FIO_1993_BODY.vhd
|
||||||
SRCS += $(addprefix ../src/,$($(NAME)_SRCS))
|
SRCS += $(addprefix ../src/,$($(NAME)_SRCS))
|
||||||
|
|
||||||
|
# Compile
|
||||||
ENTITY_RUN = $($(NAME)_ENTITY_RUN)
|
ENTITY_RUN = $($(NAME)_ENTITY_RUN)
|
||||||
|
|
||||||
BUILD_DIR := build
|
BUILD_DIR := build
|
||||||
|
WITH_GHW := y
|
||||||
|
|
||||||
include ../../../../Common/make/ghdl.mk
|
include ../../../../Common/make/ghdl.mk
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ SRCS += ../src/$(NAME).vhd
|
|||||||
# Compile
|
# Compile
|
||||||
ENTITY_RUN = $(NAME)
|
ENTITY_RUN = $(NAME)
|
||||||
BUILD_DIR := build
|
BUILD_DIR := build
|
||||||
|
WITH_VCD := y
|
||||||
|
|
||||||
include ../../../../Common/make/ghdl.mk
|
include ../../../../Common/make/ghdl.mk
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user