aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorKarol Gugala <kgugala@antmicro.com>2021-12-20 14:33:29 +0100
committerKarol Gugala <kgugala@antmicro.com>2021-12-20 15:09:03 +0100
commit500fa6f4423ac016559f6140c8141da376d2833b (patch)
treed5543c612a40337dc8473754885aafecad8dcf8b /nexus
parent62a3e093856063180526b7189d5e711a98036fa0 (diff)
downloadnextpnr-500fa6f4423ac016559f6140c8141da376d2833b.tar.gz
nextpnr-500fa6f4423ac016559f6140c8141da376d2833b.tar.bz2
nextpnr-500fa6f4423ac016559f6140c8141da376d2833b.zip
nexus: handle SLEWRATE in pdc
Diffstat (limited to 'nexus')
-rw-r--r--nexus/constids.inc1
-rw-r--r--nexus/fasm.cc4
-rw-r--r--nexus/pdc.cc7
3 files changed, 10 insertions, 2 deletions
diff --git a/nexus/constids.inc b/nexus/constids.inc
index 48b0ca2b..ca6bed5a 100644
--- a/nexus/constids.inc
+++ b/nexus/constids.inc
@@ -109,6 +109,7 @@ X(CIB_T)
X(CIB_LR)
X(IO_TYPE)
+X(SLEWRATE)
X(OSCA)
diff --git a/nexus/fasm.cc b/nexus/fasm.cc
index bb0a7941..4aaecdf4 100644
--- a/nexus/fasm.cc
+++ b/nexus/fasm.cc
@@ -433,7 +433,7 @@ struct NexusFasmWriter
write_bit(stringf("BASE_TYPE.%s_%s", iodir, str_or_default(cell->attrs, id_IO_TYPE, "LVCMOS33").c_str()));
write_ioattr(cell, "PULLMODE", "NONE");
write_ioattr(cell, "GLITCHFILTER", "OFF");
- write_ioattr(cell, "SLEWRATE", "MED");
+ write_ioattr(cell, "SLEWRATE", str_or_default(cell->attrs, id_SLEWRATE, "MED").c_str());
write_cell_muxes(cell);
pop();
}
@@ -458,7 +458,7 @@ struct NexusFasmWriter
const char *iodir = is_input ? "INPUT" : (is_output ? "OUTPUT" : "BIDIR");
write_bit(stringf("BASE_TYPE.%s_%s", iodir, str_or_default(cell->attrs, id_IO_TYPE, "LVCMOS18H").c_str()));
write_ioattr(cell, "PULLMODE", "NONE");
- write_ioattr(cell, "SLEWRATE", "MED");
+ write_ioattr(cell, "SLEWRATE", str_or_default(cell->attrs, id_SLEWRATE, "MED").c_str());
pop();
write_cell_muxes(cell);
pop();
diff --git a/nexus/pdc.cc b/nexus/pdc.cc
index 67bab3c9..af622158 100644
--- a/nexus/pdc.cc
+++ b/nexus/pdc.cc
@@ -21,6 +21,7 @@
#include "log.h"
#include "nextpnr.h"
+#include <algorithm>
#include <iterator>
NEXTPNR_NAMESPACE_BEGIN
@@ -423,6 +424,12 @@ struct PDCParser
if (eqp == std::string::npos)
log_error("expected key-value pair separated by '=' (line %d)", lineno);
std::string k = kv.substr(0, eqp), v = kv.substr(eqp + 1);
+ if (k == "SLEWRATE") {
+ std::vector<std::string> slewrate_allowed = {"SLOW", "MED", "FAST", "NA"};
+ if (std::find(std::begin(slewrate_allowed), std::end(slewrate_allowed), v) ==
+ std::end(slewrate_allowed))
+ log_error("unexpected SLEWRATE configuration %s (line %d)\n", v.c_str(), lineno);
+ }
args[ctx->id(k)] = v;
}
} else {