Makefile 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Project config
  2. PROJ = usb_audio
  3. PROJ_DEPS := no2usb no2misc no2ice40
  4. PROJ_RTL_SRCS := $(addprefix rtl/, \
  5. audio_pcm.v \
  6. dfu_helper.v \
  7. picorv32.v \
  8. picorv32_ice40_regs.v \
  9. soc_bram.v \
  10. soc_picorv32_base.v \
  11. soc_picorv32_bridge.v \
  12. soc_spram.v \
  13. soc_usb.v \
  14. sysmgr.v \
  15. )
  16. PROJ_SIM_SRCS := $(addprefix sim/, \
  17. spiflash.v \
  18. )
  19. PROJ_SIM_SRCS += rtl/top.v
  20. PROJ_TESTBENCHES := \
  21. dfu_helper_tb \
  22. top_tb
  23. PROJ_PREREQ = \
  24. $(BUILD_TMP)/boot.hex
  25. PROJ_TOP_SRC := rtl/top.v
  26. PROJ_TOP_MOD := top
  27. # Target config
  28. BOARD ?= icebreaker
  29. H = \#
  30. DEVICE := $(shell awk '/^$(H)$(H) dev:/{print $$3; exit 1}' data/top-$(BOARD).pcf && echo up5k)
  31. PACKAGE := $(shell awk '/^$(H)$(H) pkg:/{print $$3; exit 1}' data/top-$(BOARD).pcf && echo sg48)
  32. YOSYS_SYNTH_ARGS = -dffe_min_ce_use 4 -dsp
  33. NEXTPNR_ARGS = --pre-pack data/clocks.py --seed 2
  34. # Include default rules
  35. include ../../build/project-rules.mk
  36. # Custom rules
  37. fw/boot.hex:
  38. make -C fw boot.hex
  39. $(BUILD_TMP)/boot.hex: fw/boot.hex
  40. cp $< $@