return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
+ if clk is None: return
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period)
self.matched.append((resource, obj))
return obj
- def lookup_request(self, name, number=None):
+ def lookup_request(self, name, number=None, loose=False):
+ subname = None
+ if ":" in name: name, subname = name.split(":")
for resource, obj in self.matched:
if resource[0] == name and (number is None or
resource[1] == number):
- return obj
+ if subname is not None:
+ return getattr(obj, subname)
+ else:
+ return obj
- raise ConstraintError("Resource not found: {}:{}".format(name, number))
+ if loose:
+ return None
+ else:
+ raise ConstraintError("Resource not found: {}:{}".format(name, number))
def add_platform_command(self, command, **signals):
self.platform_commands.append((command, signals))
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
+ if clk is None: return
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period)
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
+ if clk is None: return
clk.attr.add("keep")
if hasattr(clk, "p"):
clk = clk.p
return self.toolchain.build(self, *args, **kwargs)
def add_period_constraint(self, clk, period):
+ if clk is None: return
if hasattr(clk, "p"):
clk = clk.p
self.toolchain.add_period_constraint(self, clk, period)