diff options
-rw-r--r-- | common/command.cc | 4 | ||||
-rw-r--r-- | common/project.cc | 13 | ||||
-rw-r--r-- | ecp5/project.cc | 8 | ||||
-rw-r--r-- | generic/project.cc | 12 | ||||
-rw-r--r-- | gui/basewindow.cc | 1 | ||||
-rw-r--r-- | gui/basewindow.h | 1 | ||||
-rw-r--r-- | gui/ecp5/mainwindow.cc | 12 | ||||
-rw-r--r-- | gui/ecp5/mainwindow.h | 1 | ||||
-rw-r--r-- | gui/generic/mainwindow.cc | 3 | ||||
-rw-r--r-- | gui/ice40/mainwindow.cc | 2 | ||||
-rw-r--r-- | ice40/project.cc | 8 |
11 files changed, 31 insertions, 34 deletions
diff --git a/common/command.cc b/common/command.cc index 9c2cc840..cf12df3a 100644 --- a/common/command.cc +++ b/common/command.cc @@ -35,8 +35,8 @@ #include "design_utils.h" #include "jsonparse.h" #include "log.h" +#include "timing.h" #include "version.h" -#include <timing.h> NEXTPNR_NAMESPACE_BEGIN @@ -244,7 +244,7 @@ int CommandHandler::exec() if (executeBeforeContext()) return 0; - + std::unique_ptr<Context> ctx; if (vm.count("load")) { ctx = project.load(vm["load"].as<std::string>()); diff --git a/common/project.cc b/common/project.cc index 8e043f36..244ca761 100644 --- a/common/project.cc +++ b/common/project.cc @@ -17,12 +17,12 @@ * */ +#include "project.h" #include <boost/filesystem/convenience.hpp> #include <boost/property_tree/json_parser.hpp> -#include "project.h" -#include "log.h" -#include "jsonparse.h" #include <fstream> +#include "jsonparse.h" +#include "log.h" NEXTPNR_NAMESPACE_BEGIN @@ -34,10 +34,10 @@ void ProjectHandler::save(Context *ctx, std::string filename) root.put("project.name", boost::filesystem::basename(filename)); root.put("project.arch.name", ctx->archId().c_str(ctx)); root.put("project.arch.type", ctx->archArgsToId(ctx->archArgs()).c_str(ctx)); -/* root.put("project.input.json", );*/ + /* root.put("project.input.json", );*/ root.put("project.params.freq", int(ctx->target_freq / 1e6)); root.put("project.params.seed", ctx->rngstate); - saveArch(ctx,root); + saveArch(ctx, root); pt::write_json(f, root); } @@ -55,7 +55,6 @@ std::unique_ptr<Context> ProjectHandler::load(std::string filename) if (version != 1) log_error("Wrong project format version.\n"); - ctx = createContext(root); std::string arch_name = root.get<std::string>("project.arch.name"); @@ -77,7 +76,7 @@ std::unique_ptr<Context> ProjectHandler::load(std::string filename) if (params.count("seed")) ctx->rngseed(params.get<uint64_t>("seed")); } - loadArch(ctx.get(),root, proj.parent_path().string()); + loadArch(ctx.get(), root, proj.parent_path().string()); } catch (...) { log_error("Error loading project file.\n"); } diff --git a/ecp5/project.cc b/ecp5/project.cc index a9b48bbe..6c1f6a94 100644 --- a/ecp5/project.cc +++ b/ecp5/project.cc @@ -17,11 +17,11 @@ * */ +#include "project.h" #include <boost/filesystem/convenience.hpp> #include <boost/property_tree/json_parser.hpp> -#include "project.h" -#include "log.h" #include <fstream> +#include "log.h" NEXTPNR_NAMESPACE_BEGIN @@ -50,8 +50,6 @@ std::unique_ptr<Context> ProjectHandler::createContext(pt::ptree &root) return std::unique_ptr<Context>(new Context(chipArgs)); } -void ProjectHandler::loadArch(Context *ctx, pt::ptree &root, std::string path) -{ -} +void ProjectHandler::loadArch(Context *ctx, pt::ptree &root, std::string path) {} NEXTPNR_NAMESPACE_END diff --git a/generic/project.cc b/generic/project.cc index e412d8dc..8103e91f 100644 --- a/generic/project.cc +++ b/generic/project.cc @@ -17,16 +17,14 @@ * */ -#include <boost/filesystem/convenience.hpp> #include "project.h" -#include "log.h" +#include <boost/filesystem/convenience.hpp> #include <fstream> +#include "log.h" NEXTPNR_NAMESPACE_BEGIN -void ProjectHandler::saveArch(Context *ctx, pt::ptree &root) -{ -} +void ProjectHandler::saveArch(Context *ctx, pt::ptree &root) {} std::unique_ptr<Context> ProjectHandler::createContext(pt::ptree &root) { @@ -34,8 +32,6 @@ std::unique_ptr<Context> ProjectHandler::createContext(pt::ptree &root) return std::unique_ptr<Context>(new Context(chipArgs)); } -void ProjectHandler::loadArch(Context *ctx, pt::ptree &root, std::string path) -{ -} +void ProjectHandler::loadArch(Context *ctx, pt::ptree &root, std::string path) {} NEXTPNR_NAMESPACE_END diff --git a/gui/basewindow.cc b/gui/basewindow.cc index 98315ee9..857919ea 100644 --- a/gui/basewindow.cc +++ b/gui/basewindow.cc @@ -463,5 +463,4 @@ void BaseMainWindow::save_proj() }
}
-
NEXTPNR_NAMESPACE_END
diff --git a/gui/basewindow.h b/gui/basewindow.h index ef3e252c..6e8f8587 100644 --- a/gui/basewindow.h +++ b/gui/basewindow.h @@ -49,6 +49,7 @@ class BaseMainWindow : public QMainWindow virtual ~BaseMainWindow();
Context *getContext() { return ctx.get(); }
void updateJsonLoaded();
+
protected:
void createMenusAndBars();
void disableActions();
diff --git a/gui/ecp5/mainwindow.cc b/gui/ecp5/mainwindow.cc index efaad364..e5a5f1ba 100644 --- a/gui/ecp5/mainwindow.cc +++ b/gui/ecp5/mainwindow.cc @@ -29,7 +29,8 @@ static void initMainResource() { Q_INIT_RESOURCE(nextpnr); } NEXTPNR_NAMESPACE_BEGIN
-MainWindow::MainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget *parent) : BaseMainWindow(std::move(context), args, parent)
+MainWindow::MainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget *parent)
+ : BaseMainWindow(std::move(context), args, parent)
{
initMainResource();
@@ -50,7 +51,8 @@ void MainWindow::newContext(Context *ctx) setWindowTitle(title.c_str());
}
-void MainWindow::createMenu() {
+void MainWindow::createMenu()
+{
// Add arch specific actions
actionLoadBase = new QAction("Open Base Config", this);
actionLoadBase->setIcon(QIcon(":/icons/resources/open_base.png"));
@@ -71,7 +73,7 @@ void MainWindow::createMenu() { menuDesign->addSeparator();
menuDesign->addAction(actionLoadBase);
- menuDesign->addAction(actionSaveConfig);
+ menuDesign->addAction(actionSaveConfig);
}
static const ChipInfoPOD *get_chip_info(const RelPtr<ChipInfoPOD> *ptr) { return ptr->get(); }
@@ -96,8 +98,8 @@ static QStringList getSupportedPackages(ArchArgs::ArchArgsTypes chip) return packages;
}
-
-void MainWindow::new_proj() {
+void MainWindow::new_proj()
+{
QMap<QString, int> arch;
arch.insert("Lattice ECP5 25K", ArchArgs::LFE5U_25F);
arch.insert("Lattice ECP5 45K", ArchArgs::LFE5U_45F);
diff --git a/gui/ecp5/mainwindow.h b/gui/ecp5/mainwindow.h index d1d5a5a2..9460913c 100644 --- a/gui/ecp5/mainwindow.h +++ b/gui/ecp5/mainwindow.h @@ -47,6 +47,7 @@ class MainWindow : public BaseMainWindow void newContext(Context *ctx);
void open_base();
void save_config();
+
private:
QAction *actionLoadBase;
QAction *actionSaveConfig;
diff --git a/gui/generic/mainwindow.cc b/gui/generic/mainwindow.cc index 050c0fb8..01eeb4ef 100644 --- a/gui/generic/mainwindow.cc +++ b/gui/generic/mainwindow.cc @@ -23,7 +23,8 @@ static void initMainResource() { Q_INIT_RESOURCE(nextpnr); } NEXTPNR_NAMESPACE_BEGIN
-MainWindow::MainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget *parent) : BaseMainWindow(std::move(context), args, parent)
+MainWindow::MainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget *parent)
+ : BaseMainWindow(std::move(context), args, parent)
{
initMainResource();
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 4a2eaaa9..35ad5768 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -24,12 +24,12 @@ #include <QIcon>
#include <QInputDialog>
#include <QLineEdit>
+#include <fstream>
#include "bitstream.h"
#include "design_utils.h"
#include "jsonparse.h"
#include "log.h"
#include "pcf.h"
-#include <fstream>
static void initMainResource() { Q_INIT_RESOURCE(nextpnr); }
diff --git a/ice40/project.cc b/ice40/project.cc index 53401d63..d1f1674a 100644 --- a/ice40/project.cc +++ b/ice40/project.cc @@ -17,10 +17,10 @@ * */ -#include <boost/filesystem/convenience.hpp> #include "project.h" -#include "log.h" +#include <boost/filesystem/convenience.hpp> #include <fstream> +#include "log.h" #include "pcf.h" NEXTPNR_NAMESPACE_BEGIN @@ -28,7 +28,7 @@ NEXTPNR_NAMESPACE_BEGIN void ProjectHandler::saveArch(Context *ctx, pt::ptree &root) { root.put("project.arch.package", ctx->archArgs().package); - // if(!pcfFilename.empty()) + // if(!pcfFilename.empty()) // root.put("project.input.pcf", pcfFilename); } @@ -62,7 +62,7 @@ std::unique_ptr<Context> ProjectHandler::createContext(pt::ptree &root) void ProjectHandler::loadArch(Context *ctx, pt::ptree &root, std::string path) { auto input = root.get_child("project").get_child("input"); - boost::filesystem::path pcf = boost::filesystem::path(path) / input.get<std::string>("pcf"); + boost::filesystem::path pcf = boost::filesystem::path(path) / input.get<std::string>("pcf"); std::ifstream f(pcf.string()); if (!apply_pcf(ctx, f)) log_error("Loading PCF failed.\n"); |