diff options
author | David Shah <davey1576@gmail.com> | 2018-12-25 21:01:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-25 21:01:01 +0000 |
commit | 6c01f9b4ac5321a56d7deaf94bca28c5a2457caa (patch) | |
tree | 7c99eeb07e35d3cc0c2418400f2b206fcc63ccf2 /ecp5/pack.cc | |
parent | e76479f379e4ba15b8f788cfb171c0de10feb076 (diff) | |
parent | 1661350d2515a871a25d293e90f2315cb820b2be (diff) | |
download | nextpnr-6c01f9b4ac5321a56d7deaf94bca28c5a2457caa.tar.gz nextpnr-6c01f9b4ac5321a56d7deaf94bca28c5a2457caa.tar.bz2 nextpnr-6c01f9b4ac5321a56d7deaf94bca28c5a2457caa.zip |
Merge pull request #195 from YosysHQ/fix_194
ecp5: Check for incorrect use of TRELLIS_IO 'B' pin
Diffstat (limited to 'ecp5/pack.cc')
-rw-r--r-- | ecp5/pack.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc index cc91ca0e..84fce1c7 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -299,7 +299,16 @@ class Ecp5Packer // iobuf log_info("%s feeds TRELLIS_IO %s, removing %s %s.\n", ci->name.c_str(ctx), trio->name.c_str(ctx), ci->type.c_str(ctx), ci->name.c_str(ctx)); + NetInfo *net = trio->ports.at(ctx->id("B")).net; + if (((ci->type == ctx->id("$nextpnr_ibuf") || ci->type == ctx->id("$nextpnr_iobuf")) && + net->users.size() > 1) || + (ci->type == ctx->id("$nextpnr_obuf") && + (net->users.size() > 2 || net->driver.cell != nullptr)) || + (ci->type == ctx->id("$nextpnr_iobuf") && ci->ports.at(ctx->id("I")).net != nullptr && + ci->ports.at(ctx->id("I")).net->driver.cell != nullptr)) + log_error("Pin B of %s '%s' connected to more than a single top level IO.\n", + trio->type.c_str(ctx), trio->name.c_str(ctx)); if (net != nullptr) { ctx->nets.erase(net->name); trio->ports.at(ctx->id("B")).net = nullptr; |