aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-02-12 09:54:15 +0000
committerGitHub <noreply@github.com>2021-02-12 09:54:15 +0000
commitad7bb510303e2a3b03bb4a043e62f10a4a0498b2 (patch)
tree22567456921e3cba04ddea328979ab52b3b4fab1 /common
parent5dfbe703ae26e6af2a1a687c06f001b6788d6fc8 (diff)
parent96293ab25ea1adda3e0ead128312f3afd3ac4764 (diff)
downloadnextpnr-ad7bb510303e2a3b03bb4a043e62f10a4a0498b2.tar.gz
nextpnr-ad7bb510303e2a3b03bb4a043e62f10a4a0498b2.tar.bz2
nextpnr-ad7bb510303e2a3b03bb4a043e62f10a4a0498b2.zip
Merge pull request #580 from litghost/add_design_loaded_state_variable
Add design_loaded state variable.
Diffstat (limited to 'common')
-rw-r--r--common/command.cc2
-rw-r--r--common/nextpnr.h5
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 ddfcc794..26dcaac4 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()