Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Project config
  2. PROJ = memtest
  3. PROJ_DEPS := no2misc no2ice40 no2muacm
  4. PROJ_RTL_SRCS := $(addprefix rtl/, \
  5. memtest.v \
  6. sysmgr.v \
  7. )
  8. PROJ_TESTBENCHES := \
  9. $(NULL)
  10. PROJ_TOP_SRC := rtl/top.v
  11. PROJ_TOP_MOD := top
  12. # Target config
  13. BOARD ?= icebreaker
  14. DEVICE = up5k
  15. PACKAGE = sg48
  16. SEED ?= 0
  17. PIN_DEF = $(BUILD_TMP)/$(PROJ_TOP_MOD).pcf
  18. NEXTPNR_ARGS = --no-promote-globals --timing-allow-fail --pre-pack data/clocks.py --pre-place $(CORE_no2ice40_DIR)/sw/serdes-nextpnr-place.py --seed $(SEED)
  19. PCFS = $(abspath data/$(PROJ_TOP_MOD)-$(BOARD).pcf) $(abspath data/$(PROJ_TOP_MOD)-$(BOARD)-$(MEM).pcf)
  20. # Build options
  21. # spi / hyperram
  22. MEM ?= spi
  23. # none / 4bpp / 12bpp
  24. VIDEO ?= none
  25. YOSYS_READ_ARGS += -DMEM_$(MEM)=1 -DVIDEO_$(VIDEO)=1
  26. ifeq ($(MEM),spi)
  27. PROJ_DEPS += no2qpimem
  28. endif
  29. ifeq ($(MEM),hyperram)
  30. PROJ_DEPS += no2hyperbus
  31. endif
  32. ifneq ($(VIDEO),none)
  33. PROJ_DEPS += video
  34. PROJ_RTL_SRCS += $(addprefix rtl/, \
  35. hdmi_buf.v \
  36. hdmi_out.v \
  37. )
  38. PCFS += $(abspath data/$(PROJ_TOP_MOD)-$(BOARD)-hdmi-$(VIDEO).pcf)
  39. endif
  40. # Include default rules
  41. include ../../build/project-rules.mk
  42. # Custom rules
  43. $(PIN_DEF): $(PCFS)
  44. cat $^ > $@