From 78083f251393c0efcbfea36818ab191c5a8ac442 Mon Sep 17 00:00:00 2001 From: fkwilken Date: Tue, 11 Feb 2025 21:53:11 +0100 Subject: [PATCH 1/3] Use VERILOG_INCLUDE_DIRS in Verilator Signed-off-by: fkwilken --- openlane/steps/verilator.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openlane/steps/verilator.py b/openlane/steps/verilator.py index baa39903..676271db 100644 --- a/openlane/steps/verilator.py +++ b/openlane/steps/verilator.py @@ -42,6 +42,11 @@ class Lint(Step): List[Path], "The paths of the design's Verilog files.", ), + Variable( + "VERILOG_INCLUDE_DIRS", + Optional[List[Path]], + "Specifies the Verilog `include` directories.", + ), Variable( "VERILOG_POWER_DEFINE", Optional[str], @@ -158,6 +163,10 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]: if self.config["LINTER_ERROR_ON_LATCH"]: extra_args.append("--Werror-LATCH") + if include_dirs := self.config["VERILOG_INCLUDE_DIRS"]: + include_flags = ["-I"+str(dir) for dir in include_dirs] + extra_args.append(" ".join(include_flags)) + for define in defines: extra_args.append(f"+define+{define}") From 3821ebc43cb16f52d3be36286f5039feeec12aab Mon Sep 17 00:00:00 2001 From: fkwilken Date: Tue, 11 Feb 2025 14:47:34 -0800 Subject: [PATCH 2/3] Fix Linting Issue Signed-off-by: fkwilken --- openlane/steps/verilator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlane/steps/verilator.py b/openlane/steps/verilator.py index 676271db..70f3e7eb 100644 --- a/openlane/steps/verilator.py +++ b/openlane/steps/verilator.py @@ -164,7 +164,7 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]: extra_args.append("--Werror-LATCH") if include_dirs := self.config["VERILOG_INCLUDE_DIRS"]: - include_flags = ["-I"+str(dir) for dir in include_dirs] + include_flags = ["-I" + str(dir) for dir in include_dirs] extra_args.append(" ".join(include_flags)) for define in defines: From 95e539a11e9f99adbb4c2a97709f1ec55d044c62 Mon Sep 17 00:00:00 2001 From: fkwilken Date: Wed, 12 Feb 2025 09:36:54 -0800 Subject: [PATCH 3/3] Implement Fix by donn Signed-off-by: fkwilken --- openlane/steps/verilator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlane/steps/verilator.py b/openlane/steps/verilator.py index 70f3e7eb..feca8f19 100644 --- a/openlane/steps/verilator.py +++ b/openlane/steps/verilator.py @@ -164,8 +164,7 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]: extra_args.append("--Werror-LATCH") if include_dirs := self.config["VERILOG_INCLUDE_DIRS"]: - include_flags = ["-I" + str(dir) for dir in include_dirs] - extra_args.append(" ".join(include_flags)) + extra_args.extend([f"-I{dir}" for dir in include_dirs]) for define in defines: extra_args.append(f"+define+{define}")