mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Merge pull request #916 from jordancarlin/FPGA_makefile
FPGA Makefile refactoring
This commit is contained in:
		
						commit
						99f2f70186
					
				@ -1,43 +1,42 @@
 | 
				
			|||||||
dst := IP
 | 
					dst := IP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# vcu118
 | 
					all: ArtyA7
 | 
				
			||||||
# export XILINX_PART := xcvu9p-flga2104-2L-e
 | 
					 | 
				
			||||||
# export XILINX_BOARD := xilinx.com:vcu118:part0:2.4
 | 
					 | 
				
			||||||
# export board := vcu118
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# vcu108
 | 
					.PHONY: ArtyA7 vcu118 vcu108
 | 
				
			||||||
# export XILINX_PART := xcvu095-ffva2104-2-e
 | 
					 | 
				
			||||||
# export XILINX_BOARD := xilinx.com:vcu108:part0:1.7
 | 
					 | 
				
			||||||
# export board := vcu108
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Arty A7
 | 
					ArtyA7: export XILINX_PART := xc7a100tcsg324-1
 | 
				
			||||||
export XILINX_PART := xc7a100tcsg324-1
 | 
					ArtyA7: export XILINX_BOARD := digilentinc.com:arty-a7-100:part0:1.1
 | 
				
			||||||
export XILINX_BOARD := digilentinc.com:arty-a7-100:part0:1.1
 | 
					ArtyA7: export board := ArtyA7
 | 
				
			||||||
export board := ArtyA7
 | 
					ArtyA7: FPGA_Arty
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# for Arty A7 and S7 boards
 | 
					vcu118: export XILINX_PART := xcvu9p-flga2104-2L-e
 | 
				
			||||||
all: FPGA_Arty
 | 
					vcu118: export XILINX_BOARD := xilinx.com:vcu118:part0:2.4
 | 
				
			||||||
 | 
					vcu118: export board := vcu118
 | 
				
			||||||
 | 
					vcu118: FPGA_VCU
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# VCU 108 and VCU 118 boards
 | 
					vcu108: export XILINX_PART := xcvu095-ffva2104-2-e
 | 
				
			||||||
#all: FPGA_VCU
 | 
					vcu108: export XILINX_BOARD := xilinx.com:vcu108:part0:1.7
 | 
				
			||||||
 | 
					vcu108: export board := vcu108
 | 
				
			||||||
 | 
					vcu108: FPGA_VCU
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.PHONY: FPGA_Arty FPGA_VCU
 | 
				
			||||||
FPGA_Arty: PreProcessFiles IP_Arty
 | 
					FPGA_Arty: PreProcessFiles IP_Arty
 | 
				
			||||||
	vivado -mode tcl -source wally.tcl 2>&1 | tee wally.log
 | 
						vivado -mode tcl -source wally.tcl 2>&1 | tee wally.log
 | 
				
			||||||
 | 
					 | 
				
			||||||
FPGA_VCU: PreProcessFiles IP_VCU
 | 
					FPGA_VCU: PreProcessFiles IP_VCU
 | 
				
			||||||
	vivado -mode tcl -source wally.tcl 2>&1 | tee wally.log
 | 
						vivado -mode tcl -source wally.tcl 2>&1 | tee wally.log
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Generate IP Blocks
 | 
				
			||||||
 | 
					.PHONY: IP_Arty IP_VCU
 | 
				
			||||||
IP_VCU: $(dst)/xlnx_proc_sys_reset.log \
 | 
					IP_VCU: $(dst)/xlnx_proc_sys_reset.log \
 | 
				
			||||||
	$(dst)/xlnx_ddr4-$(board).log \
 | 
						MEM_VCU \
 | 
				
			||||||
	$(dst)/xlnx_axi_clock_converter.log \
 | 
						$(dst)/xlnx_axi_clock_converter.log \
 | 
				
			||||||
	$(dst)/xlnx_ahblite_axi_bridge.log \
 | 
						$(dst)/xlnx_ahblite_axi_bridge.log \
 | 
				
			||||||
	$(dst)/xlnx_axi_crossbar.log \
 | 
						$(dst)/xlnx_axi_crossbar.log \
 | 
				
			||||||
	$(dst)/xlnx_axi_dwidth_conv_32to64.log \
 | 
						$(dst)/xlnx_axi_dwidth_conv_32to64.log \
 | 
				
			||||||
	$(dst)/xlnx_axi_dwidth_conv_64to32.log \
 | 
						$(dst)/xlnx_axi_dwidth_conv_64to32.log \
 | 
				
			||||||
	$(dst)/xlnx_axi_prtcl_conv.log
 | 
						$(dst)/xlnx_axi_prtcl_conv.log
 | 
				
			||||||
 | 
					 | 
				
			||||||
IP_Arty: $(dst)/xlnx_proc_sys_reset.log \
 | 
					IP_Arty: $(dst)/xlnx_proc_sys_reset.log \
 | 
				
			||||||
	$(dst)/xlnx_ddr3-$(board).log \
 | 
						MEM_Arty \
 | 
				
			||||||
	$(dst)/xlnx_mmcm.log \
 | 
						$(dst)/xlnx_mmcm.log \
 | 
				
			||||||
	$(dst)/xlnx_axi_clock_converter.log \
 | 
						$(dst)/xlnx_axi_clock_converter.log \
 | 
				
			||||||
	$(dst)/xlnx_ahblite_axi_bridge.log
 | 
						$(dst)/xlnx_ahblite_axi_bridge.log
 | 
				
			||||||
@ -46,7 +45,15 @@ IP_Arty: $(dst)/xlnx_proc_sys_reset.log \
 | 
				
			|||||||
#$(dst)/xlnx_axi_dwidth_conv_64to32.log \
 | 
					#$(dst)/xlnx_axi_dwidth_conv_64to32.log \
 | 
				
			||||||
#$(dst)/xlnx_axi_prtcl_conv.log
 | 
					#$(dst)/xlnx_axi_prtcl_conv.log
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Generate Memory IP Blocks
 | 
				
			||||||
 | 
					.PHONY: MEM_VCU MEM_Arty
 | 
				
			||||||
 | 
					MEM_VCU:
 | 
				
			||||||
 | 
						$(MAKE) $(dst)/xlnx_ddr4-$(board).log
 | 
				
			||||||
 | 
					MEM_Arty:
 | 
				
			||||||
 | 
						$(MAKE) $(dst)/xlnx_ddr3-$(board).log
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Copy files and make necessary modifications
 | 
				
			||||||
 | 
					.PHONY: PreProcessFiles
 | 
				
			||||||
PreProcessFiles:
 | 
					PreProcessFiles:
 | 
				
			||||||
	$(MAKE) -C ../../sim deriv
 | 
						$(MAKE) -C ../../sim deriv
 | 
				
			||||||
	rm -rf ../src/CopiedFiles_do_not_add_to_repo/
 | 
						rm -rf ../src/CopiedFiles_do_not_add_to_repo/
 | 
				
			||||||
@ -63,18 +70,24 @@ PreProcessFiles:
 | 
				
			|||||||
	sed -i 's/$$WALLY/\.\.\/\.\.\/\.\.\//g' ../src/CopiedFiles_do_not_add_to_repo/generic/mem/rom1p1r.sv
 | 
						sed -i 's/$$WALLY/\.\.\/\.\.\/\.\.\//g' ../src/CopiedFiles_do_not_add_to_repo/generic/mem/rom1p1r.sv
 | 
				
			||||||
	sed -i 's/$$WALLY/\.\.\/\.\.\/\.\.\//g' ../src/CopiedFiles_do_not_add_to_repo/generic/mem/ram1p1rwbe.sv
 | 
						sed -i 's/$$WALLY/\.\.\/\.\.\/\.\.\//g' ../src/CopiedFiles_do_not_add_to_repo/generic/mem/ram1p1rwbe.sv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Generate Individual IP Blocks
 | 
				
			||||||
$(dst)/%.log: %.tcl
 | 
					$(dst)/%.log: %.tcl
 | 
				
			||||||
	mkdir -p IP
 | 
						mkdir -p IP
 | 
				
			||||||
	cd IP;\
 | 
						cd IP;\
 | 
				
			||||||
	vivado -mode batch -source ../$*.tcl | tee $*.log
 | 
						vivado -mode batch -source ../$*.tcl | tee $*.log
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Clean
 | 
				
			||||||
 | 
					.PHONY: cleanIP cleanLogs cleanFPGA cleanAll
 | 
				
			||||||
cleanIP:
 | 
					cleanIP:
 | 
				
			||||||
	rm -rf IP
 | 
						rm -rf IP
 | 
				
			||||||
 | 
					 | 
				
			||||||
cleanLogs:
 | 
					cleanLogs:
 | 
				
			||||||
	rm -rf  *.jou *.log
 | 
						rm -rf  *.jou *.log
 | 
				
			||||||
 | 
					 | 
				
			||||||
cleanFPGA:
 | 
					cleanFPGA:
 | 
				
			||||||
	rm -rf WallyFPGA.* reports sim .Xil
 | 
						rm -rf WallyFPGA.* reports sim .Xil
 | 
				
			||||||
 | 
					 | 
				
			||||||
cleanAll: cleanIP cleanLogs cleanFPGA
 | 
					cleanAll: cleanIP cleanLogs cleanFPGA
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Aliases
 | 
				
			||||||
 | 
					.PHONY: arty artya7 VCU118 VCU108
 | 
				
			||||||
 | 
					arty artya7: ArtyA7
 | 
				
			||||||
 | 
					VCU118: vcu118
 | 
				
			||||||
 | 
					VCU108: vcu108
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user