- added missing IPF project files

- improved GHDL build script

git-svn-id: http://moon:8086/svn/vhdl/trunk@1432 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2021-03-21 15:38:01 +00:00
parent ed3b12acda
commit 85c1156549
18 changed files with 96 additions and 840 deletions
+49 -30
View File
@@ -1,59 +1,78 @@
# NAME
# BUILD_DIR
# -------------------------------------------------
# Global options
# -------------------------------------------------
# SRCS
# ENTITY_RUN
# WITH_VCD
# WITH_VCD ?= y
TARGET ?= default
ENTITY ?= default
WORK_DIR ?= work
WORK_LIB ?= work
LANG_STD ?= 93c
IEEE_STD ?= standard
RUN_TIME ?= 1000ns
GHDL := ghdl
GHDL_GCC := ghdl-gcc
SIM_FILE-$(WITH_VCD) := $(BUILD_DIR)/$(NAME).vcd
SIM_FILE-$(WITH_FST) := $(BUILD_DIR)/$(NAME).fst
SIM_FILE-$(WITH_GHW) := $(BUILD_DIR)/$(NAME).ghw
BUILD_DIR := build/$(TARGET)
SIM_FILE-$(WITH_VCD) := $(BUILD_DIR)/$(TARGET).vcd
SIM_FILE-$(WITH_FST) := $(BUILD_DIR)/$(TARGET).fst
SIM_FILE-$(WITH_GHW) := $(BUILD_DIR)/$(TARGET).ghw
GTK_OPTS-$(WITH_VCD) := --vcd=$(SIM_FILE-y)
GTK_OPTS-$(WITH_FST) := --fst=$(SIM_FILE-y)
GTK_OPTS-$(WITH_GHW) := --wave=$(SIM_FILE-y)
RUN_OPTS := --assert-level=error
TS := ps
RUN_OPTS := --stop-time=$(RUN_TIME)
GHDL_OPTS := --work=$(WORK_LIB) --workdir=$(BUILD_DIR)/$(WORK_DIR) --std=$(LANG_STD) --ieee=$(IEEE_STD)
all: analyze
$(BUILD_DIR):
$(BUILD_DIR)/$(WORK_DIR):
mkdir -p $@
analyze: $(BUILD_DIR) $(SRCS)
$(GHDL) -a --work=$(NAME) --workdir=$(BUILD_DIR) --time-resolution=$(TS) $(SRCS)
syntax:
$(GHDL) -s $(GHDL_OPTS) $(SRCS)
import:
$(GHDL) -i $(GHDL_OPTS) $(SRCS)
analyze: $(BUILD_DIR)/$(WORK_DIR) $(SRCS)
$(GHDL) -a $(GHDL_OPTS) $(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) $(GTK_OPTS-y) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log
anaborate: $(BUILD_DIR)/$(WORK_DIR) $(SRCS)
$(GHDL) -c $(GHDL_OPTS) -o $(BUILD_DIR)/$(TARGET) $(SRCS) -e $(ENTITY)
makeunit: analyze
$(GHDL) -m $(GHDL_OPTS) $(ENTITY)
elaborate: analyze
$(GHDL) -e $(GHDL_OPTS) $(ENTITY)
run: analyze
-$(GHDL) -r --work=$(NAME) --workdir=$(BUILD_DIR) --time-resolution=$(TS) $(ENTITY_RUN) $(RUN_OPTS)
$(GHDL) -r $(GHDL_OPTS) $(ENTITY) $(RUN_OPTS)
run_wave: analyze
-$(GHDL) -r --work=$(NAME) --workdir=$(BUILD_DIR) --time-resolution=$(TS) $(ENTITY_RUN) $(GTK_OPTS-y) $(RUN_OPTS) >$(BUILD_DIR)/$(NAME).log
run_show: analyze
$(GHDL) -r $(GHDL_OPTS) $(ENTITY) $(RUN_OPTS) $(GTK_OPTS-y) >$(BUILD_DIR)/$(TARGET).log
wave: run_wave
exec gtkwave -f $(SIM_FILE-y) -a $(BUILD_DIR)/$(NAME).gtkw &
synth: analyze
$(GHDL) --synth --work=$(NAME) --workdir=$(BUILD_DIR) $(ENTITY_SYN)
$(GHDL) --synth $(GHDL_OPTS) $(ENTITY)
show: run_show
exec gtkwave -f $(SIM_FILE-y) -a $(BUILD_DIR)/$(TARGET).gtkw &
clean:
rm -f $(BUILD_DIR)/$(NAME)*.cf
rm -f $(BUILD_DIR)/$(NAME)*.vcd
rm -f $(BUILD_DIR)/$(NAME)*.fst
rm -f $(BUILD_DIR)/$(NAME)*.ghw
rm -f $(BUILD_DIR)/$(NAME)*.log
rm -f $(BUILD_DIR)/$(NAME)*.o
rm -rf $(BUILD_DIR)/$(WORK_DIR)
rm -f $(BUILD_DIR)/$(TARGET)*.vcd
rm -f $(BUILD_DIR)/$(TARGET)*.fst
rm -f $(BUILD_DIR)/$(TARGET)*.ghw
rm -f $(BUILD_DIR)/$(TARGET)*.log
rm -f $(BUILD_DIR)/$(TARGET)*.o
mrproper:
rm -rf $(BUILD_DIR)
rm -rf $(WORK_DIR)
@@ -0,0 +1,30 @@
# -------------------------------------------------
# Compile script for GHDL
# -------------------------------------------------
# -------------------------------------------------
# Global options
# -------------------------------------------------
LANG_STD := 93c
IEEE_STD := standard
WORK_DIR := ieee_proposed
WORK_LIB := ieee_proposed
# -------------------------------------------------
# Target options
# -------------------------------------------------
TARGET := ghdl
SRCS := standard_additions_c.vhdl
SRCS += standard_textio_additions_c.vhdl
SRCS += env_c.vhdl
SRCS += std_logic_1164_additions.vhdl
SRCS += numeric_std_additions.vhdl
SRCS += numeric_std_unsigned_c.vhdl
SRCS += fixed_float_types_c.vhdl
SRCS += fixed_pkg_c.vhdl
SRCS += float_pkg_c.vhdl
include ../../../make/ghdl.mk