diff options
author | gatecat <gatecat@ds0.me> | 2021-08-14 13:48:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 13:48:55 +0100 |
commit | b0a4f1b86ee75191031e26c276b1c8b1545a18ad (patch) | |
tree | f15460b659d8c03e57619b9ecec9da553545c662 /ecp5 | |
parent | dd6376433154e008045695f5420469670b0c3a88 (diff) | |
parent | 200c57f475f549774184608580b4d80290aac21c (diff) | |
download | nextpnr-b0a4f1b86ee75191031e26c276b1c8b1545a18ad.tar.gz nextpnr-b0a4f1b86ee75191031e26c276b1c8b1545a18ad.tar.bz2 nextpnr-b0a4f1b86ee75191031e26c276b1c8b1545a18ad.zip |
Merge pull request #793 from gregdavill/ecp5_diff_od
ecp5: Enable OPENDRAIN on differential outputs
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/bitstream.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc index a544f2b7..a86f4678 100644 --- a/ecp5/bitstream.cc +++ b/ecp5/bitstream.cc @@ -975,8 +975,20 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex iovoltage_to_str(vccio).c_str(), ci->name.c_str(ctx)); } } - if (ci->attrs.count(ctx->id("OPENDRAIN"))) + if (ci->attrs.count(ctx->id("OPENDRAIN"))) { cc.tiles[pio_tile].add_enum(pio + ".OPENDRAIN", str_or_default(ci->attrs, ctx->id("OPENDRAIN"), "OFF")); + if (is_differential(ioType_from_str(iotype))) { + std::string other; + if (pio == "PIOA") + other = "PIOB"; + else if (pio == "PIOC") + other = "PIOD"; + else + log_error("cannot set OPENDRAIN on differential IO at location %s\n", pio.c_str()); + cc.tiles[pio_tile].add_enum(other + ".OPENDRAIN", str_or_default(ci->attrs, ctx->id("OPENDRAIN"), "OFF")); + } + } + 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); |