From 535fc953d44ad67692f7ac5bf3600d36d6bf57dc Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 29 Nov 2018 21:12:56 +0100 Subject: [PATCH] Use site x location to determine if it is one block or other --- xc7/arch.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xc7/arch.cc b/xc7/arch.cc index adf38207..46a2bdd9 100644 --- a/xc7/arch.cc +++ b/xc7/arch.cc @@ -80,9 +80,10 @@ TorcInfo::TorcInfo(BaseCtx *ctx, const std::string &inDeviceName, const std::str bel_to_site_index.push_back(i); site_index_to_type[i] = id_SLICE_LUT6; const auto site_name = site.getName(); - const auto site_name_back = site_name.back(); - if (site_name_back == '0' || site_name_back == '2' || site_name_back == '4' || site_name_back == '6' || - site_name_back == '8') { + if (!boost::regex_match(site_name.c_str(), what, re_loc)) + throw; + const auto sx = boost::lexical_cast(what.str(1)); + if ((sx & 1) == 0) { bel_to_loc.emplace_back(x, y, 0); bel_to_loc.emplace_back(x, y, 1); bel_to_loc.emplace_back(x, y, 2);