From cde7a130d3aac91dba124f10c090e681726bcd2a Mon Sep 17 00:00:00 2001 From: tangxifan Date: Thu, 28 Jul 2022 14:25:54 -0700 Subject: [PATCH] [lib] fixed a bug --- libopenfpga/libpcf/src/base/io_location_map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libopenfpga/libpcf/src/base/io_location_map.cpp b/libopenfpga/libpcf/src/base/io_location_map.cpp index ea6d2f4a6..e34326331 100644 --- a/libopenfpga/libpcf/src/base/io_location_map.cpp +++ b/libopenfpga/libpcf/src/base/io_location_map.cpp @@ -80,8 +80,8 @@ void IoLocationMap::set_io_index(const size_t& x, std::array coord = {x, y, z}; BasicPort port_to_add(io_port_name, io_index, io_index); auto result = io_indices_.find(coord); - if (result == io_indices_.end()) { - if (io_indices_.at(coord).end() == std::find(io_indices_.at(coord).begin(), io_indices_.at(coord).end(), port_to_add)) { + if (result != io_indices_.end()) { + if (io_indices_.at(coord).end() != std::find(io_indices_.at(coord).begin(), io_indices_.at(coord).end(), port_to_add)) { VTR_LOG_WARN("Attempt to add duplicated io '%s[%lu]' to coordinate (%lu, %lu, %lu)! Skip to save memory\n", io_port_name.c_str(), io_index, x, y, z);