Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # these are the sources - everything depends upon them
  2. RTL=$(wildcard hdl/*/*.vhd) $(wildcard hdl/top/*.vhd)
  3. XDC=$(wildcard xdc/*.xdc)
  4. # these are all basic compilation targets, starting with "all"
  5. all: setup synth
  6. full: setup synth impl gen_bit
  7. # target to create the project file for the top level project
  8. setup: work/top/top.xpr
  9. work/top/top.xpr:
  10. @echo " === creating project === "
  11. mkdir -p work
  12. vivado -mode batch -source scripts/setup.tcl -nolog -nojournal
  13. synth: $(RTL) $(XDC)
  14. @echo " === synthesizing === "
  15. vivado -mode batch -source scripts/synth.tcl -nolog -nojournal || (echo " === SYNTH STEP ERROR SUMMARY === "; cat work/top/top.runs/synth_1/runme.log | tail -n +21; exit 1)
  16. impl: synth
  17. @echo " === implementing === "
  18. vivado -mode batch -source scripts/impl.tcl -nolog -nojournal || (echo " === IMPL STEP ERROR SUMMARY === "; cat work/top/top.runs/impl_1/runme.log | tail -n +21; exit 1)
  19. gen_bit: impl
  20. @echo " === generating bitstream === "
  21. vivado -mode batch -source scripts/generate_bitstream.tcl -nolog -nojournal
  22. # target to program the target FPGA
  23. work/top/top.bit: gen_bit
  24. program_target: work/top/top.bit
  25. @echo " === programming target === "
  26. vivado -mode batch -source scripts/program_target.tcl -log work/program_target.log -jou work/program_target.jou
  27. # target to execute sim without the gui
  28. sim: compile
  29. @echo " === running sim === "
  30. vivado -mode batch -source scripts/sim.tcl -log work/sim.log -jou work/sim.jou || (echo " === SIM STEP ERROR SUMMARY === "; cat work/top/top.sim/sim_1/behav/xsim/xvhdl.log)
  31. # target to launch the gui
  32. gui: setup
  33. @echo " === opening gui === "
  34. vivado -mode gui -source scripts/gui.tcl -log work/gui.log -jou work/gui.jou &
  35. # target to execute sim with the gui
  36. gui_sim: compile
  37. @echo " === running sim in gui === "
  38. vivado -source scripts/sim.tcl -nolog -nojournal
  39. # delete all work related files
  40. clean:
  41. @echo " === cleaning project === "
  42. rm -rf work
  43. .PHONY: all full setup synth impl gen_bit gui_sim gui program_target clean