diff options
-rw-r--r-- | common/command.cc | 2 | ||||
-rw-r--r-- | common/nextpnr.h | 5 | ||||
-rw-r--r-- | frontend/frontend_base.h | 2 |
3 files changed, 8 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() diff --git a/frontend/frontend_base.h b/frontend/frontend_base.h index e262c943..4f7d22ec 100644 --- a/frontend/frontend_base.h +++ b/frontend/frontend_base.h @@ -135,6 +135,8 @@ template <typename FrontendType> struct GenericFrontend ctx->top_module = top; // Do the actual import, starting from the top level module import_module(m, top.str(ctx), top.str(ctx), mod_refs.at(top)); + + ctx->design_loaded = true; } Context *ctx; |