From 41762f143538488b568302ac30801a59ca09c86b Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 9 Oct 2024 10:40:25 +0200 Subject: [PATCH] vendor._gowin: Add 'add_preferences' override Implement 'add_preferences' override for CST files, allowing customizing physical placement of primitive. --- amaranth/vendor/_gowin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/amaranth/vendor/_gowin.py b/amaranth/vendor/_gowin.py index 3b72d9828..799bed570 100644 --- a/amaranth/vendor/_gowin.py +++ b/amaranth/vendor/_gowin.py @@ -175,6 +175,9 @@ class GowinPlatform(TemplatedPlatform): The environment is populated by running the script specified in the environment variable ``AMARANTH_ENV_APICULA``, if present. + Available overrides: + * ``add_preferences``: inserts commands at the end of the CST file. + Build products: * ``{{name}}.fs``: binary bitstream. @@ -186,6 +189,9 @@ class GowinPlatform(TemplatedPlatform): The environment is populated by running the script specified in the environment variable ``AMARANTH_ENV_GOWIN``, if present. + Available overrides: + * ``add_preferences``: inserts commands at the end of the CST file. + Build products: * ``{{name}}.fs``: binary bitstream. """ @@ -346,6 +352,7 @@ def _osc_div(self): IO_PORT "{{port_name}}" {{attr_name}}={{attr_value}}; {% endfor %} {% endfor %} + {{get_override("add_preferences")|default("# (add_preferences placeholder)")}} """, }