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.

115 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
  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 $(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 --wave=$@t.ghw
  58. .PHONY: uart
  59. uart: uartt
  60. ghdl -r --std=$(VHD_STD) $@t --wave=$@t.ghw
  61. wishbonet: OsvvmContext.o AssertP.o SimP.o QueueP.o DictP.o UtilsP.o $(SYN_SRC)/WishBoneCheckerE.vhd \
  62. $(SYN_SRC)/WishBoneP.vhd $(SYN_SRC)/WishBoneMasterE.vhd $(SYN_SRC)/WishBoneSlaveE.vhd WishBoneT.vhd
  63. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/WishBoneP.vhd
  64. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/WishBoneCheckerE.vhd $(SYN_SRC)/WishBoneMasterE.vhd $(SYN_SRC)/WishBoneSlaveE.vhd
  65. ghdl -a --std=$(VHD_STD) -fpsl WishBoneT.vhd
  66. ghdl -e --std=$(VHD_STD) $@
  67. .PHONY: wishbone
  68. wishbone: wishbonet
  69. ghdl -r --std=$(VHD_STD) $@t --wave=$@t.ghw --psl-report=$@_psl_coverage.json
  70. # Default rule for running simulation
  71. %: %t
  72. ghdl -r --std=$(VHD_STD) $@t
  73. .PHONY: clean
  74. clean:
  75. rm -f *.o
  76. rm -f *.cf
  77. rm -f *.ghw
  78. rm -f queuet
  79. rm -f dictt
  80. rm -f stackt
  81. rm -f stringt
  82. rm -f simt
  83. rm -f spit
  84. rm -f uartt
  85. rm -f wishbonet
  86. rm -f *.json
  87. .PHONY: distclean
  88. distclean: clean