Ü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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. -gCHECK_RESULTS=$(CHECK_RESULTS) \
  20. -voptargs=+acc work.${main} -do "do vsim.wave; run -all"
  21. sim: ${verilog_objs} ${vhdl_objs}
  22. @vsim \
  23. -gCHECK_RESULTS=$(CHECK_RESULTS) \
  24. -voptargs=+acc -c work.${main} -do "run -all" \
  25. | ../scripts/highlight_test_results.sh
  26. %.vo: %.v .libwork
  27. @echo "Analysing $<"
  28. @vlog -work work ${verilog_flags} $<
  29. %.vhdo: %.vhd .libwork
  30. @echo "Analysing $<"
  31. @vcom -work work ${vhdl_flags} $<
  32. .libwork:
  33. @vlib work && vmap work work && touch $@
  34. clean:
  35. @rm -rf work \
  36. .libwork \
  37. transcript \
  38. modelsim.ini \
  39. vlog.opt \
  40. vsim.wlf \
  41. data.py \
  42. data.pyc \
  43. help:
  44. @echo Use ghdl to simulate and synthesis a vhdl design.
  45. @echo
  46. @echo Build configuration variables:
  47. @echo main main entity
  48. @echo vhdl_flags
  49. @echo generics