diff --git a/xc7/arch.cc b/xc7/arch.cc index 05d0841a..892fe1ec 100644 --- a/xc7/arch.cc +++ b/xc7/arch.cc @@ -235,9 +235,8 @@ WireId Arch::getBelPinWire(BelId bel, IdString pin) const { WireId ret; - auto site_index = torc_info->bel_to_site_index[bel.index]; auto pin_name = pin.str(this); - if (torc_info->site_index_to_type[site_index] == id_SLICE_LUT6) { + if (getBelType(bel) == id_SLICE_LUT6) { // For all LUT based inputs (I1-I6,O,OQ,OMUX) then change the I/O into the LUT if (pin_name[0] == 'I' || pin_name[0] == 'O') { switch (torc_info->bel_to_z[bel.index]) { @@ -249,6 +248,7 @@ WireId Arch::getBelPinWire(BelId bel, IdString pin) const } } } + auto site_index = torc_info->bel_to_site_index[bel.index]; auto &site = torc_info->sites.getSite(site_index); ret.index = site.getPinTilewire(pin_name); diff --git a/xc7/arch.h b/xc7/arch.h index 60039240..cb504016 100644 --- a/xc7/arch.h +++ b/xc7/arch.h @@ -449,8 +449,7 @@ struct Arch : BaseCtx { NPNR_ASSERT(bel != BelId()); auto name = torc_info->bel_to_name(bel.index); - auto site_index = torc_info->bel_to_site_index[bel.index]; - if (torc_info->site_index_to_type[site_index] == id_SLICE_LUT6) { + if (getBelType(bel) == id_SLICE_LUT6) { // Append LUT name to name name.reserve(name.size() + 2); name += "_";