From 6c859b02c1e473a75c5a4c1ebb49a7d8212e53d0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 20 Mar 2022 13:26:50 +0000 Subject: [PATCH] nextpnr-xilinx is still under development, and needs some workarounds the first (already added) is "-nocarry", the second (added now) is "scratchpad -set xilinx_dsp.multonly 1" this is explained here: https://github.com/gatecat/nextpnr-xilinx/issues/22#issuecomment-706710984 --- nmigen/vendor/xilinx.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nmigen/vendor/xilinx.py b/nmigen/vendor/xilinx.py index 0517ecb..d924a93 100644 --- a/nmigen/vendor/xilinx.py +++ b/nmigen/vendor/xilinx.py @@ -468,6 +468,10 @@ class XilinxPlatform(TemplatedPlatform): {% endfor %} """, } + # see explanation of yosys scratchpad command: + # https://github.com/gatecat/nextpnr-xilinx/issues/22#issuecomment-706710984 + # also -nocarry option is needed due to P&R bugs when the carry-chains + # go beyond 23-25 CARRY4 blocks in length (appx 92-96 bit add/sub/cmp) _yosys_nextpnr_command_templates = [ r""" DB_DIR={{get_override("nextpnr_dir")|default("/usr/share/nextpnr")}}/prjxray-db @@ -480,7 +484,7 @@ class XilinxPlatform(TemplatedPlatform): """, r""" {{invoke_tool("yosys")}} - -p "synth_xilinx -flatten -nocarry -abc9 -nobram -arch xc7 -top {{name}}; write_json {{name}}.json" {% for file in platform.iter_files(".v", ".sv", ".vhd", ".vhdl") -%} {{file}} {% endfor %} {{name}}.v + -p "scratchpad -set xilinx_dsp.multonly 1; synth_xilinx -flatten -nocarry -abc9 -nobram -arch xc7 -top {{name}}; write_json {{name}}.json" {% for file in platform.iter_files(".v", ".sv", ".vhd", ".vhdl") -%} {{file}} {% endfor %} {{name}}.v """, r""" {{invoke_tool("nextpnr-xilinx")}} -- 2.30.2