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.

50 lines
1.1 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. -gAddressWidth=8 \
  15. -gDataWidth=16
  16. else
  17. $(error ${DUT} not available)
  18. endif
  19. # Simulator (GHDL) & RTL related
  20. SIM := ghdl
  21. TOPLEVEL_LANG := vhdl
  22. VHDL_SOURCES_libvhdl := ../libvhdl/common/UtilsP.vhd
  23. VHDL_SOURCES := ../libvhdl/syn/*.vhd
  24. SIM_BUILD := work
  25. COMPILE_ARGS := --std=08
  26. SIM_ARGS += \
  27. --wave=results/${TOPLEVEL}.ghw \
  28. --psl-report=results/${TOPLEVEL}_psl.json \
  29. --vpi-trace=results/${TOPLEVEL}_vpi.log
  30. # Cocotb related
  31. TESTCASE := test_${DUT}
  32. COCOTB_LOG_LEVEL := DEBUG
  33. CUSTOM_COMPILE_DEPS := results
  34. COCOTB_RESULTS_FILE := results/${TOPLEVEL}.xml
  35. include $(shell cocotb-config --makefiles)/Makefile.sim
  36. results:
  37. mkdir -p results
  38. .PHONY: clean
  39. clean::
  40. rm -rf *.o __pycache__ uarttx uartrx wishboneslavee results