From 8624a48bcf8912966aea2b1d72ae96ea4d1e4fba Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 16 Jul 2026 12:10:35 +0200 Subject: [PATCH] ecp5: Make fabric routed ECLK an error Signed-off-by: gatecat --- ecp5/globals.cc | 9 ++++++++- ecp5/main.cc | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ecp5/globals.cc b/ecp5/globals.cc index 4a439eaf..7c13a734 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -671,7 +671,14 @@ class Ecp5GlobalRouter cursor = ctx->getPipDstWire(pip); } } else { - log_info(" no route found, general routing will be used.\n"); + if (bool_or_default(ctx->settings, ctx->id("arch.fabric_eclk"))) { + log_info(" no route found, general routing will be used.\n"); + } else { + log_error("Unable to route edge clock source '%s' to pin '%s.%s' using dedicated routing.\n" + "Use --allow-fabric-eclk to use fabric routing with indeterminate skew, or " + "consider using an ECLKBRIDGECS to cross the device.\n", + ctx->nameOf(ni), ctx->nameOf(ci), ctx->nameOf(pin)); + } } } } diff --git a/ecp5/main.cc b/ecp5/main.cc index c08cebb1..1501efb5 100644 --- a/ecp5/main.cc +++ b/ecp5/main.cc @@ -86,6 +86,8 @@ po::options_description ECP5CommandHandler::getArchOptions() "disable IO buffer insertion and global promotion/routing, for building pre-routed blocks (experimental)"); specific.add_options()("disable-router-lutperm", "don't allow the router to permute LUT inputs"); + specific.add_options()("allow-fabric-eclk", "allow fabric routing of ECLKs"); + return specific; } void ECP5CommandHandler::validate() @@ -258,6 +260,8 @@ std::unique_ptr ECP5CommandHandler::createContext(dictsettings[ctx->id("arch.ooc")] = 1; if (vm.count("disable-router-lutperm")) ctx->settings[ctx->id("arch.disable_router_lutperm")] = 1; + if (vm.count("allow-fabric-eclk")) + ctx->settings[ctx->id("arch.fabric_eclk")] = 1; return ctx; }