Pass EXTRA_OPTS to GHDL

This commit is contained in:
2022-09-10 08:25:14 +02:00
parent cac6fc9540
commit 1f52aee5d9
2 changed files with 15 additions and 8 deletions
+8 -7
View File
@@ -11,13 +11,14 @@ LANG_STD ?= 93c
IEEE_STD ?= standard IEEE_STD ?= standard
RUN_TIME ?= 1000ns RUN_TIME ?= 1000ns
WAVE_FORMAT ?= fst WAVE_FORMAT ?= fst
EXTRA_OPTS ?=
# Build path # Build path
BUILD_DIR ?= build/$(TARGET) BUILD_DIR ?= build/$(TARGET)
WORK_DIR ?= $(BUILD_DIR)/$(WORK_LIB) WORK_DIR ?= $(BUILD_DIR)/$(WORK_LIB)
# Can be pre-initialized by user # Can be pre-initialized by user
RUN_OPTS += --stop-time=$(RUN_TIME) RUN_OPTS += --stop-time=$(RUN_TIME) $(EXTRA_OPTS)
GHDL_OPTS += --work=$(WORK_LIB) --workdir=$(WORK_DIR) --std=$(LANG_STD) --ieee=$(IEEE_STD) GHDL_OPTS += --work=$(WORK_LIB) --workdir=$(WORK_DIR) --std=$(LANG_STD) --ieee=$(IEEE_STD)
# ------------------------------------------------- # -------------------------------------------------
@@ -93,12 +94,6 @@ run_wave: analyze
synth: analyze synth: analyze
$(GHDL) --synth $(GHDL_OPTS) $(ENTITY) $(GHDL) --synth $(GHDL_OPTS) $(ENTITY)
wave: run_wave
exec gtkwave -f $(SIM_FILE) -a $(TARGET).gtkw &
result:
exec gtkwave -f $(SIM_FILE) -a $(TARGET).gtkw &
tree: analyze tree: analyze
$(GHDL) -r $(GHDL_OPTS) $(ENTITY) $(RUN_OPTS) --no-run --disp-tree=inst $(GHDL) -r $(GHDL_OPTS) $(ENTITY) $(RUN_OPTS) --no-run --disp-tree=inst
@@ -106,6 +101,12 @@ genwopt: analyze
rm -rf $(TARGET).wopt.templ rm -rf $(TARGET).wopt.templ
$(GHDL) -r $(GHDL_OPTS) $(ENTITY) --stop-time=0ps --write-wave-opt=$(TARGET).wopt.templ --wave=$(BUILD_DIR)/$(TARGET).ghw $(GHDL) -r $(GHDL_OPTS) $(ENTITY) --stop-time=0ps --write-wave-opt=$(TARGET).wopt.templ --wave=$(BUILD_DIR)/$(TARGET).ghw
wave: run_wave
exec gtkwave -f $(SIM_FILE) -a $(TARGET).gtkw &
result:
exec gtkwave -f $(SIM_FILE) -a $(TARGET).gtkw &
.PHONY: list .PHONY: list
INSTR = $(foreach number,$(SRCS),echo $(number);) INSTR = $(foreach number,$(SRCS),echo $(number);)
+7 -1
View File
@@ -33,6 +33,11 @@ use work.async_types.all;
use work.async_defs.all; use work.async_defs.all;
ENTITY tb_mips_top IS ENTITY tb_mips_top IS
Generic
(
filename : string := "hello.elf.flash.bin"
);
END tb_mips_top; END tb_mips_top;
ARCHITECTURE behavior OF tb_mips_top IS ARCHITECTURE behavior OF tb_mips_top IS
@@ -396,7 +401,8 @@ SRAM_WRITE:
FLASH_READ: FLASH_READ:
process(rst, flash_cs_n, flash_oe_n, flash_a) process(rst, flash_cs_n, flash_oe_n, flash_a)
type file_t is file of integer; type file_t is file of integer;
file load_flash : file_t open read_mode is "hello.elf.flash.bin"; file load_flash : file_t open read_mode is filename;
-- file load_flash : file_t open read_mode is "test_exception_sim.elf.flash.bin";
variable instr : integer; variable instr : integer;
variable index : natural; variable index : natural;
variable temp : signed(31 downto 0); variable temp : signed(31 downto 0);