diff --git a/fpga/xilinx/cmod_a7/Makefile b/fpga/xilinx/cmod_a7/Makefile index 8c5f88c..3d7f2cd 100644 --- a/fpga/xilinx/cmod_a7/Makefile +++ b/fpga/xilinx/cmod_a7/Makefile @@ -1,22 +1,30 @@ -VIVADO_BASE := /home/ubuntu/Xilinx/Vivado/2018.1/bin -VIVADO := $(VIVADO_BASE)/vivado - -VIVADOFLAGS := \ - -nojournal -mode batch \ - -source scripts/init.tcl - -.PHONY: synth -synth: - $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl - -.PHONY: impl -impl: - $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl -source scripts/impl.tcl - -.PHONY: bit -bit: - $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl -source scripts/impl.tcl -source scripts/bit_stream.tcl -source scripts/report.tcl - -.PHONY: clean -clean:: - rm -rf .Xil .ip_user_files *.log *.jou out usage_statistics_webtalk.xml usage_statistics_webtalk.html +VIVADO_BASE := /home/ubuntu/Xilinx/Vivado/2018.1/bin +VIVADO := $(VIVADO_BASE)/vivado + +VIVADOFLAGS := \ + -nojournal -mode batch \ + -source scripts/init.tcl + +.PHONY: synth +synth: + $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl + +.PHONY: impl +impl: + $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl -source scripts/impl.tcl + +.PHONY: bit +bit: + $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl -source scripts/impl.tcl -source scripts/bit.tcl -source scripts/report.tcl + +.PHONY: bin +bin: + $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl -source scripts/impl.tcl -source scripts/bit.tcl -source scripts/bin.tcl -source scripts/report.tcl + +.PHONY: mcs +mcs: + $(VIVADO) $(VIVADOFLAGS) -source scripts/synth.tcl -source scripts/impl.tcl -source scripts/bit.tcl -source scripts/mcs.tcl -source scripts/report.tcl + +.PHONY: clean +clean:: + rm -rf .Xil .ip_user_files *.log *.jou out usage_statistics_webtalk.xml usage_statistics_webtalk.html diff --git a/fpga/xilinx/cmod_a7/scripts/bin.tcl b/fpga/xilinx/cmod_a7/scripts/bin.tcl new file mode 100644 index 0000000..bbc4330 --- /dev/null +++ b/fpga/xilinx/cmod_a7/scripts/bin.tcl @@ -0,0 +1 @@ +write_cfgmem -format bin -size 4 -interface SPIx4 -loadbit {up 0x00000000 "out/tinyriscv_soc_top.bit" } -force -file "out/tinyriscv_soc_top.bin" diff --git a/fpga/xilinx/cmod_a7/scripts/bit_stream.tcl b/fpga/xilinx/cmod_a7/scripts/bit.tcl similarity index 98% rename from fpga/xilinx/cmod_a7/scripts/bit_stream.tcl rename to fpga/xilinx/cmod_a7/scripts/bit.tcl index 62075f6..7ada438 100644 --- a/fpga/xilinx/cmod_a7/scripts/bit_stream.tcl +++ b/fpga/xilinx/cmod_a7/scripts/bit.tcl @@ -1 +1 @@ -write_bitstream -force [file join $outdir "${top_module}.bit"] +write_bitstream -force [file join $outdir "${top_module}.bit"] diff --git a/fpga/xilinx/cmod_a7/scripts/init.tcl b/fpga/xilinx/cmod_a7/scripts/init.tcl index cbed9ab..ac04577 100644 --- a/fpga/xilinx/cmod_a7/scripts/init.tcl +++ b/fpga/xilinx/cmod_a7/scripts/init.tcl @@ -41,6 +41,3 @@ add_files -norecurse -fileset constrs_1 [glob -directory $constrsdir {*.xdc}] # 创建输出目录 file mkdir $outdir - -# 综合 -synth_design -top $top_module diff --git a/fpga/xilinx/cmod_a7/scripts/mcs.tcl b/fpga/xilinx/cmod_a7/scripts/mcs.tcl index e69de29..b9a8715 100644 --- a/fpga/xilinx/cmod_a7/scripts/mcs.tcl +++ b/fpga/xilinx/cmod_a7/scripts/mcs.tcl @@ -0,0 +1 @@ +write_cfgmem -format mcs -size 4 -interface SPIx4 -loadbit {up 0x00000000 "out/tinyriscv_soc_top.bit" } -force -file "out/tinyriscv_soc_top.mcs"