Makefile 694 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # First compile TB and DUT with:
  3. # make compile
  4. #
  5. # Then run Test with:
  6. # make sim IMEM=imem.mif DMEM=dmem.mif
  7. #
  8. FILE_OPT:=
  9. ifndef TIME
  10. TIME = 1ms
  11. endif
  12. ifdef IMEM
  13. FILE_OPT += -G IMEM_FILE=$(IMEM)
  14. endif
  15. ifdef DMEM
  16. FILE_OPT += -G DMEM_FILE=$(DMEM)
  17. endif
  18. all: compile
  19. clean:
  20. rm -fr work
  21. rm -f transcript
  22. rm -f *.wlf
  23. rm -f modelsim.ini
  24. rm -f output.txt
  25. compile:
  26. @vsim -c -do "do scripts/compile.do;quit -f"
  27. sim:
  28. @vsim -c $(FILE_OPT) -t ps work.tb_cpu -quiet -do "run $(TIME);quit -f" #| grep "\*\*"
  29. @cat output.txt
  30. sim_gui:
  31. @vsim $(FILE_OPT) -t ps work.tb_cpu -quiet -voptargs=+acc -do "do scripts/wave.do;run $(TIME);wave zoom full"
  32. .PHONY: all clean compile sim sim_gui