diff options
author | David Shah <dave@ds0.me> | 2019-12-27 11:19:45 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-27 11:19:45 +0000 |
commit | 4e0ca50db137eb9d10098582be607c98601f8375 (patch) | |
tree | 7dd586694d7c3bca458502f3e6d677da1a6954b3 /common/command.cc | |
parent | b6e2159cecdf79d0d94d0e6a9dda8cef6389cac1 (diff) | |
parent | 5774b13984bb151909b90ee2c668bdfb08387a2b (diff) | |
download | nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.tar.gz nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.tar.bz2 nextpnr-4e0ca50db137eb9d10098582be607c98601f8375.zip |
Merge pull request #353 from YosysHQ/generic-frontend
New hierarchy-capable generic frontend framework and json11 based JSON frontend
Diffstat (limited to 'common/command.cc')
-rw-r--r-- | common/command.cc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/common/command.cc b/common/command.cc index fd310789..c2f02b27 100644 --- a/common/command.cc +++ b/common/command.cc @@ -35,7 +35,7 @@ #include <iostream> #include "command.h" #include "design_utils.h" -#include "jsonparse.h" +#include "json_frontend.h" #include "jsonwrite.h" #include "log.h" #include "timing.h" @@ -265,9 +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); - if (!parse_json_file(f, filename, w.getContext())) + if (!parse_json(f, filename, w.getContext())) log_error("Loading design failed.\n"); - customAfterLoad(w.getContext()); w.notifyChangeContext(); w.updateActions(); @@ -284,7 +283,7 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx) if (vm.count("json")) { std::string filename = vm["json"].as<std::string>(); 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()); @@ -382,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()); @@ -404,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()); |