aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/bitstream.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-12-16 17:05:01 +0000
committerGitHub <noreply@github.com>2018-12-16 17:05:01 +0000
commit0a494fa66cb6e1ca1773e40fb887efeab0574ac8 (patch)
tree0a493caf433ae29f0557f507b37501a62fc9fa1d /ecp5/bitstream.cc
parent15f4702cfdb71b88bd51fac01cef17165175c42b (diff)
parentd75075e15c9140c768cc5b5693a284ff35a648be (diff)
downloadnextpnr-0a494fa66cb6e1ca1773e40fb887efeab0574ac8.tar.gz
nextpnr-0a494fa66cb6e1ca1773e40fb887efeab0574ac8.tar.bz2
nextpnr-0a494fa66cb6e1ca1773e40fb887efeab0574ac8.zip
Merge pull request #181 from YosysHQ/ecp5_iologic
ecp5: Adding DDR input/output support
Diffstat (limited to 'ecp5/bitstream.cc')
-rw-r--r--ecp5/bitstream.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc
index df16946d..5031dab8 100644
--- a/ecp5/bitstream.cc
+++ b/ecp5/bitstream.cc
@@ -745,6 +745,12 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
}
if (ci->attrs.count(ctx->id("SLEWRATE")))
cc.tiles[pio_tile].add_enum(pio + ".SLEWRATE", str_or_default(ci->attrs, ctx->id("SLEWRATE"), "SLOW"));
+ std::string datamux_oddr = str_or_default(ci->params, ctx->id("DATAMUX_ODDR"), "PADDO");
+ if (datamux_oddr != "PADDO")
+ cc.tiles[pic_tile].add_enum(pio + ".DATAMUX_ODDR", datamux_oddr);
+ std::string datamux_mddr = str_or_default(ci->params, ctx->id("DATAMUX_MDDR"), "PADDO");
+ if (datamux_mddr != "PADDO")
+ cc.tiles[pic_tile].add_enum(pio + ".DATAMUX_MDDR", datamux_mddr);
} else if (ci->type == ctx->id("DCCA")) {
// Nothing to do
} else if (ci->type == ctx->id("DP16KD")) {
@@ -1078,6 +1084,18 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
int_to_bitvector(int_or_default(ci->attrs, ctx->id("MFG_ENABLE_FILTEROPAMP"), 0), 1));
cc.tilegroups.push_back(tg);
+ } else if (ci->type == id_IOLOGIC || ci->type == id_SIOLOGIC) {
+ Loc pio_loc = ctx->getBelLocation(ci->bel);
+ pio_loc.z -= ci->type == id_SIOLOGIC ? 2 : 4;
+ std::string pic_tile = get_pic_tile(ctx, ctx->getBelByLocation(pio_loc));
+ std::string prim = std::string("IOLOGIC") + "ABCD"[pio_loc.z];
+ for (auto &param : ci->params) {
+ if (param.first == ctx->id("DELAY.DEL_VALUE"))
+ cc.tiles[pic_tile].add_word(prim + "." + param.first.str(ctx),
+ int_to_bitvector(std::stoi(param.second), 7));
+ else
+ cc.tiles[pic_tile].add_enum(prim + "." + param.first.str(ctx), param.second);
+ }
} else if (ci->type == id_DCUA) {
TileGroup tg;
tg.tiles = get_dcu_tiles(ctx, ci->bel);