Übungen der VHDL-Einführung
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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. # Add VHDL 2008 as default build standard
  12. vhdl_flags += -2008
  13. vhdl_objs = $(vhdl_srcs:.vhd=.vhdo)
  14. verilog_objs = $(verilog_srcs:.v=.vo)
  15. assert_level := error
  16. .PHONY: sim clean
  17. gui: ${verilog_objs} ${vhdl_objs}
  18. @vsim \
  19. -gGUI_MODE=true \
  20. -gCHECK_RESULTS=$(CHECK_RESULTS) \
  21. -voptargs=+acc work.${main} -do "do vsim.wave; run -all"
  22. sim: ${verilog_objs} ${vhdl_objs}
  23. @vsim \
  24. -gGUI_MODE=false \
  25. -gCHECK_RESULTS=$(CHECK_RESULTS) \
  26. -voptargs=+acc -c work.${main} -do "run -all" \
  27. | ../scripts/highlight_test_results.sh
  28. %.vo: %.v .libwork
  29. @echo "Analysing $<"
  30. @vlog -work work ${verilog_flags} $<
  31. %.vhdo: %.vhd .libwork
  32. @echo "Analysing $<"
  33. @vcom -work work ${vhdl_flags} $<
  34. .libwork:
  35. @vlib work && vmap work work && touch $@
  36. clean:
  37. @rm -rf work \
  38. .libwork \
  39. transcript \
  40. modelsim.ini \
  41. vlog.opt \
  42. vsim.wlf \
  43. data.py \
  44. data.pyc \
  45. help:
  46. @echo Use ghdl to simulate and synthesis a vhdl design.
  47. @echo
  48. @echo Build configuration variables:
  49. @echo main main entity
  50. @echo vhdl_flags
  51. @echo generics