diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-11 13:41:13 -0800 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-02-11 13:43:23 -0800 |
commit | 96293ab25ea1adda3e0ead128312f3afd3ac4764 (patch) | |
tree | 379447d5b7f2769175b3ac39733e372198a228ac /common | |
parent | e376f950fe683b9a744437301a9e09eae1895efa (diff) | |
download | nextpnr-96293ab25ea1adda3e0ead128312f3afd3ac4764.tar.gz nextpnr-96293ab25ea1adda3e0ead128312f3afd3ac4764.tar.bz2 nextpnr-96293ab25ea1adda3e0ead128312f3afd3ac4764.zip |
Add design_loaded state variable.
This is to decouple the command line flag "--json" and enable other
frontend's.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/command.cc | 2 | ||||
-rw-r--r-- | common/nextpnr.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/common/command.cc b/common/command.cc index 23572e02..d3e8af8d 100644 --- a/common/command.cc +++ b/common/command.cc @@ -331,7 +331,7 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx) execute_python_file(filename.c_str()); } else #endif - if (vm.count("json")) { + if (ctx->design_loaded) { bool do_pack = vm.count("pack-only") != 0 || vm.count("no-pack") == 0; bool do_place = vm.count("pack-only") == 0 && vm.count("no-place") == 0; bool do_route = vm.count("pack-only") == 0 && vm.count("no-route") == 0; diff --git a/common/nextpnr.h b/common/nextpnr.h index c43b9dc4..0b91c27d 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -842,6 +842,9 @@ struct BaseCtx Context *as_ctx = nullptr; + // Has the frontend loaded a design? + bool design_loaded; + BaseCtx() { idstring_str_to_idx = new std::unordered_map<std::string, int>; @@ -853,6 +856,8 @@ struct BaseCtx wildcard.id.index = 0; wildcard.type = TimingConstraintObject::ANYTHING; constraintObjects.push_back(wildcard); + + design_loaded = false; } virtual ~BaseCtx() |