diff options
author | David Shah <dave@ds0.me> | 2020-02-15 23:34:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-15 23:34:50 +0000 |
commit | affb12cc27ebf409eade062c4c59bb98569d8147 (patch) | |
tree | 4d79e9dcc6b476e8b88023ca3244ae23fea6ec5a /common/command.cc | |
parent | e0b4f0ee63072f0e5aa86b4fa9ca1f488ae57790 (diff) | |
parent | b6158f94f6e83e7fac67c678effd21ec932cd0c2 (diff) | |
download | nextpnr-affb12cc27ebf409eade062c4c59bb98569d8147.tar.gz nextpnr-affb12cc27ebf409eade062c4c59bb98569d8147.tar.bz2 nextpnr-affb12cc27ebf409eade062c4c59bb98569d8147.zip |
Merge pull request #398 from YosysHQ/svg
svg: Basic SVG graphics rendering
Diffstat (limited to 'common/command.cc')
-rw-r--r-- | common/command.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/command.cc b/common/command.cc index f652ce67..7b4805ae 100644 --- a/common/command.cc +++ b/common/command.cc @@ -158,6 +158,9 @@ po::options_description CommandHandler::getGeneralOptions() general.add_options()("sdf", po::value<std::string>(), "SDF delay back-annotation file to write"); general.add_options()("sdf-cvc", "enable tweaks for SDF file compatibility with the CVC simulator"); + general.add_options()("placed-svg", po::value<std::string>(), "write render of placement to SVG file"); + general.add_options()("routed-svg", po::value<std::string>(), "write render of routing to SVG file"); + return general; } @@ -336,6 +339,8 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx) if (!ctx->place() && !ctx->force) log_error("Placing design failed.\n"); ctx->check(); + if (vm.count("placed-svg")) + ctx->writeSVG(vm["placed-svg"].as<std::string>(), "scale=50 hide_routing"); } if (do_route) { @@ -343,6 +348,8 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx) if (!ctx->route() && !ctx->force) log_error("Routing design failed.\n"); run_script_hook("post-route"); + if (vm.count("routed-svg")) + ctx->writeSVG(vm["routed-svg"].as<std::string>(), "scale=500"); } customBitstream(ctx.get()); |