Studentenversion des ESY6/A Praktikums "signal_processing".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

questa-sim.mk 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #
  2. #
  3. #
  4. #
  5. # Make sure that the top level is assigned to main
  6. $(if $(main),,\
  7. $(error Assign top level entity name to variable "main"))
  8. # Make sure that at least on vhdl source is assigned
  9. $(if $(vhdl_srcs),,\
  10. $(error Assign at least on vhdl source to variable "vhdl_srcs"))
  11. # Append prefix -d to all generics
  12. generics = $(addprefix -g,$(generics))
  13. # Add VHDL 2008 as default build standard
  14. vhdl_flags += -2008
  15. vhdl_objs = $(vhdl_srcs:.vhd=.vhdo)
  16. verilog_objs = $(verilog_srcs:.v=.vo)
  17. assert_level := error
  18. .PHONY: sim clean
  19. sim: ${verilog_objs} ${vhdl_objs}
  20. @vsim -gCHECK_RESULTS=${CHECK_RESULTS} -voptargs=+acc -c work.${main} -do "set StdArithNoWarnings 1; set NumericStdNoWarnings 1; run -all" \
  21. | ../../scripts/highlight_test_results.sh
  22. gui: ${verilog_objs} ${vhdl_objs}
  23. @vsim -gCHECK_RESULTS=${CHECK_RESULTS} -gGUI_MODE=true -voptargs=+acc work.${main} -do "do vsim.wave; set StdArithNoWarnings 1; set NumericStdNoWarnings 1; run -all"
  24. %.vo: %.v .libwork
  25. @echo "Analysing $<"
  26. @vlog -work work ${verilog_flags} $<
  27. %.vhdo: %.vhd .libwork
  28. @echo "Analysing $<"
  29. @vcom -work work ${vhdl_flags} $<
  30. .libwork:
  31. @vlib work && vmap work work && touch $@
  32. clean:
  33. @rm -rf work \
  34. .libwork \
  35. transcript \
  36. modelsim.ini \
  37. vlog.opt \
  38. vsim.wlf \
  39. data.py \
  40. data.pyc \
  41. help:
  42. @echo Use ghdl to simulate and synthesis a vhdl design.
  43. @echo
  44. @echo Build configuration variables:
  45. @echo main main entity
  46. @echo vhdl_flags
  47. @echo generics