json: Remove legacy frontend

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2019-11-27 12:11:18 +00:00
parent 14b18cb6fa
commit 035bfb0fe5
7 changed files with 3 additions and 1090 deletions

View File

@ -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());

View File

@ -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

View File

@ -28,7 +28,6 @@
#include <fstream>
#include "designwidget.h"
#include "fpgaviewwidget.h"
#include "jsonparse.h"
#include "jsonwrite.h"
#include "log.h"
#include "mainwindow.h"

View File

@ -27,7 +27,6 @@
#include <fstream>
#include "bitstream.h"
#include "design_utils.h"
#include "jsonparse.h"
#include "log.h"
#include "pcf.h"

View File

@ -24,7 +24,6 @@
#include "bitstream.h"
#include "command.h"
#include "design_utils.h"
#include "jsonparse.h"
#include "log.h"
#include "pcf.h"
#include "timing.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +0,0 @@
/*
* nextpnr -- Next Generation Place and Route
*
* Copyright (C) 2018 SymbioticEDA
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
#ifndef JSON_PARSER
#define JSON_PARSER
#include <istream>
#include <string>
#include "nextpnr.h"
NEXTPNR_NAMESPACE_BEGIN
extern bool parse_json_file(std::istream &, std::string &, Context *);
extern bool load_json_settings(std::istream &f, std::string &filename,
std::unordered_map<std::string, Property> &values);
NEXTPNR_NAMESPACE_END
#endif