diff options
author | David Shah <dave@ds0.me> | 2020-01-09 19:02:01 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-11-30 08:45:27 +0000 |
commit | eb15463406c5784f7c3599163ba40571188d57c7 (patch) | |
tree | 89a23932dfbac1abb06e77c00fd6dce3e7fa7a82 /nexus/main.cc | |
parent | 8e53b35fcc9aad873225b90405d0d509cbb6e869 (diff) | |
download | nextpnr-eb15463406c5784f7c3599163ba40571188d57c7.tar.gz nextpnr-eb15463406c5784f7c3599163ba40571188d57c7.tar.bz2 nextpnr-eb15463406c5784f7c3599163ba40571188d57c7.zip |
nexus: Add routing FASM export
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/main.cc')
-rw-r--r-- | nexus/main.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nexus/main.cc b/nexus/main.cc index 77f739a8..9549a573 100644 --- a/nexus/main.cc +++ b/nexus/main.cc @@ -49,11 +49,20 @@ po::options_description NexusCommandHandler::getArchOptions() po::options_description specific("Architecture specific options"); 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"); return specific; } -void NexusCommandHandler::customBitstream(Context *ctx) {} +void NexusCommandHandler::customBitstream(Context *ctx) +{ + if (vm.count("fasm")) { + std::string filename = vm["fasm"].as<std::string>(); + std::ofstream out(filename); + if (!out) + log_error("Failed to open output FASM file %s.\n", filename.c_str()); + ctx->write_fasm(out); + } +} std::unique_ptr<Context> NexusCommandHandler::createContext(std::unordered_map<std::string, Property> &values) { |