nextpnr-xilinx is still under development, and needs some workarounds
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 20 Mar 2022 13:26:50 +0000 (13:26 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 20 Mar 2022 13:26:50 +0000 (13:26 +0000)
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

index 0517ecb487ad272bc77383cc3f66a7fa70c874a0..d924a931ad91ca3526777ea14ab6ffed938db490 100644 (file)
@@ -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")}}