Makefile 786 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Project config
  2. PROJ = riscv_usb
  3. PROJ_DEPS := usb misc ice40
  4. PROJ_RTL_SRCS := $(addprefix rtl/, \
  5. bridge.v \
  6. dfu_helper.v \
  7. picorv32.v \
  8. soc_bram.v \
  9. soc_spram.v \
  10. sysmgr.v \
  11. )
  12. PROJ_SIM_SRCS := $(addprefix sim/, \
  13. spiflash.v \
  14. )
  15. PROJ_SIM_SRCS += rtl/top.v
  16. PROJ_TESTBENCHES := \
  17. dfu_helper_tb \
  18. top_tb
  19. PROJ_PREREQ = \
  20. $(BUILD_TMP)/boot.hex
  21. PROJ_TOP_SRC := rtl/top.v
  22. PROJ_TOP_MOD := top
  23. # Target config
  24. BOOT_CODE ?= app
  25. BOARD ?= icebreaker
  26. DEVICE = up5k
  27. PACKAGE = sg48
  28. NEXTPNR_ARGS = --pre-pack data/clocks.py --seed 2
  29. # Include default rules
  30. include ../../build/project-rules.mk
  31. # Custom rules
  32. ifeq ($(BOOT_CODE),dfu)
  33. YOSYS_READ_ARGS += -DDFU=1
  34. endif
  35. fw/boot_$(BOOT_CODE).hex:
  36. make -C fw boot_$(BOOT_CODE).hex
  37. $(BUILD_TMP)/boot.hex: fw/boot_$(BOOT_CODE).hex
  38. cp $< $@