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.

51 lines
1.1 KiB

  1. # Default test
  2. DUT ?= aes
  3. # Path to ext deps
  4. EXT := ../ext
  5. ifeq (${DUT}, wishbone)
  6. TOPLEVEL := wishboneslavee
  7. SIM_ARGS := -gSimulation=true \
  8. -gAddressWidth=8 \
  9. -gDataWidth=16
  10. else
  11. TOPLEVEL := ${DUT}
  12. endif
  13. # Cocotb related
  14. MODULE := tb_${DUT}
  15. COCOTB_LOG_LEVEL := DEBUG
  16. CUSTOM_COMPILE_DEPS := results
  17. COCOTB_RESULTS_FILE := results/${MODULE}.xml
  18. # Simulator & RTL related
  19. SIM ?= ghdl
  20. TOPLEVEL_LANG := vhdl
  21. VHDL_SOURCES_libvhdl := ${EXT}/libvhdl/common/UtilsP.vhd
  22. VHDL_SOURCES := ${EXT}/libvhdl/syn/* \
  23. ${EXT}/cryptocores/aes/rtl/vhdl/*.vhd
  24. SIM_BUILD := build
  25. ifeq (${SIM}, ghdl)
  26. COMPILE_ARGS := --std=08
  27. SIM_ARGS += \
  28. --wave=results/${MODULE}.ghw \
  29. --psl-report=results/${MODULE}_psl.json \
  30. --vpi-trace=results/${MODULE}_vpi.log
  31. else
  32. EXTRA_ARGS := --std=08
  33. VHDL_LIB_ORDER := libvhdl
  34. endif
  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 aes results $(SIM_BUILD)