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.

137 lines
3.8 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. ## Copyright (c) 2014 - 2022 by Torsten Meissner
  2. ##
  3. ## Licensed under the Apache License, Version 2.0 (the "License");
  4. ## you may not use this file except in compliance with the License.
  5. ## You may obtain a copy of the License at
  6. ##
  7. ## https://www.apache.org/licenses/LICENSE-2.0
  8. ##
  9. ## Unless required by applicable law or agreed to in writing, software
  10. ## distributed under the License is distributed on an "AS IS" BASIS,
  11. ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. ## See the License for the specific language governing permissions and
  13. ## limitations under the License.
  14. SIM_SRC := ../sim
  15. SYN_SRC := ../syn
  16. CMN_SRC := ../common
  17. OSVVM_DIR := ../lib/OSVVM
  18. OSVVM_SRC := \
  19. $(OSVVM_DIR)/TextUtilPkg.vhd \
  20. $(OSVVM_DIR)/ResolutionPkg.vhd \
  21. $(OSVVM_DIR)/NamePkg.vhd \
  22. $(OSVVM_DIR)/OsvvmGlobalPkg.vhd \
  23. $(OSVVM_DIR)/VendorCovApiPkg.vhd \
  24. $(OSVVM_DIR)/TranscriptPkg.vhd \
  25. $(OSVVM_DIR)/AlertLogPkg.vhd \
  26. $(OSVVM_DIR)/NameStorePkg.vhd \
  27. $(OSVVM_DIR)/MessageListPkg.vhd \
  28. $(OSVVM_DIR)/SortListPkg_int.vhd \
  29. $(OSVVM_DIR)/RandomBasePkg.vhd \
  30. $(OSVVM_DIR)/RandomPkg.vhd \
  31. $(OSVVM_DIR)/RandomProcedurePkg.vhd \
  32. $(OSVVM_DIR)/CoveragePkg.vhd \
  33. $(OSVVM_DIR)/ScoreboardGenericPkg.vhd \
  34. $(OSVVM_DIR)/ScoreboardPkg_slv.vhd \
  35. $(OSVVM_DIR)/ScoreboardPkg_int.vhd \
  36. $(OSVVM_DIR)/ResizePkg.vhd \
  37. $(OSVVM_DIR)/MemoryPkg.vhd \
  38. $(OSVVM_DIR)/TbUtilPkg.vhd \
  39. $(OSVVM_DIR)/ReportPkg.vhd \
  40. $(OSVVM_DIR)/OsvvmTypesPkg.vhd \
  41. $(OSVVM_DIR)/OsvvmContext.vhd
  42. VHD08_SRC := vhdl_2008
  43. VHD_STD := 08
  44. .PHONY: all
  45. all: queue dict stack sim wishbone uart spi
  46. OsvvmContext.o: $(OSVVM_SRC)
  47. ghdl -a --std=$(VHD_STD) --work=osvvm -Wno-hide $(OSVVM_SRC)
  48. UtilsP.o: $(CMN_SRC)/UtilsP.vhd
  49. ghdl -a --std=$(VHD_STD) --work=libvhdl $<
  50. # Default rule for compiling packages
  51. %P.o: $(SIM_SRC)/%P.vhd
  52. ghdl -a --std=$(VHD_STD) --work=libvhdl $<
  53. queuet: OsvvmContext.o AssertP.o QueueP.o QueueT.vhd
  54. ghdl -a --std=$(VHD_STD) QueueT.vhd
  55. ghdl -e --std=$(VHD_STD) $@
  56. dictt: OsvvmContext.o DictP.o DictT.vhd
  57. ghdl -a --std=$(VHD_STD) DictT.vhd
  58. ghdl -e --std=$(VHD_STD) $@
  59. stackt: OsvvmContext.o AssertP.o StackP.o StackT.vhd
  60. ghdl -a --std=$(VHD_STD) StackT.vhd
  61. ghdl -e --std=$(VHD_STD) $@
  62. simt: OsvvmContext.o UtilsP.o AssertP.o QueueP.o SimP.o SimT.vhd
  63. ghdl -a --std=$(VHD_STD) SimT.vhd
  64. ghdl -e --std=$(VHD_STD) $@
  65. spit: OsvvmContext.o UtilsP.o QueueP.o AssertP.o SimP.o $(SYN_SRC)/SpiSlaveE.vhd $(SYN_SRC)/SpiMasterE.vhd SpiT.vhd
  66. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/SpiSlaveE.vhd $(SYN_SRC)/SpiMasterE.vhd
  67. ghdl -a --std=$(VHD_STD) -fpsl SpiT.vhd
  68. ghdl -e --std=$(VHD_STD) $@
  69. uartt: OsvvmContext.o UtilsP.o $(SYN_SRC)/UartTx.vhd $(SYN_SRC)/UartRx.vhd UartT.vhd
  70. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/UartTx.vhd $(SYN_SRC)/UartRx.vhd
  71. ghdl -a --std=$(VHD_STD) -fpsl UartT.vhd
  72. ghdl -e --std=$(VHD_STD) $@
  73. .PHONY: spi
  74. spi: spit
  75. ghdl -r --std=$(VHD_STD) $@t
  76. # --wave=$@t.ghw
  77. .PHONY: uart
  78. uart: uartt
  79. ghdl -r --std=$(VHD_STD) $@t --wave=$@t.ghw
  80. wishbonet: OsvvmContext.o AssertP.o SimP.o QueueP.o DictP.o UtilsP.o $(SYN_SRC)/WishBoneCheckerE.vhd \
  81. $(SYN_SRC)/WishBoneP.vhd $(SYN_SRC)/WishBoneMasterE.vhd $(SYN_SRC)/WishBoneSlaveE.vhd WishBoneT.vhd
  82. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/WishBoneP.vhd
  83. ghdl -a --std=$(VHD_STD) -fpsl $(SYN_SRC)/WishBoneCheckerE.vhd $(SYN_SRC)/WishBoneMasterE.vhd $(SYN_SRC)/WishBoneSlaveE.vhd
  84. ghdl -a --std=$(VHD_STD) -fpsl WishBoneT.vhd
  85. ghdl -e --std=$(VHD_STD) $@
  86. .PHONY: wishbone
  87. wishbone: wishbonet
  88. ghdl -r --std=$(VHD_STD) $@t --wave=$@t.ghw --psl-report=$@_psl_coverage.json
  89. # Default rule for running simulation
  90. %: %t
  91. ghdl -r --std=$(VHD_STD) $@t
  92. .PHONY: clean
  93. clean:
  94. rm -f *.o
  95. rm -f *.cf
  96. rm -f *.ghw
  97. rm -f queuet
  98. rm -f dictt
  99. rm -f stackt
  100. rm -f stringt
  101. rm -f simt
  102. rm -f spit
  103. rm -f uartt
  104. rm -f wishbonet
  105. rm -f *.json
  106. .PHONY: distclean
  107. distclean: clean