From db0646be8ac646fc678b967b1bc656e721aa5f0e Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 31 Oct 2018 10:48:54 +0000 Subject: ecp5: Adding LPF parser Signed-off-by: David Shah --- ecp5/main.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ecp5/main.cc') 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 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(), "select device package (defaults to CABGA381)"); specific.add_options()("basecfg", po::value(), "base chip configuration in Trellis text format"); specific.add_options()("textcfg", po::value(), "textual configuration in Trellis format to write"); + + specific.add_options()("lpf", po::value>(), "LPF pin constraint file(s)"); + return specific; } void ECP5CommandHandler::validate() @@ -111,6 +116,17 @@ std::unique_ptr ECP5CommandHandler::createContext() return std::unique_ptr(new Context(chipArgs)); } +void ECP5CommandHandler::customAfterLoad(Context *ctx) +{ + if (vm.count("lpf")) { + std::vector files = vm["lpf"].as>(); + for (const auto &filename : files) { + std::ifstream in(filename); + ctx->applyLPF(filename, in); + } + } +} + int main(int argc, char *argv[]) { ECP5CommandHandler handler(argc, argv); -- cgit v1.2.3