From 39a012b939aaf2c89ab0b85d18ec90fb07f2c445 Mon Sep 17 00:00:00 2001 From: Victor Date: Mon, 4 Mar 2024 12:41:19 +0800 Subject: [PATCH] Support checking illegal pin constraint (use loc as key and update message format) --- libs/libpcf/src/base/pcf2place.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/libpcf/src/base/pcf2place.cpp b/libs/libpcf/src/base/pcf2place.cpp index 3f5507736..539aa0a37 100644 --- a/libs/libpcf/src/base/pcf2place.cpp +++ b/libs/libpcf/src/base/pcf2place.cpp @@ -41,8 +41,8 @@ int pcf2place(const PcfData& pcf_data, VTR_LOG("PCF basic check passed\n"); } - /* Map from internal pin lsb to net */ - std::map net_map; + /* Map from location to net */ + std::map, std::string> net_map; /* Build the I/O place */ for (const PcfIoConstraintId& io_id : pcf_data.io_constraints()) { /* Find the net name */ @@ -104,15 +104,16 @@ int pcf2place(const PcfData& pcf_data, continue; } - size_t lsb = int_pin.get_lsb(); - auto itr = net_map.find(lsb); + std::array loc = {x, y, z}; + auto itr = net_map.find(loc); if (itr == net_map.end()) { - net_map.insert({lsb, net}); + net_map.insert({loc, net}); } else { VTR_LOG_ERROR( - "Illegal pin constraint: FPGA IO pin is assigned to two design pins: " - "%s and %s.\n", - itr->second.c_str(), net.c_str()); + "Illegal pin constraint: Two nets '%s' and '%s' are mapped to the I/O " + "pin '%s[%lu]' which belongs to the same coordinate (%ld, %ld, %ld)!\n", + itr->second.c_str(), net.c_str(), int_pin.get_name().c_str(), + int_pin.get_lsb(), x, y, z); num_err++; continue; }