aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-03-17 10:07:29 +0000
committerDavid Shah <dave@ds0.me>2020-03-17 10:07:29 +0000
commitd20ce45c1b59ad1485c2299234c4dd8d1dec35f3 (patch)
tree07b6cecfdbd926beb41292e7bfe0e56615bda471 /ecp5
parent564f40f6dbda8726fe1abd1f5e66fdc6fd74035c (diff)
parent54b15ed20100523199885685c4557f160fbf56a0 (diff)
downloadnextpnr-d20ce45c1b59ad1485c2299234c4dd8d1dec35f3.tar.gz
nextpnr-d20ce45c1b59ad1485c2299234c4dd8d1dec35f3.tar.bz2
nextpnr-d20ce45c1b59ad1485c2299234c4dd8d1dec35f3.zip
Merge branch 'master' of ssh.github.com:YosysHQ/nextpnr
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/bitstream.cc7
-rw-r--r--ecp5/cells.cc17
2 files changed, 22 insertions, 2 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc
index bc8a6c55..1bdb4188 100644
--- a/ecp5/bitstream.cc
+++ b/ecp5/bitstream.cc
@@ -650,7 +650,7 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
}
// Find bank voltages
std::unordered_map<int, IOVoltage> bankVcc;
- std::unordered_map<int, bool> bankLvds, bankVref;
+ std::unordered_map<int, bool> bankLvds, bankVref, bankDiff;
for (auto &cell : ctx->cells) {
CellInfo *ci = cell.second.get();
@@ -675,6 +675,8 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
if (iotype == "LVDS")
bankLvds[bank] = true;
+ if ((dir == "INPUT" || dir == "BIDIR") && is_differential(ioType_from_str(iotype)))
+ bankDiff[bank] = true;
if ((dir == "INPUT" || dir == "BIDIR") && is_referenced(ioType_from_str(iotype)))
bankVref[bank] = true;
}
@@ -698,6 +700,9 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
cc.tiles[tile.first].add_enum("BANK.DIFF_REF", "ON");
cc.tiles[tile.first].add_enum("BANK.LVDSO", "ON");
}
+ if (bankDiff[bank]) {
+ cc.tiles[tile.first].add_enum("BANK.DIFF_REF", "ON");
+ }
if (bankVref[bank]) {
cc.tiles[tile.first].add_enum("BANK.DIFF_REF", "ON");
cc.tiles[tile.first].add_enum("BANK.VREF", "ON");
diff --git a/ecp5/cells.cc b/ecp5/cells.cc
index c630c2c3..7f9f1579 100644
--- a/ecp5/cells.cc
+++ b/ecp5/cells.cc
@@ -432,7 +432,13 @@ void nxio_to_tr(Context *ctx, CellInfo *nxio, CellInfo *trio, std::vector<std::u
replace_port(nxio, ctx->id("I"), trio, ctx->id("I"));
} else if (nxio->type == ctx->id("$nextpnr_iobuf")) {
// N.B. tristate will be dealt with below
- trio->params[ctx->id("DIR")] = std::string("BIDIR");
+ NetInfo *i = get_net_or_empty(nxio, ctx->id("I"));
+ if (i == nullptr || i->driver.cell == nullptr)
+ trio->params[ctx->id("DIR")] = std::string("INPUT");
+ else {
+ log_info("%s: %s.%s\n", ctx->nameOf(i), ctx->nameOf(i->driver.cell), ctx->nameOf(i->driver.port));
+ trio->params[ctx->id("DIR")] = std::string("BIDIR");
+ }
replace_port(nxio, ctx->id("I"), trio, ctx->id("I"));
replace_port(nxio, ctx->id("O"), trio, ctx->id("O"));
} else {
@@ -446,6 +452,15 @@ void nxio_to_tr(Context *ctx, CellInfo *nxio, CellInfo *trio, std::vector<std::u
if (dinet != nullptr && dinet->name == nxio->name)
rename_net(ctx, dinet, ctx->id(dinet->name.str(ctx) + "$TRELLIS_IO_IN"));
+ if (ctx->nets.count(nxio->name)) {
+ int i = 0;
+ IdString new_name;
+ do {
+ new_name = ctx->id(nxio->name.str(ctx) + "$rename$" + std::to_string(i++));
+ } while (ctx->nets.count(new_name));
+ rename_net(ctx, ctx->nets.at(nxio->name).get(), new_name);
+ }
+
// Create a new top port net for accurate IO timing analysis and simulation netlists
if (ctx->ports.count(nxio->name)) {
IdString tn_netname = nxio->name;