"fasm2frames",
"xc7frames2bit"
]
+ # 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_file_templates = {
**TemplatedPlatform.build_script_templates,
- "{{name}}.v": r"""
- /* {{autogenerated}} */
- {{emit_verilog()}}
+ "{{name}}.il": r"""
+ # {{autogenerated}}
+ {{emit_rtlil()}}
""",
"{{name}}.debug.v": r"""
/* {{autogenerated}} */
{{emit_debug_verilog()}}
""",
+ "{{name}}.ys": r"""
+ # {{autogenerated}}
+ {% for file in platform.iter_files(".v") -%}
+ read_verilog {{get_override("read_verilog_opts")|options}} {{file}}
+ {% endfor %}
+ {% for file in platform.iter_files(".sv") -%}
+ read_verilog -sv {{get_override("read_verilog_opts")|options}} {{file}}
+ {% endfor %}
+ {% for file in platform.iter_files(".il") -%}
+ read_ilang {{file}}
+ {% endfor %}
+ read_ilang {{name}}.il
+ delete w:$verilog_initial_trigger
+ {{get_override("script_after_read")|default("# (script_after_read placeholder)")}}
+ scratchpad -set xilinx_dsp.multonly 1
+ synth_xilinx -flatten -nocarry -nobram -arch xc7 -top {{name}}
+ {{get_override("script_after_synth")|default("# (script_after_synth placeholder)")}}
+ write_json {{name}}.json
+ """,
+
"{{name}}.xdc": r"""
# {{autogenerated}}
{% for port_name, pin_name, attrs in platform.iter_port_constraints_bits() -%}
{% 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/local/nextpnr-xilinx")}}/database
""",
r"""
{{invoke_tool("yosys")}}
- -p "scratchpad -set xilinx_dsp.multonly 1; synth_xilinx -flatten -nocarry -nobram -arch xc7 -top {{name}}; write_json {{name}}.json" {% for file in platform.iter_files(".v", ".sv", ".vhd", ".vhdl") -%} {{file}} {% endfor %} {{name}}.v
+ {{quiet("-q")}}
+ {{get_override("yosys_opts")|options}}
+ -l {{name}}.rpt
+ {{name}}.ys
""",
r"""
{{invoke_tool("nextpnr-xilinx")}}
+ {{quiet("--quiet")}}
+ --log {{name}}.tim
--chipdb $CHIPDB_DIR/{{platform._yosys_nextpnr_device.get(platform.device, platform.device)}}.bin
--xdc {{name}}.xdc
--json {{name}}.json