We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
add_clock_constraint(ClockSignal)
1 parent 6857daf commit 72a76c3Copy full SHA for 72a76c3
amaranth/build/res.py
@@ -242,7 +242,11 @@ def iter_port_constraints_bits(self):
242
yield f"{port_name}[{bit}]", pin_name, attrs
243
244
def add_clock_constraint(self, clock, frequency):
245
- if not isinstance(clock, Signal):
+ if isinstance(clock, ClockSignal):
246
+ raise TypeError(f"Object {clock!r} is not a Signal, it is a ClockSignal. "
247
+ f"You may be able to assign the value of {clock!r} to "
248
+ f"a Signal, which can then be used to add a clock constraint.")
249
+ elif not isinstance(clock, Signal):
250
raise TypeError(f"Object {clock!r} is not a Signal")
251
if not isinstance(frequency, (int, float)):
252
raise TypeError(f"Frequency must be a number, not {frequency!r}")
0 commit comments