build/generic_toolchain/add_false_path: Only add keep attribute if from_/to are Signals.

This commit is contained in:
Florent Kermarrec 2024-12-02 17:27:44 +01:00
parent 42cf2ca5d0
commit 4e775a7bd6
1 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@
import os import os
import math import math
from migen.fhdl.structure import _Fragment from migen.fhdl.structure import Signal, _Fragment
from litex.gen import LiteXContext from litex.gen import LiteXContext
@ -178,7 +178,9 @@ class GenericToolchain:
def add_false_path_constraint(self, platform, from_, to, keep=True): def add_false_path_constraint(self, platform, from_, to, keep=True):
if keep: if keep:
if isinstance(from_, Signal):
from_.attr.add("keep") from_.attr.add("keep")
if isinstance(to, Signal):
to.attr.add("keep") to.attr.add("keep")
if (to, from_) not in self.false_paths: if (to, from_) not in self.false_paths:
self.false_paths.add((from_, to)) self.false_paths.add((from_, to))