TEXT   98

Makefile

Guest on 31st May 2022 02:11:28 PM

  1.  
  2. VIVADO_FLAGS=-notrace -mode batch
  3.  
  4. MCS_TCL=scripts/Run_mcs.tcl
  5. ROUTE_TCL=scripts/Run_route.tcl
  6. PLACEMENT_TCL=scripts/Run_placement.tcl
  7. SYNTHESIS_TCL=scripts/Run_synth.tcl
  8.  
  9. COMMON_PATH=../src/common
  10. HCAL_TRIG_PATH=../src/HCAL_trig
  11. CMS_DAQ_PATH=../src/CMS_DAQ_if
  12. CMS_DAQ_COMMON_PATH=$(CMS_DAQ_PATH)/common
  13. CMS_DAQ_10Gb_PATH=$(CMS_DAQ_PATH)/10Gb
  14. CMS_DAQ_5Gb_PATH=$(CMS_DAQ_PATH)/5Gb
  15. TCPIP_PATH=../src/TCPIP_if
  16. COMMON_10G_PATH=../src/common_10G
  17. #AMC_DAQ_LINK_PATH=../src/AMC_DAQ_LINK
  18.  
  19. COMMON_FILES=$(shell find ./src/$(COMMON_PATH) | grep -e "\.v\|\.ngc\|\.xdc")
  20.  
  21. HCAL_TOP=./src/top/AMC13_T1_HCAL*
  22. HCAL_10G_TOP=./src/top/AMC13_T1_HCAL10G*
  23. CMS_TOP=./src/top/AMC13_T1_CMS*
  24. CMS_10G_TOP=./src/top/AMC13_T1_CMS10G*
  25. G2_TOP=./src/top/AMC13_T1_g2*
  26.  
  27. HCAL_TRIG_FILES=$(shell find ./src/$(HCAL_TRIG_PATH) | grep -e "\.v\|\.ngc\|\.xdc")
  28. CMS_DAQ_COMMON_FILES=$(shell find ./src/$(CMS_DAQ_COMMON_PATH) | grep -e "\.v\|\.ngc\|\.xdc")
  29. CMS_DAQ_5Gb_FILES=$(shell find ./src/$(CMS_DAQ_5Gb_PATH) | grep -e "\.v\|\.ngc\|\.xdc")
  30. CMS_DAQ_10Gb_FILES=$(shell find ./src/$(CMS_DAQ_10Gb_PATH) | grep -e "\.v\|\.ngc\|\.xdc")
  31. TCPIP_FILES=$(shell find ./src/$(TCPIP_PATH) | grep -e "\.v\|\.ngc\|\.xdc")
  32. COMMON_10G_FILES=$(shell find ./src/$(COMMON_10G_PATH) | grep -e "\.v\|\.ngc\|\.xdc")
  33.  
  34. .SECONDARY:
  35.  
  36. .PHONY: clean HCAL HCAL10G CMS CMS10G g2 doc
  37.  
  38. all: doc HCAL10G CMS10G g2 #fakeAMC
  39.  
  40. #HCAL : mcs/AMC13_T1_HCAL.mcs
  41. HCAL10G : mcs/AMC13_T1_HCAL10G.mcs
  42. #CMS : mcs/AMC13_T1_CMS.mcs
  43. CMS10G : mcs/AMC13_T1_CMS10G.mcs
  44. g2 : mcs/AMC13_T1_g2.mcs
  45. #fakeAMC : bin/AMC13_T1_fakeAMC.mcs
  46.  
  47. clean:
  48.         @echo "Cleaning up"
  49.         @rm -fr ./build  2> /dev/null
  50.         @rm -f ./bit/* ./mcs/* 2> /dev/null
  51.         @svn --force rm ./doc/html > /dev/null 2>&1
  52. #       @rm -fr ./doc/html 2> /dev/null
  53.  
  54.  
  55. doc :  $(COMMON_FILES) $(HCAL_TRIG_FILES) $(CMS_DAQ_COMMON_FILES) $(COMMON_10G_FILES) $(CMS_DAQ_10Gb_FILES)  $(HCAL_10G_TOP) $(CMS_10G_TOP)  $(TCP_IP_FILES) $(G2_TOP)
  56.         @echo "Generating doxygen"
  57.         @rm -fr ./doc/html 2> /dev/null
  58.         @../tools/doxygen-patched ./doc/AMC13_doc.cfg  > /dev/null 2>&1
  59.         svn --force add ./doc/html  > /dev/null 2>&1
  60.  
  61. #specific rules for the post_synth step to add in version specific files
  62. #build/AMC13_T1_HCAL/post_synth.dcp : $(COMMON_FILES) $(HCAL_TRIG_FILES) $(CMS_DAQ_COMMON_FILES) $(CMS_DAQ_5Gb_FILES) $(HCAL_TOP)
  63. #       mkdir -p build && cd build && vivado $(VIVADO_FLAGS)  -source ../$(SYNTHESIS_TCL) -tclargs HCAL $(COMMON_PATH) $(HCAL_TRIG_PATH) $(CMS_DAQ_COMMON_PATH) $(CMS_DAQ_5Gb_PATH)
  64.  
  65. build/AMC13_T1_HCAL10G/post_synth.dcp : $(COMMON_FILES) $(HCAL_TRIG_FILES) $(CMS_DAQ_COMMON_FILES) $(COMMON_10G_FILES) $(CMS_DAQ_10Gb_FILES)  $(HCAL_10G_TOP)
  66.         mkdir -p build && cd build && vivado $(VIVADO_FLAGS)  -source ../$(SYNTHESIS_TCL) -tclargs HCAL10G $(COMMON_PATH) $(HCAL_TRIG_PATH) $(COMMON_10G_PATH) $(CMS_DAQ_COMMON_PATH) $(CMS_DAQ_10Gb_PATH)
  67.  
  68. #build/AMC13_T1_CMS/post_synth.dcp : $(COMMON_FILES)  $(CMS_DAQ_COMMON_FILES) $(CMS_DAQ_5Gb_FILES) $(CMS_TOP)
  69. #       mkdir -p build && cd build && vivado  $(VIVADO_FLAGS) -source ../$(SYNTHESIS_TCL) -tclargs CMS $(COMMON_PATH) $(CMS_DAQ_COMMON_PATH) $(CMS_DAQ_5Gb_PATH)
  70.  
  71. build/AMC13_T1_CMS10G/post_synth.dcp : $(COMMON_FILES) $(CMS_DAQ_COMMON_FILES) $(COMMON_10G_FILES) $(CMS_DAQ_10Gb_FILES)  $(CMS_10G_TOP)
  72.         mkdir -p build && cd build && vivado $(VIVADO_FLAGS)  -source ../$(SYNTHESIS_TCL) -tclargs CMS10G $(COMMON_PATH) $(COMMON_10G_PATH) $(CMS_DAQ_COMMON_PATH) $(CMS_DAQ_10Gb_PATH)
  73.  
  74. build/AMC13_T1_g2/post_synth.dcp : $(COMMON_FILES) $(COMMON_10G_FILES) $(TCP_IP_FILES) $(G2_TOP)
  75.         mkdir -p build && cd build && vivado $(VIVADO_FLAGS) -source ../$(SYNTHESIS_TCL) -tclargs g2 $(COMMON_PATH) $(COMMON_10G_PATH) $(TCPIP_PATH)
  76.  
  77. #build/AMC13_T1_fakeAMC/post_synth.dcp : $(COMMON_FILES) $(AMC_DAQ_LINK_FILES)
  78. #       mkdir -p build && cd build && vivado -mode batch -source ../$(SYNTHESIS_TCL) -tclargs fakeAMC $(AMC_DAQ_LINK_PATH)
  79.  
  80.  
  81. #rules for the post synth steps.  These are shared between all the steps
  82. build/AMC13_T1_%/post_place.dcp : build/AMC13_T1_%/post_synth.dcp  $(PLACEMENT_TCL)
  83.         cd build && vivado $(VIVADO_FLAGS) -source ../$(PLACEMENT_TCL) -tclargs $<
  84.  
  85. build/AMC13_T1_%/post_route.dcp : build/AMC13_T1_%/post_place.dcp  $(ROUTE_TCL)
  86.         cd build && vivado $(VIVADO_FLAGS) -source ../$(ROUTE_TCL) -tclargs $<
  87.  
  88. mcs/AMC13_T1_%.mcs : build/AMC13_T1_%/post_route.dcp  $(MCS_TCL)
  89.         cd build && vivado $(VIVADO_FLAGS) -source ../$(MCS_TCL) -tclargs $<

Raw Paste


Login or Register to edit or fork this paste. It's free.