From 8257886f6b8833c8d6fa5023a6f5b92d5bea12e5 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sat, 4 Jun 2022 21:18:57 +0200 Subject: [PATCH] Add nextpnr-xilinx makefile --- Makefile.nextpnr | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Makefile.nextpnr diff --git a/Makefile.nextpnr b/Makefile.nextpnr new file mode 100644 index 0000000..7ebcb32 --- /dev/null +++ b/Makefile.nextpnr @@ -0,0 +1,14 @@ +SYNTH_OUTPUT_FILE = $(SYNTH_WORKDIR)/$(YOSYS_MODULE_NAME).json + +$(SYNTH_WORKDIR)/%.json: $(VHDL_FILES) $(VERILOG_FILES) | $(SYNTH_WORKDIR) $(GHDL_WORKDIR)/work-obj$(VHDL_STD).cf + $(GHDL) make $(GHDL_FLAGS) $(SYNTH_ENTITY) + $(YOSYS) -m $(GHDL_YOSYS_PLUGIN) -l $(SYNTH_WORKDIR)/yosys.log -p 'ghdl $(GHDL_FLAGS) $(SYNTH_ENTITY); read_verilog $(VERILOG_FILES); chformal -remove; synth_xilinx -nodsp -nosrl -flatten -top $*; write_json $@' + +$(SYNTH_WORKDIR)/%.fasm: $(SYNTH_WORKDIR)/%.json $(XDC) + $(NEXTPNR) --xdc $(XDC) --json $< --chipdb /usr/share/nextpnr/xilinx-chipdb/$(PART).bin --fasm $@ + +$(SYNTH_WORKDIR)/%.frames: $(SYNTH_WORKDIR)/%.fasm + $(FASM2FRAMES) --db-root $(XRAY_DATABASE) --part $(PART) $< $@ + +$(SYNTH_WORKDIR)/%.bit: $(SYNTH_WORKDIR)/%.frames $(XRAY_DATABASE)/$(PART)/part.yaml + $(FRAMES2BIT) --part-file $(XRAY_DATABASE)/$(PART)/part.yaml --part-name $(PART) --frm-file $< --output-file $@