From fffc3b844730d1241d0056f989b3a9492d62005c Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 12 Nov 2019 11:33:49 +0000 Subject: frontend/base: Top module handling Signed-off-by: David Shah --- common/command.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'common/command.cc') diff --git a/common/command.cc b/common/command.cc index fd310789..13cd3498 100644 --- a/common/command.cc +++ b/common/command.cc @@ -35,6 +35,7 @@ #include #include "command.h" #include "design_utils.h" +#include "frontend_base.h" #include "jsonparse.h" #include "jsonwrite.h" #include "log.h" -- cgit v1.2.3 From 9e6770af9086326b3d7c0cb29e8b144fb3578369 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 15 Nov 2019 17:59:42 +0000 Subject: command: Use new frontend experimentally Signed-off-by: David Shah --- common/command.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'common/command.cc') diff --git a/common/command.cc b/common/command.cc index 13cd3498..c75f91ef 100644 --- a/common/command.cc +++ b/common/command.cc @@ -35,7 +35,7 @@ #include #include "command.h" #include "design_utils.h" -#include "frontend_base.h" +#include "json_frontend.h" #include "jsonparse.h" #include "jsonwrite.h" #include "log.h" @@ -266,9 +266,13 @@ int CommandHandler::executeMain(std::unique_ptr ctx) if (vm.count("json")) { std::string filename = vm["json"].as(); std::ifstream f(filename); +#ifdef LEGACY_FRONTEND if (!parse_json_file(f, filename, w.getContext())) log_error("Loading design failed.\n"); - +#else + if (!parse_json(f, filename, w.getContext())) + log_error("Loading design failed.\n"); +#endif customAfterLoad(w.getContext()); w.notifyChangeContext(); w.updateActions(); @@ -285,8 +289,13 @@ int CommandHandler::executeMain(std::unique_ptr ctx) if (vm.count("json")) { std::string filename = vm["json"].as(); std::ifstream f(filename); +#ifdef LEGACY_FRONTEND if (!parse_json_file(f, filename, ctx.get())) log_error("Loading design failed.\n"); +#else + if (!parse_json(f, filename, ctx.get())) + log_error("Loading design failed.\n"); +#endif customAfterLoad(ctx.get()); } -- cgit v1.2.3 From 035bfb0fe501fe5b840e83acaf781f2dffef8513 Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 27 Nov 2019 12:11:18 +0000 Subject: json: Remove legacy frontend Signed-off-by: David Shah --- common/command.cc | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'common/command.cc') diff --git a/common/command.cc b/common/command.cc index c75f91ef..c2f02b27 100644 --- a/common/command.cc +++ b/common/command.cc @@ -36,7 +36,6 @@ #include "command.h" #include "design_utils.h" #include "json_frontend.h" -#include "jsonparse.h" #include "jsonwrite.h" #include "log.h" #include "timing.h" @@ -266,13 +265,8 @@ int CommandHandler::executeMain(std::unique_ptr ctx) if (vm.count("json")) { std::string filename = vm["json"].as(); std::ifstream f(filename); -#ifdef LEGACY_FRONTEND - if (!parse_json_file(f, filename, w.getContext())) - log_error("Loading design failed.\n"); -#else if (!parse_json(f, filename, w.getContext())) log_error("Loading design failed.\n"); -#endif customAfterLoad(w.getContext()); w.notifyChangeContext(); w.updateActions(); @@ -289,13 +283,8 @@ int CommandHandler::executeMain(std::unique_ptr ctx) if (vm.count("json")) { std::string filename = vm["json"].as(); std::ifstream f(filename); -#ifdef LEGACY_FRONTEND - if (!parse_json_file(f, filename, ctx.get())) - log_error("Loading design failed.\n"); -#else if (!parse_json(f, filename, ctx.get())) log_error("Loading design failed.\n"); -#endif customAfterLoad(ctx.get()); } @@ -392,12 +381,6 @@ int CommandHandler::exec() return 0; std::unordered_map values; - if (vm.count("json")) { - std::string filename = vm["json"].as(); - std::ifstream f(filename); - if (!load_json_settings(f, filename, values)) - log_error("Loading design failed.\n"); - } std::unique_ptr ctx = createContext(values); setupContext(ctx.get()); setupArchContext(ctx.get()); @@ -414,17 +397,12 @@ std::unique_ptr CommandHandler::load_json(std::string filename) { vm.clear(); std::unordered_map values; - { - std::ifstream f(filename); - if (!load_json_settings(f, filename, values)) - log_error("Loading design failed.\n"); - } std::unique_ptr ctx = createContext(values); setupContext(ctx.get()); setupArchContext(ctx.get()); { std::ifstream f(filename); - if (!parse_json_file(f, filename, ctx.get())) + if (!parse_json(f, filename, ctx.get())) log_error("Loading design failed.\n"); } customAfterLoad(ctx.get()); -- cgit v1.2.3