diff options
author | Mike Walters <mike@flomp.net> | 2020-05-11 20:19:15 +0100 |
---|---|---|
committer | Mike Walters <mike@flomp.net> | 2020-05-12 14:19:37 +0100 |
commit | 5b660e3432b3c127eab10185f132ecf0126cc510 (patch) | |
tree | f2efb97ec1cfc9ad55c39e6d75fb15b39d6b77f7 /ecp5 | |
parent | 0faf07aac851692c523ea7824d6882245898c6e8 (diff) | |
download | nextpnr-5b660e3432b3c127eab10185f132ecf0126cc510.tar.gz nextpnr-5b660e3432b3c127eab10185f132ecf0126cc510.tar.bz2 nextpnr-5b660e3432b3c127eab10185f132ecf0126cc510.zip |
ecp5: Allow setting drive strength for LVCMOS33D IOs
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/bitstream.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc index dbab920b..542ee6ca 100644 --- a/ecp5/bitstream.cc +++ b/ecp5/bitstream.cc @@ -915,6 +915,25 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex static bool drive_3v3_warning_done = false; if (iotype == "LVCMOS33") { cc.tiles[pio_tile].add_enum(pio + ".DRIVE", str_or_default(ci->attrs, ctx->id("DRIVE"), "8")); + } else if (iotype == "LVCMOS33D") { + if (bel.location.y == 0) { + // Pseudo differential top IO + NPNR_ASSERT(dir == "OUTPUT"); + NPNR_ASSERT(pio == "PIOA"); + std::string cpio_tile = get_comp_pio_tile(ctx, bel); + cc.tiles[pio_tile].add_enum("PIOA.DRIVE", str_or_default(ci->attrs, ctx->id("DRIVE"), "12")); + cc.tiles[cpio_tile].add_enum("PIOB.DRIVE", str_or_default(ci->attrs, ctx->id("DRIVE"), "12")); + } else { + std::string other; + if (pio == "PIOA") + other = "PIOB"; + else if (pio == "PIOC") + other = "PIOD"; + else + log_error("cannot set DRIVE on differential IO at location %s\n", pio.c_str()); + cc.tiles[pio_tile].add_enum(pio + ".DRIVE", str_or_default(ci->attrs, ctx->id("DRIVE"), "12")); + cc.tiles[pio_tile].add_enum(other + ".DRIVE", str_or_default(ci->attrs, ctx->id("DRIVE"), "12")); + } } else { if (!drive_3v3_warning_done) log_warning("Trellis limitation: DRIVE can only be set on 3V3 IO pins.\n"); |