aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/main.cc
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-11 14:24:49 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-12 10:31:04 -0800
commita0bd3131390567d1bd79c1ac19f663caff603445 (patch)
treec62b518c830e13b08e59b333497db01ee8687b0c /fpga_interchange/main.cc
parentcede6825859217e15a0d41cd4cc51b6129902aad (diff)
downloadnextpnr-a0bd3131390567d1bd79c1ac19f663caff603445.tar.gz
nextpnr-a0bd3131390567d1bd79c1ac19f663caff603445.tar.bz2
nextpnr-a0bd3131390567d1bd79c1ac19f663caff603445.zip
Add FPGA interchange XDC parser.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'fpga_interchange/main.cc')
-rw-r--r--fpga_interchange/main.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/fpga_interchange/main.cc b/fpga_interchange/main.cc
index 1f98b186..63e990e2 100644
--- a/fpga_interchange/main.cc
+++ b/fpga_interchange/main.cc
@@ -49,8 +49,10 @@ po::options_description FpgaInterchangeCommandHandler::getArchOptions()
{
po::options_description specific("Architecture specific options");
specific.add_options()("chipdb", po::value<std::string>(), "name of chip database binary");
- specific.add_options()("xdc", po::value<std::vector<std::string>>(), "XDC-style constraints file");
+ specific.add_options()("xdc", po::value<std::vector<std::string>>(), "XDC-style constraints file to read");
+ specific.add_options()("netlist", po::value<std::string>(), "FPGA interchange logical netlist to read");
specific.add_options()("phys", po::value<std::string>(), "FPGA interchange Physical netlist to write");
+ specific.add_options()("package", po::value<std::string>(), "Package to use");
return specific;
}
@@ -70,7 +72,23 @@ std::unique_ptr<Context> FpgaInterchangeCommandHandler::createContext(std::unord
log_error("chip database binary must be provided\n");
}
chipArgs.chipdb = vm["chipdb"].as<std::string>();
- return std::unique_ptr<Context>(new Context(chipArgs));
+ if (vm.count("package")) {
+ chipArgs.package = vm["package"].as<std::string>();
+ }
+
+ auto ctx = std::unique_ptr<Context>(new Context(chipArgs));
+
+ if (vm.count("netlist")) {
+ ctx->read_logical_netlist(vm["netlist"].as<std::string>());
+ }
+
+ if (vm.count("xdc")) {
+ for(auto & x : vm["xdc"].as<std::vector<std::string>>()) {
+ ctx->parse_xdc(x);
+ }
+ }
+
+ return ctx;
}
void FpgaInterchangeCommandHandler::customAfterLoad(Context *ctx) {}