From 96293ab25ea1adda3e0ead128312f3afd3ac4764 Mon Sep 17 00:00:00 2001 From: Keith Rothman <537074+litghost@users.noreply.github.com> Date: Thu, 11 Feb 2021 13:41:13 -0800 Subject: 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> --- common/command.cc | 2 +- common/nextpnr.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'common') 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 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; @@ -853,6 +856,8 @@ struct BaseCtx wildcard.id.index = 0; wildcard.type = TimingConstraintObject::ANYTHING; constraintObjects.push_back(wildcard); + + design_loaded = false; } virtual ~BaseCtx() -- cgit v1.2.3