diff --git a/amaranth/vendor/_gowin.py b/amaranth/vendor/_gowin.py index 0272085fb..d20ed3d65 100644 --- a/amaranth/vendor/_gowin.py +++ b/amaranth/vendor/_gowin.py @@ -437,13 +437,15 @@ def _osc_div(self): file delete -force {{name}}.fs file copy -force impl/pnr/project.fs {{name}}.fs """, + # Gowin is using neither Tcl nor the Synopsys code to parse SDC files, so the grammar + # deviates from the usual (eg. no quotes, no nested braces). "{{name}}.sdc": r""" // {{autogenerated}} {% for signal, frequency in platform.iter_signal_clock_constraints() -%} - create_clock -name {{signal.name|tcl_quote}} -period {{1000000000/frequency}} [get_nets {{signal|hierarchy("/")|tcl_quote}}] + create_clock -name {{ "{" }}{{signal.name}}{{ "}" }} -period {{1000000000/frequency}} [get_nets {{signal|hierarchy("/")|tcl_quote}}] {% endfor %} {% for port, frequency in platform.iter_port_clock_constraints() -%} - create_clock -name {{port.name|tcl_quote}} -period {{1000000000/frequency}} [get_ports + create_clock -name {{ "{" }}{{port.name}}{{ "}" }} -period {{1000000000/frequency}} [get_ports {{ "{" }}{{port.name}}{{ "}" }}] {% endfor %} {{get_override("add_constraints")|default("// (add_constraints placeholder)")}}