From 4e775a7bd6c2ab89cc9a867f84f0947700721f7d Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 2 Dec 2024 17:27:44 +0100 Subject: [PATCH] build/generic_toolchain/add_false_path: Only add keep attribute if from_/to are Signals. --- litex/build/generic_toolchain.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/litex/build/generic_toolchain.py b/litex/build/generic_toolchain.py index 488b92178..fd1c0af37 100644 --- a/litex/build/generic_toolchain.py +++ b/litex/build/generic_toolchain.py @@ -8,7 +8,7 @@ import os import math -from migen.fhdl.structure import _Fragment +from migen.fhdl.structure import Signal, _Fragment from litex.gen import LiteXContext @@ -178,7 +178,9 @@ class GenericToolchain: def add_false_path_constraint(self, platform, from_, to, keep=True): if keep: - from_.attr.add("keep") - to.attr.add("keep") + if isinstance(from_, Signal): + from_.attr.add("keep") + if isinstance(to, Signal): + to.attr.add("keep") if (to, from_) not in self.false_paths: self.false_paths.add((from_, to))