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.

94 lines
2.7 KiB

  1. # ======================================================================
  2. # DES encryption/decryption
  3. # algorithm according to FIPS 46-3 specification
  4. # Copyright (C) 2011 Torsten Meissner
  5. #-----------------------------------------------------------------------
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. # ======================================================================
  18. TB := tb_des
  19. RTL_SRC := \
  20. ../../rtl/vhdl/des_pkg.vhd \
  21. ../../rtl/vhdl/des.vhd
  22. SIM_SRC := ${TB}_pkg.vhd ${TB}.vhd
  23. C_SRC := ${TB}.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}.ghw
  47. .PHONY: compile
  48. compile: ${TB}
  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}: ${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}.ghw: ${TB}
  60. @echo "Run testbench ..."
  61. ghdl -r $(basename $@) --wave=$@ --assert-level=error --psl-report=$(basename $@)_psl_report.json
  62. .PHONY: wave
  63. wave: ${TB}.ghw
  64. @echo "Run GTKwave ..."
  65. gtkwave -S ${TB}.tcl $@
  66. .PHONY: clean
  67. clean:
  68. @echo "Cleaning simulation files ..."
  69. rm -rf ${TB} ${TB}.ghw *.o *.json work/ osvvm/