Closed bjonnh closed 1 year ago
I confirm that going back to commit 53a0bc92e459ad440ae1a9fb9f6f24c600f658d6 solves this issue.
I just debugged the same issue. The problem is that fb0c9e8 and 53a0bc9 moved some checks from the individual platforms to GenericToolchain.add_period_constraint
, but since LatticeTrellisToolchain
is overriding add_period_constraint
, those checks are now omitted.
Adding them to LatticeTrellisToolchain
solves the problem:
diff --git a/litex/build/lattice/trellis.py b/litex/build/lattice/trellis.py
index 0f365c83..36786423 100644
--- a/litex/build/lattice/trellis.py
+++ b/litex/build/lattice/trellis.py
@@ -146,6 +146,10 @@ class LatticeTrellisToolchain(YosysNextPNRToolchain):
}
def add_period_constraint(self, platform, clk, period):
+ if clk is None:
+ return
+ if hasattr(clk, "p"):
+ clk = clk.p
platform.add_platform_command("""FREQUENCY PORT "{clk}" {freq} MHz;""".format(
freq=str(float(1/period)*1000), clk="{clk}"), clk=clk)
It looks like this might be a problem for some of the other toolchains as well.
Thanks @bjonnh and @zyp and sorry for this. This should be fixed with https://github.com/enjoy-digital/litex/commit/f5a9efd8ba42da36cd1ab6a63bc685dfe7ce317b. Will check LiteX-Boards CI with it.
@enjoy-digital too fast... I have written this but didn't have time to open the PR :)
@trabucayre: I just tried to fix what I broke :) we could still revisit this and improve in the future.
Thank you so much for the quick fix!
@bjonnh thanks for reporting!
fix confirmed by running
https://github.com/bjonnh/fpga_class_psone/blob/main/setup_linux.sh
Thoughts on using this or a version of it for CI?
Thanks @CarlFK, the issue was also raised with current CI on LiteX-Boards but I would need to revisit CI trigger to catch such issues faster.
https://github.com/enjoy-digital/litex/commit/fb0c9e846d72fc4fe99ca329cc84a8d2537d3d8d
This seems to break building even simple SoCs or just block programs on ECP5: for example just trying to build the target of colorlight_i5.py (arguments --build)
It does the same on Linux and Windows and was working last week.