Examples of using cocotb for functional verification of VHDL designs with GHDL.
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.

48 lines
1.0 KiB

  1. # Default test
  2. DUT ?= uarttx
  3. # Test related variables
  4. ifeq (${DUT}, uarttx)
  5. MODULE := tb_uart
  6. TOPLEVEL := ${DUT}
  7. else ifeq (${DUT}, uartrx)
  8. MODULE := tb_uart
  9. TOPLEVEL := ${DUT}
  10. else ifeq (${DUT}, wishbone)
  11. MODULE := tb_wishbone
  12. TOPLEVEL := wishboneslavee
  13. SIM_ARGS := -gSimulation=true
  14. else
  15. $(error ${DUT} not available)
  16. endif
  17. # Simulator (GHDL) & RTL related
  18. SIM := ghdl
  19. TOPLEVEL_LANG := vhdl
  20. VHDL_SOURCES_libvhdl := ../libvhdl/common/UtilsP.vhd
  21. VHDL_SOURCES := ../libvhdl/syn/*.vhd
  22. SIM_BUILD := work
  23. COMPILE_ARGS := --std=08
  24. SIM_ARGS += \
  25. --wave=results/${TOPLEVEL}.ghw \
  26. --psl-report=results/${TOPLEVEL}_psl.json \
  27. --vpi-trace=results/${TOPLEVEL}_vpi.log
  28. # Cocotb related
  29. TESTCASE := test_${DUT}
  30. COCOTB_LOG_LEVEL := DEBUG
  31. CUSTOM_COMPILE_DEPS := results
  32. COCOTB_RESULTS_FILE := results/${TOPLEVEL}.xml
  33. include $(shell cocotb-config --makefiles)/Makefile.sim
  34. results:
  35. mkdir -p results
  36. .PHONY: clean
  37. clean::
  38. rm -rf *.o __pycache__ uarttx uartrx results