aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/bitstream.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-11-07 20:44:43 +0000
committerDavid Shah <dave@ds0.me>2018-11-15 11:30:27 +0000
commite9fe444dc7dd5bf09f50ef6c742a637f6bc24f41 (patch)
tree104c1cafa0df1f91b90ab039bbb79cddacb5824e /ecp5/bitstream.cc
parent37cbabecfbd22119ad5ba0adfc4d7011831a9af4 (diff)
downloadnextpnr-e9fe444dc7dd5bf09f50ef6c742a637f6bc24f41.tar.gz
nextpnr-e9fe444dc7dd5bf09f50ef6c742a637f6bc24f41.tar.bz2
nextpnr-e9fe444dc7dd5bf09f50ef6c742a637f6bc24f41.zip
ecp5: Adding ancillary DCU bels
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/bitstream.cc')
-rw-r--r--ecp5/bitstream.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc
index 00486e39..2df0ed0b 100644
--- a/ecp5/bitstream.cc
+++ b/ecp5/bitstream.cc
@@ -514,6 +514,12 @@ static std::vector<bool> parse_config_str(std::string str, int length)
for (int i = 0; i < length; i++)
if (value & (1 << i))
word.at(i) = true;
+ } else {
+ NPNR_ASSERT(length < 64);
+ unsigned long long value = std::stoull(str);
+ for (int i = 0; i < length; i++)
+ if (value & (1 << i))
+ word.at(i) = true;
}
return word;
}
@@ -1078,6 +1084,17 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
#include "dcu_bitstream.h"
cc.tilegroups.push_back(tg);
tieoff_dcu_ports(ctx, cc, ci);
+ } else if (ci->type == id_EXTREFB) {
+ TileGroup tg;
+ tg.tiles = get_dcu_tiles(ctx, ci->bel);
+ tg.config.add_word("EXTREF.REFCK_DCBIAS_EN", parse_config_str(str_or_default(ci->params, ctx->id("REFCK_DCBIAS_EN"), "0"), 1));
+ tg.config.add_word("EXTREF.REFCK_RTERM", parse_config_str(str_or_default(ci->params, ctx->id("REFCK_RTERM"), "0"), 1));
+ tg.config.add_word("EXTREF.REFCK_PWDNB", parse_config_str(str_or_default(ci->params, ctx->id("REFCK_PWDNB"), "0"), 1));
+ cc.tilegroups.push_back(tg);
+ } else if (ci->type == id_PCSCLKDIV) {
+ Loc loc = ctx->getBelLocation(ci->bel);
+ std::string tname = ctx->getTileByTypeAndLocation(loc.y+1, loc.x, "BMID_0H");
+ cc.tiles[tname].add_enum("PCSCLKDIV" + std::to_string(loc.z), str_or_default(ci->params, ctx->id("GSR"), "ENABLED"));
} else {
NPNR_ASSERT_FALSE("unsupported cell type");
}