build/generic_platform: Make sure default_clk_period constraint is only applied when default_clk_period exists.

In simulation, default_clk_period is not necessarily required.
This commit is contained in:
Florent Kermarrec 2021-03-10 12:24:13 +01:00
parent ee2d373477
commit 9d08c65e8a

View file

@ -350,7 +350,7 @@ class GenericPlatform:
def do_finalize(self, fragment, *args, **kwargs): def do_finalize(self, fragment, *args, **kwargs):
"""overload this and e.g. add_platform_command()'s after the modules """overload this and e.g. add_platform_command()'s after the modules
had their say""" had their say"""
if self.use_default_clk: if self.use_default_clk and hasattr(self, "default_clk_period"):
try: try:
self.add_period_constraint( self.add_period_constraint(
self.lookup_request(self.default_clk_name), self.lookup_request(self.default_clk_name),