123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- VCOM_ARGS=-2008 -work work -suppress 1236 -explicit
- VSIM_ARGS=-msgmode both
- # The order is important!
- VHDL_FILES = \
- ../prng/src/prng_pkg.vhd\
- ../prng/src/prng.vho
- TB_FILES = \
- ./tb/prng_tb.vhd
- TIME_RESOLUTION = 1ps
- TB = prng_tb
- # For the simulation time -all can also be selected. Questa then simulates until no more singal changes occour.
- SIM_TIME = -all
- WAVE_FILE = scripts/wave.do
- compile: log
- log: $(VHDL_FILES) $(TB_FILES)
- rm -f log
- vlib work | tee log
- for i in $(VHDL_FILES); do \
- vcom $(VCOM_ARGS) $$i | tee -a log;\
- done;
- for i in $(TB_FILES); do \
- vcom $(VCOM_ARGS) $$i | tee -a log;\
- done;
- @echo "--------------------------------------------------------------"
- @echo "-- Error and Warning Summary --"
- @echo "--------------------------------------------------------------"
- @cat log | grep 'Warning\|Error'
- @if [[ $$(grep "Error:" -m 1 log) ]]; then \
- echo "Compilation had errors!" \
- exit 1; \
- fi;
- list_sources:
- @for i in $(VHDL_FILES) $(TB_FILES); do \
- echo $$i;\
- done;
- sim: compile
- vsim -c -do "vsim $(TB) -t $(TIME_RESOLUTION) $(VSIM_ARGS); run $(SIM_TIME)"
- sim_gui: compile
- vsim -do "vsim $(TB) -t $(TIME_RESOLUTION) $(VSIM_ARGS); do $(WAVE_FILE); run $(SIM_TIME)"
- clean:
- rm -f transcript
- rm -f vsim.wlf
- rm -f log
- rm -fr work
- .PHONY: clean
- .PHONY: compile
- .PHONY: sim_fifo
- .PHONY: sim_fifo_cl
|