diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/command.cc | 24 | ||||
-rw-r--r-- | common/pybindings.cc | 4 |
2 files changed, 3 insertions, 25 deletions
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<Context> ctx) if (vm.count("json")) { std::string filename = vm["json"].as<std::string>(); 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<Context> ctx) if (vm.count("json")) { std::string filename = vm["json"].as<std::string>(); 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<std::string, Property> values; - if (vm.count("json")) { - std::string filename = vm["json"].as<std::string>(); - std::ifstream f(filename); - if (!load_json_settings(f, filename, values)) - log_error("Loading design failed.\n"); - } std::unique_ptr<Context> ctx = createContext(values); setupContext(ctx.get()); setupArchContext(ctx.get()); @@ -414,17 +397,12 @@ std::unique_ptr<Context> CommandHandler::load_json(std::string filename) { vm.clear(); std::unordered_map<std::string, Property> values; - { - std::ifstream f(filename); - if (!load_json_settings(f, filename, values)) - log_error("Loading design failed.\n"); - } std::unique_ptr<Context> 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()); diff --git a/common/pybindings.cc b/common/pybindings.cc index 03979233..53830284 100644 --- a/common/pybindings.cc +++ b/common/pybindings.cc @@ -22,7 +22,7 @@ #include "pybindings.h" #include "arch_pybindings.h" -#include "jsonparse.h" +#include "json_frontend.h" #include "log.h" #include "nextpnr.h" @@ -53,7 +53,7 @@ void parse_json_shim(std::string filename, Context &d) std::ifstream inf(filename); if (!inf) throw std::runtime_error("failed to open file " + filename); - parse_json_file(inf, filename, &d); + parse_json(inf, filename, &d); } // Create a new Chip and load design from json file |