aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-11-27 12:11:18 +0000
committerDavid Shah <dave@ds0.me>2019-12-27 10:44:30 +0000
commit035bfb0fe501fe5b840e83acaf781f2dffef8513 (patch)
tree013f1127cf7349b9d3641a5504feec4bca335af6 /common
parent14b18cb6fa8909cbe34bfb01c6ea43a2ccff9617 (diff)
downloadnextpnr-035bfb0fe501fe5b840e83acaf781f2dffef8513.tar.gz
nextpnr-035bfb0fe501fe5b840e83acaf781f2dffef8513.tar.bz2
nextpnr-035bfb0fe501fe5b840e83acaf781f2dffef8513.zip
json: Remove legacy frontend
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r--common/command.cc24
-rw-r--r--common/pybindings.cc4
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