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.

108 lines
3.7 KiB

  1. DESIGN_NAME := neorv32_aes
  2. NEORV32_CORE_DIR := ../../neorv32/rtl/core
  3. NEORV32_PKG := $(NEORV32_CORE_DIR)/neorv32_package.vhd
  4. NEORV32_APP_SRC := $(NEORV32_CORE_DIR)/neorv32_application_image.vhd
  5. NEORV32_TEMPLATES := ../../neorv32/rtl/processor_templates
  6. NEORV32_MEM_ENTITIES := \
  7. $(NEORV32_CORE_DIR)/neorv32_dmem.entity.vhd \
  8. $(NEORV32_CORE_DIR)/neorv32_imem.entity.vhd
  9. NEORV32_MEM_SRC := \
  10. $(NEORV32_CORE_DIR)/mem/neorv32_imem.default.vhd \
  11. $(NEORV32_CORE_DIR)/mem/neorv32_dmem.default.vhd
  12. NEORV32_CORE_SRC := \
  13. $(NEORV32_CORE_DIR)/neorv32_bootloader_image.vhd \
  14. $(NEORV32_CORE_DIR)/neorv32_boot_rom.vhd \
  15. $(NEORV32_CORE_DIR)/neorv32_bus_keeper.vhd \
  16. $(NEORV32_CORE_DIR)/neorv32_busswitch.vhd \
  17. $(NEORV32_CORE_DIR)/neorv32_cpu.vhd \
  18. $(NEORV32_CORE_DIR)/neorv32_cpu_alu.vhd \
  19. $(NEORV32_CORE_DIR)/neorv32_cpu_bus.vhd \
  20. $(NEORV32_CORE_DIR)/neorv32_cpu_control.vhd \
  21. $(NEORV32_CORE_DIR)/neorv32_cpu_cp_bitmanip.vhd \
  22. $(NEORV32_CORE_DIR)/neorv32_cpu_cp_cfu.vhd \
  23. $(NEORV32_CORE_DIR)/neorv32_cpu_cp_fpu.vhd \
  24. $(NEORV32_CORE_DIR)/neorv32_cpu_cp_muldiv.vhd \
  25. $(NEORV32_CORE_DIR)/neorv32_cpu_cp_shifter.vhd \
  26. $(NEORV32_CORE_DIR)/neorv32_cpu_decompressor.vhd \
  27. $(NEORV32_CORE_DIR)/neorv32_cpu_regfile.vhd \
  28. $(NEORV32_CORE_DIR)/neorv32_debug_dm.vhd \
  29. $(NEORV32_CORE_DIR)/neorv32_debug_dtm.vhd \
  30. $(NEORV32_CORE_DIR)/neorv32_fifo.vhd \
  31. $(NEORV32_CORE_DIR)/neorv32_gpio.vhd \
  32. $(NEORV32_CORE_DIR)/neorv32_gptmr.vhd \
  33. $(NEORV32_CORE_DIR)/neorv32_icache.vhd \
  34. $(NEORV32_CORE_DIR)/neorv32_mtime.vhd \
  35. $(NEORV32_CORE_DIR)/neorv32_neoled.vhd \
  36. $(NEORV32_CORE_DIR)/neorv32_onewire.vhd \
  37. $(NEORV32_CORE_DIR)/neorv32_pwm.vhd \
  38. $(NEORV32_CORE_DIR)/neorv32_slink.vhd \
  39. $(NEORV32_CORE_DIR)/neorv32_spi.vhd \
  40. $(NEORV32_CORE_DIR)/neorv32_sysinfo.vhd \
  41. $(NEORV32_CORE_DIR)/neorv32_trng.vhd \
  42. $(NEORV32_CORE_DIR)/neorv32_twi.vhd \
  43. $(NEORV32_CORE_DIR)/neorv32_uart.vhd \
  44. $(NEORV32_CORE_DIR)/neorv32_wdt.vhd \
  45. $(NEORV32_CORE_DIR)/neorv32_wishbone.vhd \
  46. $(NEORV32_CORE_DIR)/neorv32_xip.vhd \
  47. $(NEORV32_CORE_DIR)/neorv32_xirq.vhd \
  48. $(NEORV32_CORE_DIR)/neorv32_cfs.vhd \
  49. $(NEORV32_CORE_DIR)/neorv32_cfs_aes.vhd \
  50. $(NEORV32_CORE_DIR)/neorv32_top.vhd
  51. NEORV32_SRC := ${NEORV32_PKG} ${NEORV32_APP_SRC} ${NEORV32_MEM_ENTITIES} \
  52. ${NEORV32_MEM_SRC} ${NEORV32_CORE_SRC}
  53. AES_DIR := ../../cryptocores/aes/rtl/vhdl
  54. CRYPTO_SRC := \
  55. $(AES_DIR)/aes_pkg.vhd \
  56. $(AES_DIR)/aes_enc.vhd \
  57. $(AES_DIR)/aes_dec.vhd \
  58. $(AES_DIR)/aes.vhd \
  59. $(AES_DIR)/../../../ctraes/rtl/vhdl/ctraes.vhd
  60. WORK_FILES := ../rtl/${DESIGN_NAME}.vhd tb_${DESIGN_NAME}.vhd
  61. GM_FILES := ../../lib/rtl_components.vhd ../../lib/sim_components.vhd
  62. SIM_FLAGS := --std=08 -fpsl --workdir=work -Pwork
  63. .PHONY: all compile sim clean
  64. all: sim
  65. compile: tb_${DESIGN_NAME}
  66. work/work-obj08.cf: ${WORK_FILES} work/gatemate-obj08.cf work/neorv32-obj08.cf
  67. mkdir -p work
  68. ghdl -a ${SIM_FLAGS} --work=work ${WORK_FILES}
  69. work/neorv32-obj08.cf: work/gatemate-obj08.cf work/cryptocores-obj08.cf ${NEORV32_SRC}
  70. mkdir -p work
  71. ghdl -a $(SIM_FLAGS) --work=neorv32 ${NEORV32_SRC}
  72. work/cryptocores-obj08.cf: ${CRYPTO_SRC}
  73. mkdir -p work
  74. ghdl -a $(SIM_FLAGS) --work=cryptocores ${CRYPTO_SRC}
  75. work/gatemate-obj08.cf: ${GM_FILES}
  76. mkdir -p work
  77. ghdl -a ${SIM_FLAGS} --work=gatemate ${GM_FILES}
  78. tb_${DESIGN_NAME}: work/gatemate-obj08.cf work/cryptocores-obj08.cf work/neorv32-obj08.cf work/work-obj08.cf
  79. @echo "Elaborate testbench & design ..."
  80. ghdl -e ${SIM_FLAGS} -Pwork $@
  81. sim: tb_${DESIGN_NAME}
  82. @echo "Run testbench ..."
  83. ghdl -r ${SIM_FLAGS} -Pwork tb_${DESIGN_NAME} --assert-level=error --ieee-asserts=disable --wave=tb_${DESIGN_NAME}.ghw
  84. work:
  85. mkdir $@
  86. clean:
  87. @echo "Cleaning simulation files ..."
  88. rm -rf tb_${DESIGN_NAME} tb_${DESIGN_NAME}.ghw *.o work/