From cce4e4462e41b630bfb1c4f77d431ec39420b650 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 5 Oct 2023 01:42:24 +0000 Subject: [PATCH] build.plat: allow removing `src` attributes from RTLIL output. This is important for Glasgow, which uses RTLIL hash as cache key, and expects it to be stable between CI jobs. --- amaranth/build/plat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amaranth/build/plat.py b/amaranth/build/plat.py index dae4c0f..dd96fc6 100644 --- a/amaranth/build/plat.py +++ b/amaranth/build/plat.py @@ -303,7 +303,7 @@ class TemplatedPlatform(Platform): continue yield net_signal, port_signal, frequency - def toolchain_prepare(self, fragment, name, **kwargs): + def toolchain_prepare(self, fragment, name, *, emit_src=True, **kwargs): # Restrict the name of the design to a strict alphanumeric character set. Platforms will # interpolate the name of the design in many different contexts: filesystem paths, Python # scripts, Tcl scripts, ad-hoc constraint files, and so on. It is not practical to add @@ -319,7 +319,7 @@ class TemplatedPlatform(Platform): # and to incorporate the Amaranth version into generated code. autogenerated = "Automatically generated by Amaranth {}. Do not edit.".format(__version__) - rtlil_text, self._name_map = rtlil.convert_fragment(fragment, name=name) + rtlil_text, self._name_map = rtlil.convert_fragment(fragment, name=name, emit_src=emit_src) # Retrieve an override specified in either the environment or as a kwarg. # expected_type parameter is used to assert the type of kwargs, passing `None` will disable