From 5fb3353557853178c2787ea8a80afddf5ace8a4d Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Fri, 16 Nov 2018 22:55:57 +0100 Subject: [PATCH] ice40/pack: Allow PLL to be constrained via 'BEL' attributes Signed-off-by: Sylvain Munaut --- ice40/pack.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ice40/pack.cc b/ice40/pack.cc index d0142fa3..c7614830 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -886,6 +886,16 @@ static void pack_special(Context *ctx) log_error("Could not constrain PLL '%s' to any PLL Bel (too many PLLs?)\n", packed->name.c_str(ctx)); } + } else { + pll_bel = ctx->getBelByName(ctx->id(packed->attrs[ctx->id("BEL")])); + if (ctx->getBelType(pll_bel) != id_ICESTORM_PLL) + log_error("PLL '%s' is constrained to BEL %s which isn't a ICESTORM_PLL BEL\n", + packed->name.c_str(ctx), ctx->getBelName(pll_bel).c_str(ctx)); + if (ctx->isBelLocked(pll_bel)) + log_error("PLL '%s' is constrained to locked BEL %s\n", packed->name.c_str(ctx), + ctx->getBelName(pll_bel).c_str(ctx)); + log_info(" constrained PLL '%s' to %s\n", packed->name.c_str(ctx), + ctx->getBelName(pll_bel).c_str(ctx)); } // Delete the original PACKAGEPIN net if needed.