aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/main.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-10-31 10:48:54 +0000
committerDavid Shah <dave@ds0.me>2018-10-31 10:48:54 +0000
commitdb0646be8ac646fc678b967b1bc656e721aa5f0e (patch)
tree8c008858c5fe14a25bf16a6c0b9e42b07fda0f3e /ecp5/main.cc
parentaf9ed378b49b19abcc2a8e4aa8877f5f1f0e0984 (diff)
downloadnextpnr-db0646be8ac646fc678b967b1bc656e721aa5f0e.tar.gz
nextpnr-db0646be8ac646fc678b967b1bc656e721aa5f0e.tar.bz2
nextpnr-db0646be8ac646fc678b967b1bc656e721aa5f0e.zip
ecp5: Adding LPF parser
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5/main.cc')
-rw-r--r--ecp5/main.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/ecp5/main.cc b/ecp5/main.cc
index e71b0983..c444f96f 100644
--- a/ecp5/main.cc
+++ b/ecp5/main.cc
@@ -35,6 +35,7 @@ class ECP5CommandHandler : public CommandHandler
virtual ~ECP5CommandHandler(){};
std::unique_ptr<Context> createContext() override;
void setupArchContext(Context *ctx) override{};
+ void customAfterLoad(Context *ctx) override;
void validate() override;
void customBitstream(Context *ctx) override;
@@ -56,9 +57,13 @@ po::options_description ECP5CommandHandler::getArchOptions()
specific.add_options()("um5g-25k", "set device type to LFE5UM5G-25F");
specific.add_options()("um5g-45k", "set device type to LFE5UM5G-45F");
specific.add_options()("um5g-85k", "set device type to LFE5UM5G-85F");
+
specific.add_options()("package", po::value<std::string>(), "select device package (defaults to CABGA381)");
specific.add_options()("basecfg", po::value<std::string>(), "base chip configuration in Trellis text format");
specific.add_options()("textcfg", po::value<std::string>(), "textual configuration in Trellis format to write");
+
+ specific.add_options()("lpf", po::value<std::vector<std::string>>(), "LPF pin constraint file(s)");
+
return specific;
}
void ECP5CommandHandler::validate()
@@ -111,6 +116,17 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext()
return std::unique_ptr<Context>(new Context(chipArgs));
}
+void ECP5CommandHandler::customAfterLoad(Context *ctx)
+{
+ if (vm.count("lpf")) {
+ std::vector<std::string> files = vm["lpf"].as<std::vector<std::string>>();
+ for (const auto &filename : files) {
+ std::ifstream in(filename);
+ ctx->applyLPF(filename, in);
+ }
+ }
+}
+
int main(int argc, char *argv[])
{
ECP5CommandHandler handler(argc, argv);