60 lines
2.3 KiB
Makefile
60 lines
2.3 KiB
Makefile
BUILD = .build
|
|
|
|
VERILOG = \
|
|
src/char_map.v \
|
|
src/color_map.v \
|
|
src/dvi_top.v \
|
|
src/dvid.v \
|
|
src/encode.v \
|
|
src/hdmi.xdc \
|
|
src/simple_dual_ram.v \
|
|
|
|
.PHONY: all clean upload program
|
|
|
|
all: $(BUILD)/impl.bin
|
|
|
|
$(BUILD)/ip/clk_wiz_0/clk_wiz_0.xci: scripts/clk_wiz_0.tcl | $(BUILD)/ip
|
|
/opt/Xilinx/Vivado/2019.1/bin/vivado -mode batch -source scripts/clk_wiz_0.tcl -nolog -nojournal
|
|
|
|
$(BUILD)/ip/microblaze_mcs_0/microblaze_mcs_0.xci: scripts/microblaze_mcs_0.tcl | $(BUILD)/ip
|
|
/opt/Xilinx/Vivado/2019.1/bin/vivado -mode batch -source scripts/microblaze_mcs_0.tcl -nolog -nojournal
|
|
|
|
$(BUILD)/5_route.dcp: $(VERILOG) $(BUILD)/ip/clk_wiz_0/clk_wiz_0.xci $(BUILD)/ip/microblaze_mcs_0/microblaze_mcs_0.xci scripts/build.tcl | $(BUILD)
|
|
/opt/Xilinx/Vivado/2019.1/bin/vivado -mode batch -source scripts/build.tcl -nolog -nojournal
|
|
|
|
$(BUILD)/impl.bin: $(BUILD)/5_route.dcp $(BUILD)/controller.elf scripts/write.tcl | $(BUILD)
|
|
/opt/Xilinx/Vivado/2019.1/bin/vivado -mode batch -source scripts/write.tcl -nolog -nojournal
|
|
|
|
$(BUILD)/bsp/system.mss: $(BUILD)/system.hdf | $(BUILD)
|
|
/opt/Xilinx/SDK/2019.1/bin/xsdk -batch scripts/sdk.tcl
|
|
|
|
$(BUILD)/bsp/microblaze_I/lib/libxil.a: $(BUILD)/bsp/system.mss
|
|
$(MAKE) -C $(BUILD)/bsp all
|
|
|
|
OBJ = \
|
|
$(BUILD)/obj/main.o
|
|
|
|
$(BUILD)/obj/%.o: software/src/%.c $(BUILD)/bsp/microblaze_I/lib/libxil.a | $(BUILD)/obj
|
|
mb-gcc -Wall -O2 -c -fmessage-length=0 -MT"$@" -I$(BUILD)/bsp/microblaze_I/include -mno-xl-reorder -mlittle-endian -mcpu=v11.0 -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
|
|
|
|
$(BUILD)/controller.elf: $(OBJ) software/src/lscript.ld $(BUILD)/bsp/microblaze_I/lib/libxil.a | $(BUILD)
|
|
mb-gcc -Wl,-T -Wl,software/src/lscript.ld -L$(BUILD)/bsp/microblaze_I/lib -mlittle-endian -mcpu=v11.0 -mxl-soft-mul -Wl,--no-relax -Wl,--gc-sections -o "$@" $(OBJ) -Wl,--start-group,-lxil,-lgcc,-lc,--end-group
|
|
|
|
$(BUILD):
|
|
mkdir $@
|
|
|
|
$(BUILD)/ip: | $(BUILD)
|
|
mkdir $@
|
|
|
|
$(BUILD)/obj: | $(BUILD)
|
|
mkdir $@
|
|
|
|
upload: $(BUILD)/impl.bin
|
|
sudo openocd -f scripts/openocd.cfg -c "init" -c "pld load 0 .build/impl.bit" -c "shutdown"
|
|
|
|
program: $(BUILD)/impl.bin
|
|
sudo openocd -f scripts/openocd.cfg -c "init" -c "jtagspi_init 0 scripts/bscan_spi_xc7a35t.bit" -c "jtagspi_program .build/impl.bin 0x0" -c "fpga_program" -c "shutdown"
|
|
|
|
clean:
|
|
rm -fr $(BUILD)
|