aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-05-12 14:24:18 +0100
committerGitHub <noreply@github.com>2020-05-12 14:24:18 +0100
commit2692c6f6cce41d22847058c85715e8822feb9b87 (patch)
tree07ca55608411c1cad1dc3cd93053d18afa051bd3 /ecp5
parente431d1a33fdabcd118557cc7a61f671a0d2d2599 (diff)
parent5b660e3432b3c127eab10185f132ecf0126cc510 (diff)
downloadnextpnr-2692c6f6cce41d22847058c85715e8822feb9b87.tar.gz
nextpnr-2692c6f6cce41d22847058c85715e8822feb9b87.tar.bz2
nextpnr-2692c6f6cce41d22847058c85715e8822feb9b87.zip
Merge pull request #437 from miek/lvcmos33d-drive
ecp5: Allow setting drive strength for LVCMOS33D IOs
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/bitstream.cc19
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");