Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. PROJECT_NAME=miriv
  2. LOG_FILE=BUILD_$(shell date '+%d.%m.%y-%H_%M_%S').log
  3. PROJECT_DIR=$(shell pwd)
  4. SOF_FILE=output_files/$(PROJECT_NAME).sof
  5. QXP_FILE=output_files/$(PROJECT_NAME).qxp
  6. SOURCEFILES=$(shell grep VHDL_FILE $(PROJECT_NAME).qsf | grep -v "^\#" | sed 's/.*VHDL_FILE//g')
  7. RPA_SHELL=../../../rpa_shell.py
  8. all: $(SOF_FILE)
  9. pack: $(QXP_FILE)
  10. # starts the quartus GUI and loads the quartus project
  11. quartus_gui:
  12. quartus --64bit $(PROJECT_NAME).qpf &
  13. $(SOF_FILE): $(PROJECT_NAME).qsf $(PROJECT_NAME).qpf $(SOURCEFILES)
  14. @echo ""
  15. @echo "---------------------------------------------" >> $(LOG_FILE)
  16. @echo "- QUARTUS -" >> $(LOG_FILE)
  17. @echo "---------------------------------------------" >> $(LOG_FILE)
  18. quartus_sh --flow compile $(PROJECT_NAME) 2>&1 | tee -a $(LOG_FILE)
  19. $(PROJECT_DIR)/check-warnings.sh $(LOG_FILE)
  20. $(QXP_FILE): $(SOF_FILE)
  21. quartus_cdb temp -c $(PROJECT_NAME) --incremental_compilation_export=$(QXP_FILE) --incremental_compilation_export_partition_name=Top --incremental_compilation_export_post_synth=on --incremental_compilation_export_post_fit=off --incremental_compilation_export_routing=on --incremental_compilation_export_flatten=on
  22. download:
  23. quartus_pgm -m jtag -o"p;$(SOF_FILE)"
  24. run:
  25. quartus_stp -t bootloader.tcl $(DMEM) $(IMEM)
  26. minicom:
  27. minicom -D /dev/ttyUSB0 -o -b 115200
  28. run_helloworld:
  29. make -C ../software/c/
  30. make run IMEM=../software/c/helloworld.imem.mif DMEM=../software/c/helloworld.dmem.mif
  31. remote_download:
  32. $(RPA_SHELL) -p $(SOF_FILE) -n
  33. remote_run:
  34. $(RPA_SHELL) --scp $(DMEM) .rpa_shell/dmem
  35. $(RPA_SHELL) --scp $(IMEM) .rpa_shell/imem
  36. $(RPA_SHELL) --scp bootloader.tcl .rpa_shell
  37. $(RPA_SHELL) "quartus_stp -t ~/.rpa_shell/bootloader.tcl ~/.rpa_shell/dmem ~/.rpa_shell/imem"
  38. remote_minicom:
  39. $(RPA_SHELL) "minicom -D /dev/ttyUSB0 -o -b 115200"
  40. remote_run_helloworld:
  41. make -C ../software/c/
  42. make remote_run IMEM=../software/c/helloworld.imem.mif DMEM=../software/c/helloworld.dmem.mif
  43. clean:
  44. rm -f $(PROJECT_NAME).sopcinfo
  45. rm -f $(PROJECT_NAME).html
  46. rm -f $(PROJECT_NAME).cmp
  47. rm -f *.rpt
  48. rm -f *.qws
  49. rm -fr output_files
  50. rm -fr db
  51. rm -f *.bsf
  52. rm -f *.dpf
  53. rm -f *.srf
  54. rm -fr incremental_db
  55. rm -f *.jdi
  56. rm -f *.html
  57. rm -f *.smsg
  58. rm -f *.summary
  59. rm -f *.qdf
  60. rm -f *.qws
  61. rm -f *.qarlog
  62. .PHONY: all quartus_gui download clean pack