Skip to content

Commit

Permalink
Merge pull request #1583 from lnis-uofu/victor_OpenFPGA_dbg
Browse files Browse the repository at this point in the history
Support checking illegal pin constraint
  • Loading branch information
tangxifan authored Mar 5, 2024
2 parents ad05b48 + c48fb35 commit 0351e51
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions libs/libpcf/src/base/pcf2place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ int pcf2place(const PcfData& pcf_data,
VTR_LOG("PCF basic check passed\n");
}

/* Map from location to net */
std::map<std::array<size_t, 3>, std::string> net_map;
/* Build the I/O place */
for (const PcfIoConstraintId& io_id : pcf_data.io_constraints()) {
/* Find the net name */
Expand Down Expand Up @@ -102,6 +104,20 @@ int pcf2place(const PcfData& pcf_data,
continue;
}

std::array<size_t, 3> loc = {x, y, z};
auto itr = net_map.find(loc);
if (itr == net_map.end()) {
net_map.insert({loc, net});
} else {
VTR_LOG_ERROR(
"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;
}

/* Add a fixed prefix to net namei, this is hard coded by VPR */
if (IoPinTable::OUTPUT == pin_direction) {
net = "out:" + net;
Expand Down

0 comments on commit 0351e51

Please sign in to comment.