Skip to content

Commit 41762f1

Browse files
jeanthomwhitequark
authored andcommitted
vendor._gowin: Add 'add_preferences' override
Implement 'add_preferences' override for CST files, allowing customizing physical placement of primitive.
1 parent 369dc19 commit 41762f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

amaranth/vendor/_gowin.py

+7
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ class GowinPlatform(TemplatedPlatform):
175175
The environment is populated by running the script specified in the environment variable
176176
``AMARANTH_ENV_APICULA``, if present.
177177
178+
Available overrides:
179+
* ``add_preferences``: inserts commands at the end of the CST file.
180+
178181
Build products:
179182
* ``{{name}}.fs``: binary bitstream.
180183
@@ -186,6 +189,9 @@ class GowinPlatform(TemplatedPlatform):
186189
The environment is populated by running the script specified in the environment variable
187190
``AMARANTH_ENV_GOWIN``, if present.
188191
192+
Available overrides:
193+
* ``add_preferences``: inserts commands at the end of the CST file.
194+
189195
Build products:
190196
* ``{{name}}.fs``: binary bitstream.
191197
"""
@@ -346,6 +352,7 @@ def _osc_div(self):
346352
IO_PORT "{{port_name}}" {{attr_name}}={{attr_value}};
347353
{% endfor %}
348354
{% endfor %}
355+
{{get_override("add_preferences")|default("# (add_preferences placeholder)")}}
349356
""",
350357
}
351358

0 commit comments

Comments
 (0)