From b941cf35c0290a5a63cd766bf393e340d4e8ce4c Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Wed, 8 Jan 2025 07:36:25 +0100 Subject: [PATCH] [ipgen] Do not render module_instance_name in into BUILD files Signed-off-by: Robert Schilling --- util/ipgen/renderer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/ipgen/renderer.py b/util/ipgen/renderer.py index 7b2543a5eb7fe4..1339bf8b9e882e 100644 --- a/util/ipgen/renderer.py +++ b/util/ipgen/renderer.py @@ -195,6 +195,10 @@ def _filename_without_tpl_suffix(self, filepath: Path) -> str: """ Get the name of the file without a '.tpl' suffix. """ assert filepath.suffix == '.tpl' filename = filepath.stem + # Do not render the module_instance_name into bazel BUILD file templates + # Leave the filename as it is without the *.tpl suffix + if filename == "BUILD": + return filename if "module_instance_name" in self.ip_config.param_values: filename = self.ip_config.param_values[ "module_instance_name"] + filename[len(self.ip_template.name):]