Library of reusable VHDL components
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.

116 lines
3.0 KiB

4 years ago
4 years ago
  1. SIM_SRC := ../sim
  2. SYN_SRC := ../syn
  3. CMN_SRC := ../common
  4. OSVVM_DIR := ../lib/OSVVM
  5. OSVVM_SRC := \
  6. $(OSVVM_DIR)/NamePkg.vhd \
  7. $(OSVVM_DIR)/OsvvmGlobalPkg.vhd \
  8. $(OSVVM_DIR)/VendorCovApiPkg.vhd \
  9. $(OSVVM_DIR)/TranscriptPkg.vhd \
  10. $(OSVVM_DIR)/TextUtilPkg.vhd \
  11. $(OSVVM_DIR)/AlertLogPkg.vhd \
  12. $(OSVVM_DIR)/MessagePkg.vhd \
  13. $(OSVVM_DIR)/SortListPkg_int.vhd \
  14. $(OSVVM_DIR)/RandomBasePkg.vhd \
  15. $(OSVVM_DIR)/RandomPkg.vhd \
  16. $(OSVVM_DIR)/CoveragePkg.vhd \
  17. $(OSVVM_DIR)/MemoryPkg.vhd \
  18. $(OSVVM_DIR)/ScoreboardGenericPkg.vhd \
  19. $(OSVVM_DIR)/ScoreboardPkg_slv.vhd \
  20. $(OSVVM_DIR)/ScoreboardPkg_int.vhd \
  21. $(OSVVM_DIR)/ResolutionPkg.vhd \
  22. $(OSVVM_DIR)/TbUtilPkg.vhd \
  23. $(OSVVM_DIR)/OsvvmContext.vhd
  24. VHD08_SRC := vhdl_2008
  25. VHD_STD := 08
  26. .PHONY: all
  27. all: queue dict stack sim wishbone uart spi
  28. OsvvmContext.o: $(OSVVM_SRC)
  29. ghdl -a --std=$(VHD_STD) --work=osvvm -Wno-hide $(OSVVM_SRC)
  30. UtilsP.o: $(CMN_SRC)/UtilsP.vhd
  31. ghdl -a --std=$(VHD_STD) --work=libvhdl $<
  32. # Default rule for compiling packages
  33. %P.o: $(SIM_SRC)/%P.vhd
  34. ghdl -a --std=$(VHD_STD) --work=libvhdl $<
  35. queuet: OsvvmContext.o AssertP.o QueueP.o QueueT.vhd
  36. ghdl -a --std=$(VHD_STD) QueueT.vhd
  37. ghdl -e --std=$(VHD_STD) $@
  38. dictt: OsvvmContext.o DictP.o DictT.vhd
  39. ghdl -a --std=$(VHD_STD) DictT.vhd
  40. ghdl -e --std=$(VHD_STD) $@
  41. stackt: OsvvmContext.o AssertP.o StackP.o StackT.vhd
  42. ghdl -a --std=$(VHD_STD) StackT.vhd
  43. ghdl -e --std=$(VHD_STD) $@
  44. simt: OsvvmContext.o UtilsP.o AssertP.o QueueP.o SimP.o SimT.vhd
  45. ghdl -a --std=$(VHD_STD) SimT.vhd
  46. ghdl -e --std=$(VHD_STD) $@
  47. spit: OsvvmContext.o UtilsP.o QueueP.o AssertP.o SimP.o $(SYN_SRC)/SpiSlaveE.vhd $(SYN_SRC)/SpiMasterE.vhd SpiT.vhd
  48. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/SpiSlaveE.vhd $(SYN_SRC)/SpiMasterE.vhd
  49. ghdl -a --std=$(VHD_STD) -fpsl SpiT.vhd
  50. ghdl -e --std=$(VHD_STD) $@
  51. uartt: OsvvmContext.o UtilsP.o $(SYN_SRC)/UartTx.vhd $(SYN_SRC)/UartRx.vhd UartT.vhd
  52. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/UartTx.vhd $(SYN_SRC)/UartRx.vhd
  53. ghdl -a --std=$(VHD_STD) -fpsl UartT.vhd
  54. ghdl -e --std=$(VHD_STD) $@
  55. .PHONY: spi
  56. spi: spit
  57. ghdl -r --std=$(VHD_STD) $@t
  58. # --wave=$@t.ghw
  59. .PHONY: uart
  60. uart: uartt
  61. ghdl -r --std=$(VHD_STD) $@t --wave=$@t.ghw
  62. wishbonet: OsvvmContext.o AssertP.o SimP.o QueueP.o DictP.o UtilsP.o $(SYN_SRC)/WishBoneCheckerE.vhd \
  63. $(SYN_SRC)/WishBoneP.vhd $(SYN_SRC)/WishBoneMasterE.vhd $(SYN_SRC)/WishBoneSlaveE.vhd WishBoneT.vhd
  64. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/WishBoneP.vhd
  65. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/WishBoneCheckerE.vhd $(SYN_SRC)/WishBoneMasterE.vhd $(SYN_SRC)/WishBoneSlaveE.vhd
  66. ghdl -a --std=$(VHD_STD) -fpsl WishBoneT.vhd
  67. ghdl -e --std=$(VHD_STD) $@
  68. .PHONY: wishbone
  69. wishbone: wishbonet
  70. ghdl -r --std=$(VHD_STD) $@t --wave=$@t.ghw --psl-report=$@_psl_coverage.json
  71. # Default rule for running simulation
  72. %: %t
  73. ghdl -r --std=$(VHD_STD) $@t
  74. .PHONY: clean
  75. clean:
  76. rm -f *.o
  77. rm -f *.cf
  78. rm -f *.ghw
  79. rm -f queuet
  80. rm -f dictt
  81. rm -f stackt
  82. rm -f stringt
  83. rm -f simt
  84. rm -f spit
  85. rm -f uartt
  86. rm -f wishbonet
  87. rm -f *.json
  88. .PHONY: distclean
  89. distclean: clean