From ee8d484d8531e425a06f23519fc09bbf2e1acf4e Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Sun, 28 Apr 2024 13:13:53 +0200 Subject: sim: make the output of the make command more verbose Hans dumped all ghdl output to a logfile to have a short output on the terminal. I prefer to have a more verbose output in case of errors. In addition I fixed a problem when an error occurs during elaboration as the .ghw file is produced also when ghdl exits with an error. Now make will reproduce the error on each call. --- sim/makefile | 69 +++++++++--------------------------------------------------- 1 file changed, 10 insertions(+), 59 deletions(-) diff --git a/sim/makefile b/sim/makefile index 9eb77b1..2d78311 100644 --- a/sim/makefile +++ b/sim/makefile @@ -29,40 +29,29 @@ sim : t_$(PROJECT).ghw #==== WAVEFORM DRAWING ====# .PHONY : wave wave : t_$(PROJECT).ghw - @echo "---- $@" >> $(LOG_FILE) 2>&1 - @$(TIME_STAMP_LOG_FILE) - @gtkwave t_$(PROJECT).ghw view_signals.gtkw >> $(LOG_FILE) 2>&1 & + @gtkwave t_$(PROJECT).ghw view_signals.gtkw >/dev/null 2>&1 & #==== SIMULATION ====# t_$(PROJECT).ghw : .compile.done - @echo "---- $@" >> $(LOG_FILE) 2>&1 - @$(TIME_STAMP_LOG_FILE) - @echo "Simulating ..." 2>&1 | tee -a $(LOG_FILE) - @$(GHDL_CMD) -r $(GHDL_OPTIONS) t_$(PROJECT) --wave=t_$(PROJECT).ghw >> $(LOG_FILE) 2>&1 - @$(TIME_STAMP) > .sim.done + # If ghdl exits with an error code, remove the .ghw file + $(GHDL_CMD) -r $(GHDL_OPTIONS) t_$(PROJECT) --wave=t_$(PROJECT).ghw \ + || (rm -f t_$(PROJECT).ghw; exit 1) #==== COMPILATION ====# compile : .compile.done .compile.done : $(SOURCE_FILES) .gproject.done - @echo "---- $@" >> $(LOG_FILE) 2>&1 - @$(TIME_STAMP_LOG_FILE) - @echo "Compiling ..." >> $(LOG_FILE) 2>&1 - @$(GHDL_CMD) -m $(GHDL_OPTIONS) --warn-default-binding t_$(PROJECT) 2>&1 | tee -a $(LOG_FILE) - @$(TIME_STAMP) > .compile.done + $(GHDL_CMD) -m $(GHDL_OPTIONS) --warn-default-binding t_$(PROJECT) + touch .compile.done #==== PROJECT CREATION ====# gproject : .gproject.done .gproject.done : makefile.sources - @echo "---- $@" >> $(LOG_FILE) 2>&1 - @$(TIME_STAMP_LOG_FILE) - @echo "Creating Project ..." >> $(LOG_FILE) 2>&1 - @rm -rf ./ghdl_sources.tcl - @# Create a directory work if it does not exist. Otherwise do nothing. - @[ -d work ] || mkdir -p work - @$(GHDL_CMD) -i $(GHDL_OPTIONS) $(SOURCE_FILES) 2>&1 | tee -a $(LOG_FILE) - @$(TIME_STAMP) > .gproject.done + # Create a directory work if it does not exist. Otherwise do nothing. + [ -d work ] || mkdir -p work + $(GHDL_CMD) -i $(GHDL_OPTIONS) $(SOURCE_FILES) + touch .gproject.done #==== Synthesis Check ====# synthcheck : .compile.done @@ -88,41 +77,3 @@ help: @echo ' "make sim" to run ghdl with the top testbench of the project' @echo ' "make wave" to display the simulation results in the time domain' @echo ' "make clean" to remove all generated files' - - -## ---------------------------------------------------------------------------- -## Description: -## ------------ -## assumes the following design directory structure as prerequisite -## -## DigitaltechnikPraktikum -## | -## +---src -## | and2gate_equation.vhd -## | invgate_equation.vhd -## | mux2to1_structure.vhd -## | or2gate_equation.vhd -## | t_mux2to1.vhd -## | de1_mux2to1_structure.vhd -## | -## +---sim -## | | makefile -## | | -## | \---mux2to1 -## | makefile -## | makefile.sources -## | -## +---pnr -## | | makefile -## | | -## | \---de1_mux2to1 -## | de1_mux2to1_pins.tcl -## | makefile -## | -## \---scripts -## de1_pin_assignments_minimumio.csv -## de1_pin_assignments_minimumio.tcl -## modelsim.ini -## quartus_project_settings.tcl -## ---------------------------------------------------------------------------- - -- cgit v1.2.3