cryptography ip-cores in vhdl / verilog
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.

96 lines
2.8 KiB

  1. # ======================================================================
  2. # AES encryption/decryption
  3. # Copyright (C) 2019 Torsten Meissner
  4. #-----------------------------------------------------------------------
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. # ======================================================================
  17. .SECONDARY:
  18. DESIGN_NAME := ctraes
  19. RTL_SRC := \
  20. ../../../aes/rtl/vhdl/aes_pkg.vhd \
  21. ../../../aes/rtl/vhdl/aes_enc.vhd \
  22. ../../rtl/vhdl/$(DESIGN_NAME).vhd
  23. SIM_SRC := tb_$(DESIGN_NAME).vhd
  24. OSVVM_DIR := ../../../lib/osvvm
  25. OSVVM_SRC := \
  26. $(OSVVM_DIR)/NamePkg.vhd \
  27. $(OSVVM_DIR)/OsvvmGlobalPkg.vhd \
  28. $(OSVVM_DIR)/VendorCovApiPkg.vhd \
  29. $(OSVVM_DIR)/TranscriptPkg.vhd \
  30. $(OSVVM_DIR)/TextUtilPkg.vhd \
  31. $(OSVVM_DIR)/AlertLogPkg.vhd \
  32. $(OSVVM_DIR)/MessagePkg.vhd \
  33. $(OSVVM_DIR)/SortListPkg_int.vhd \
  34. $(OSVVM_DIR)/RandomBasePkg.vhd \
  35. $(OSVVM_DIR)/RandomPkg.vhd \
  36. $(OSVVM_DIR)/CoveragePkg.vhd \
  37. $(OSVVM_DIR)/MemoryPkg.vhd \
  38. $(OSVVM_DIR)/ScoreboardGenericPkg.vhd \
  39. $(OSVVM_DIR)/ScoreboardPkg_slv.vhd \
  40. $(OSVVM_DIR)/ScoreboardPkg_int.vhd \
  41. $(OSVVM_DIR)/ResolutionPkg.vhd \
  42. $(OSVVM_DIR)/TbUtilPkg.vhd \
  43. $(OSVVM_DIR)/OsvvmContext.vhd
  44. VHD_STD := 08
  45. .PHONY: sim
  46. sim: tb_$(DESIGN_NAME).ghw
  47. .PHONY: compile
  48. compile: tb_$(DESIGN_NAME)
  49. osvvm work:
  50. mkdir $@
  51. osvvm/OsvvmContext.o: $(OSVVM_SRC) | osvvm
  52. @echo "Analyze OSVVM library ..."
  53. ghdl -a --std=$(VHD_STD) -Wno-hide --work=osvvm --workdir=osvvm $(OSVVM_SRC)
  54. tb_$(DESIGN_NAME): ${RTL_SRC} ${SIM_SRC} osvvm/OsvvmContext.o | work
  55. @echo "Analyze testbench & design ..."
  56. ghdl -a --std=$(VHD_STD) -fpsl --workdir=work -P=osvvm ${RTL_SRC} ${SIM_SRC}
  57. @echo "Elaborate testbench & design ..."
  58. ghdl -e --std=$(VHD_STD) -fpsl --workdir=work -P=osvvm $@
  59. tb_$(DESIGN_NAME).ghw: tb_$(DESIGN_NAME)
  60. @echo "Run testbench ..."
  61. ghdl -r $(basename $@) --wave=$@ --assert-level=error --psl-report=$(basename $@)_psl_report.json
  62. .PHONY: wave
  63. wave: tb_$(DESIGN_NAME).ghw
  64. @echo "Run GTKwave ..."
  65. gtkwave -S tb_$(DESIGN_NAME).tcl tb_$(DESIGN_NAME).ghw
  66. .PHONY: clean
  67. clean:
  68. @echo "Cleaning simulation files ..."
  69. rm -rf tb_$(DESIGN_NAME) tb_$(DESIGN_NAME).ghw *.o *.json work/ osvvm/