diff options
Diffstat (limited to 'ice40/arch.h')
-rw-r--r-- | ice40/arch.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ice40/arch.h b/ice40/arch.h index 77d3c3b1..123b408c 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -742,6 +742,18 @@ struct Arch : BaseCtx IdString id_cin, id_cout; IdString id_o, id_lo; IdString id_icestorm_ram, id_rclk, id_wclk; + + // ------------------------------------------------- + BelPin getIOBSharingPLLPin(BelId pll, PortPin pll_pin) const + { + auto wire = getBelPinWire(pll, pll_pin); + for (auto src_bel : getWireBelPins(wire)) { + if (getBelType(src_bel.bel) == TYPE_SB_IO && src_bel.pin == PIN_D_IN_0) { + return src_bel; + } + } + NPNR_ASSERT_FALSE("Expected PLL pin to share an output with an SB_IO D_IN_{0,1}"); + } }; NEXTPNR_NAMESPACE_END |