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.

93 lines
2.7 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. RTL_SRC := \
  18. ../../rtl/vhdl/aes_pkg.vhd \
  19. ../../rtl/vhdl/aes_enc.vhd \
  20. ../../rtl/vhdl/aes_dec.vhd \
  21. ../../rtl/vhdl/aes.vhd
  22. SIM_SRC := tb_aes.vhd
  23. C_SRC := tb_aes.c
  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_aes.ghw
  47. .PHONY: compile
  48. compile: tb_aes
  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_aes: ${RTL_SRC} ${SIM_SRC} ${C_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 -Wl,$@.c -Wl,-lcrypto -Wl,-lssl $@
  59. tb_aes.ghw: tb_aes
  60. @echo "Run testbench ..."
  61. ghdl -r $(basename $@) --wave=$@ --assert-level=error --psl-report=$(basename $@)_psl_report.json
  62. .PHONY: wave
  63. wave: tb_aes.ghw
  64. @echo "Run GTKwave ..."
  65. gtkwave -S tb_aes.tcl tb_aes.ghw
  66. .PHONY: clean
  67. clean:
  68. @echo "Cleaning simulation files ..."
  69. rm -rf tb_aes tb_aes.ghw *.o *.json work/ osvvm/