From 1f52aee5d96de74fa085aaf57e466418ea90aeba Mon Sep 17 00:00:00 2001 From: jens Date: Sat, 10 Sep 2022 08:25:14 +0200 Subject: [PATCH] Pass EXTRA_OPTS to GHDL --- Common/make/ghdl.mk | 15 ++++++++------- lib/CPUs/MIPS/src/tb_mips_top.vhd | 8 +++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Common/make/ghdl.mk b/Common/make/ghdl.mk index d9121a6..d03a35d 100644 --- a/Common/make/ghdl.mk +++ b/Common/make/ghdl.mk @@ -11,13 +11,14 @@ LANG_STD ?= 93c IEEE_STD ?= standard RUN_TIME ?= 1000ns WAVE_FORMAT ?= fst +EXTRA_OPTS ?= # Build path BUILD_DIR ?= build/$(TARGET) WORK_DIR ?= $(BUILD_DIR)/$(WORK_LIB) # 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) # ------------------------------------------------- @@ -93,12 +94,6 @@ run_wave: analyze synth: analyze $(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 $(GHDL) -r $(GHDL_OPTS) $(ENTITY) $(RUN_OPTS) --no-run --disp-tree=inst @@ -106,6 +101,12 @@ genwopt: analyze rm -rf $(TARGET).wopt.templ $(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 INSTR = $(foreach number,$(SRCS),echo $(number);) diff --git a/lib/CPUs/MIPS/src/tb_mips_top.vhd b/lib/CPUs/MIPS/src/tb_mips_top.vhd index 3b02768..789d9b1 100644 --- a/lib/CPUs/MIPS/src/tb_mips_top.vhd +++ b/lib/CPUs/MIPS/src/tb_mips_top.vhd @@ -33,6 +33,11 @@ use work.async_types.all; use work.async_defs.all; ENTITY tb_mips_top IS + Generic + ( + filename : string := "hello.elf.flash.bin" + ); + END tb_mips_top; ARCHITECTURE behavior OF tb_mips_top IS @@ -396,7 +401,8 @@ SRAM_WRITE: FLASH_READ: process(rst, flash_cs_n, flash_oe_n, flash_a) 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 index : natural; variable temp : signed(31 downto 0);