diff options
author | David Shah <dave@ds0.me> | 2020-10-12 11:19:31 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-11-30 08:45:27 +0000 |
commit | 69b449c8759efa15f52add21b1c7f6dc1ceada3a (patch) | |
tree | df6a772408e62db64c8af5a0893a3224677ba17a /nexus/main.cc | |
parent | 12013b4c1f7a7fc653a06d1af8216680de468147 (diff) | |
download | nextpnr-69b449c8759efa15f52add21b1c7f6dc1ceada3a.tar.gz nextpnr-69b449c8759efa15f52add21b1c7f6dc1ceada3a.tar.bz2 nextpnr-69b449c8759efa15f52add21b1c7f6dc1ceada3a.zip |
nexus: Initial PDC parser integration
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/main.cc')
-rw-r--r-- | nexus/main.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/nexus/main.cc b/nexus/main.cc index 9549a573..83b22977 100644 --- a/nexus/main.cc +++ b/nexus/main.cc @@ -50,6 +50,7 @@ po::options_description NexusCommandHandler::getArchOptions() specific.add_options()("chipdb", po::value<std::string>(), "name of chip database binary"); specific.add_options()("device", po::value<std::string>(), "device name"); specific.add_options()("fasm", po::value<std::string>(), "fasm file to write"); + specific.add_options()("pdc", po::value<std::string>(), "physical constraints file"); return specific; } @@ -72,7 +73,16 @@ std::unique_ptr<Context> NexusCommandHandler::createContext(std::unordered_map<s return std::unique_ptr<Context>(new Context(chipArgs)); } -void NexusCommandHandler::customAfterLoad(Context *ctx) {} +void NexusCommandHandler::customAfterLoad(Context *ctx) +{ + if (vm.count("pdc")) { + std::string filename = vm["pdc"].as<std::string>(); + std::ifstream in(filename); + if (!in) + log_error("Failed to open input PDC file %s.\n", filename.c_str()); + ctx->read_pdc(in); + } +} int main(int argc, char *argv[]) { |