aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rwxr-xr-xgui/create_img.sh6
-rw-r--r--gui/ecp5/mainwindow.cc52
-rw-r--r--gui/ecp5/mainwindow.h6
-rw-r--r--gui/ecp5/nextpnr.qrc1
-rw-r--r--gui/ecp5/resources/open_base.pngbin2022 -> 2175 bytes
-rw-r--r--gui/ecp5/resources/open_lpf.pngbin0 -> 2117 bytes
-rw-r--r--gui/ecp5/resources/save_config.pngbin1428 -> 1645 bytes
-rw-r--r--gui/generic/mainwindow.h2
-rw-r--r--gui/ice40/mainwindow.h2
-rw-r--r--gui/ice40/resources/open_pcf.pngbin1984 -> 2139 bytes
-rw-r--r--gui/ice40/resources/save_asc.pngbin1384 -> 1509 bytes
-rw-r--r--gui/resources/open_json.pngbin2093 -> 2177 bytes
12 files changed, 60 insertions, 9 deletions
diff --git a/gui/create_img.sh b/gui/create_img.sh
new file mode 100755
index 00000000..1508d023
--- /dev/null
+++ b/gui/create_img.sh
@@ -0,0 +1,6 @@
+convert -font helvetica -fill red -pointsize 8 -gravity center -draw "text 2,8 'JSON'" resources/open.png resources/open_json.png
+convert -font helvetica -fill red -pointsize 8 -gravity center -draw "text 2,8 'PCF'" resources/open.png ice40/resources/open_pcf.png
+convert -font helvetica -fill red -pointsize 8 -gravity center -draw "text 2,8 'BASE'" resources/open.png ecp5/resources/open_base.png
+convert -font helvetica -fill red -pointsize 8 -gravity center -draw "text 2,8 'LPF'" resources/open.png ecp5/resources/open_lpf.png
+convert -font helvetica -fill red -pointsize 8 -gravity center -draw "text 2,8 'ASC'" resources/save.png ice40/resources/save_asc.png
+convert -font helvetica -fill red -pointsize 7 -gravity center -draw "text 2,8 'CONFIG'" resources/save.png ecp5/resources/save_config.png \ No newline at end of file
diff --git a/gui/ecp5/mainwindow.cc b/gui/ecp5/mainwindow.cc
index b3c53849..fe2f9e57 100644
--- a/gui/ecp5/mainwindow.cc
+++ b/gui/ecp5/mainwindow.cc
@@ -20,6 +20,7 @@
#include "mainwindow.h"
#include "bitstream.h"
#include "log.h"
+#include <fstream>
#include <QFileDialog>
#include <QInputDialog>
@@ -53,6 +54,12 @@ void MainWindow::newContext(Context *ctx)
void MainWindow::createMenu()
{
// Add arch specific actions
+ actionLoadLPF = new QAction("Open LPF", this);
+ actionLoadLPF->setIcon(QIcon(":/icons/resources/open_lpf.png"));
+ actionLoadLPF->setStatusTip("Open LPF file");
+ actionLoadLPF->setEnabled(false);
+ connect(actionLoadLPF, &QAction::triggered, this, &MainWindow::open_lpf);
+
actionLoadBase = new QAction("Open Base Config", this);
actionLoadBase->setIcon(QIcon(":/icons/resources/open_base.png"));
actionLoadBase->setStatusTip("Open Base Config file");
@@ -67,10 +74,12 @@ void MainWindow::createMenu()
// Add actions in menus
mainActionBar->addSeparator();
+ mainActionBar->addAction(actionLoadLPF);
mainActionBar->addAction(actionLoadBase);
mainActionBar->addAction(actionSaveConfig);
menuDesign->addSeparator();
+ menuDesign->addAction(actionLoadLPF);
menuDesign->addAction(actionLoadBase);
menuDesign->addAction(actionSaveConfig);
}
@@ -81,11 +90,11 @@ static QStringList getSupportedPackages(ArchArgs::ArchArgsTypes chip)
{
QStringList packages;
const ChipInfoPOD *chip_info;
- if (chip == ArchArgs::LFE5U_25F) {
+ if (chip == ArchArgs::LFE5U_25F || chip == ArchArgs::LFE5UM_25F || chip == ArchArgs::LFE5UM5G_25F) {
chip_info = get_chip_info(reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_25k));
- } else if (chip == ArchArgs::LFE5U_45F) {
+ } else if (chip == ArchArgs::LFE5U_45F || chip == ArchArgs::LFE5UM_45F || chip == ArchArgs::LFE5UM5G_45F) {
chip_info = get_chip_info(reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_45k));
- } else if (chip == ArchArgs::LFE5U_85F) {
+ } else if (chip == ArchArgs::LFE5U_85F || chip == ArchArgs::LFE5UM_85F || chip == ArchArgs::LFE5UM5G_85F) {
chip_info = get_chip_info(reinterpret_cast<const RelPtr<ChipInfoPOD> *>(chipdb_blob_85k));
} else {
log_error("Unsupported ECP5 chip type.\n");
@@ -100,9 +109,15 @@ static QStringList getSupportedPackages(ArchArgs::ArchArgsTypes chip)
void MainWindow::new_proj()
{
QMap<QString, int> arch;
- arch.insert("Lattice ECP5 25K", ArchArgs::LFE5U_25F);
- arch.insert("Lattice ECP5 45K", ArchArgs::LFE5U_45F);
- arch.insert("Lattice ECP5 85K", ArchArgs::LFE5U_85F);
+ arch.insert("Lattice ECP5 LFE5U-25F", ArchArgs::LFE5U_25F);
+ arch.insert("Lattice ECP5 LFE5U-45F", ArchArgs::LFE5U_45F);
+ arch.insert("Lattice ECP5 LFE5U-85F", ArchArgs::LFE5U_85F);
+ arch.insert("Lattice ECP5 LFE5UM-25F", ArchArgs::LFE5UM_25F);
+ arch.insert("Lattice ECP5 LFE5UM-45F", ArchArgs::LFE5UM_45F);
+ arch.insert("Lattice ECP5 LFE5UM-85F", ArchArgs::LFE5UM_85F);
+ arch.insert("Lattice ECP5 LFE5UM5G-25F", ArchArgs::LFE5UM5G_25F);
+ arch.insert("Lattice ECP5 LFE5UM5G-45F", ArchArgs::LFE5UM5G_45F);
+ arch.insert("Lattice ECP5 LFE5UM5G-85F", ArchArgs::LFE5UM5G_85F);
bool ok;
QString item = QInputDialog::getItem(this, "Select new context", "Chip:", arch.keys(), 0, false, &ok);
if (ok && !item.isEmpty()) {
@@ -131,6 +146,22 @@ void MainWindow::load_base_config(std::string filename)
actionSaveConfig->setEnabled(true);
}
+void MainWindow::open_lpf()
+{
+ QString fileName = QFileDialog::getOpenFileName(this, QString("Open LPF"), QString(), QString("*.lpf"));
+ if (!fileName.isEmpty()) {
+ std::ifstream in(fileName.toStdString());
+ if (ctx->applyLPF(fileName.toStdString(), in)) {
+ log("Loading LPF successful.\n");
+ actionPack->setEnabled(true);
+ actionLoadLPF->setEnabled(false);
+ } else {
+ actionLoadLPF->setEnabled(true);
+ log("Loading LPF failed.\n");
+ }
+ }
+}
+
void MainWindow::open_base()
{
QString fileName = QFileDialog::getOpenFileName(this, QString("Open Base Config"), QString(), QString("*.config"));
@@ -152,10 +183,19 @@ void MainWindow::save_config()
void MainWindow::onDisableActions()
{
+ actionLoadLPF->setEnabled(false);
actionLoadBase->setEnabled(false);
actionSaveConfig->setEnabled(false);
}
+void MainWindow::onJsonLoaded() { actionLoadLPF->setEnabled(true); }
+
void MainWindow::onRouteFinished() { actionLoadBase->setEnabled(true); }
+void MainWindow::onProjectLoaded()
+{
+ if (ctx->settings.find(ctx->id("input/lpf")) != ctx->settings.end())
+ actionLoadLPF->setEnabled(false);
+}
+
NEXTPNR_NAMESPACE_END
diff --git a/gui/ecp5/mainwindow.h b/gui/ecp5/mainwindow.h
index f85c2abc..721c6c0b 100644
--- a/gui/ecp5/mainwindow.h
+++ b/gui/ecp5/mainwindow.h
@@ -38,15 +38,19 @@ class MainWindow : public BaseMainWindow
protected:
void onDisableActions() override;
+ void onJsonLoaded() override;
void onRouteFinished() override;
+ void onProjectLoaded() override;
protected Q_SLOTS:
- virtual void new_proj();
+ void new_proj() override;
void newContext(Context *ctx);
+ void open_lpf();
void open_base();
void save_config();
private:
+ QAction *actionLoadLPF;
QAction *actionLoadBase;
QAction *actionSaveConfig;
diff --git a/gui/ecp5/nextpnr.qrc b/gui/ecp5/nextpnr.qrc
index 09f96d74..ca7e5b1a 100644
--- a/gui/ecp5/nextpnr.qrc
+++ b/gui/ecp5/nextpnr.qrc
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/icons">
+ <file>resources/open_lpf.png</file>
<file>resources/open_base.png</file>
<file>resources/save_config.png</file>
</qresource>
diff --git a/gui/ecp5/resources/open_base.png b/gui/ecp5/resources/open_base.png
index d58d226c..b60cf25a 100644
--- a/gui/ecp5/resources/open_base.png
+++ b/gui/ecp5/resources/open_base.png
Binary files differ
diff --git a/gui/ecp5/resources/open_lpf.png b/gui/ecp5/resources/open_lpf.png
new file mode 100644
index 00000000..54b6f6f9
--- /dev/null
+++ b/gui/ecp5/resources/open_lpf.png
Binary files differ
diff --git a/gui/ecp5/resources/save_config.png b/gui/ecp5/resources/save_config.png
index 2ade7128..63b5ab56 100644
--- a/gui/ecp5/resources/save_config.png
+++ b/gui/ecp5/resources/save_config.png
Binary files differ
diff --git a/gui/generic/mainwindow.h b/gui/generic/mainwindow.h
index a4ce9958..bb6a4cf1 100644
--- a/gui/generic/mainwindow.h
+++ b/gui/generic/mainwindow.h
@@ -36,7 +36,7 @@ class MainWindow : public BaseMainWindow
void createMenu();
protected Q_SLOTS:
- virtual void new_proj();
+ void new_proj() override;
void newContext(Context *ctx);
};
diff --git a/gui/ice40/mainwindow.h b/gui/ice40/mainwindow.h
index bb8ed75f..4a9a7d8e 100644
--- a/gui/ice40/mainwindow.h
+++ b/gui/ice40/mainwindow.h
@@ -44,7 +44,7 @@ class MainWindow : public BaseMainWindow
void onProjectLoaded() override;
protected Q_SLOTS:
- virtual void new_proj();
+ void new_proj() override;
void open_pcf();
void save_asc();
diff --git a/gui/ice40/resources/open_pcf.png b/gui/ice40/resources/open_pcf.png
index 093dec39..9a4c64d5 100644
--- a/gui/ice40/resources/open_pcf.png
+++ b/gui/ice40/resources/open_pcf.png
Binary files differ
diff --git a/gui/ice40/resources/save_asc.png b/gui/ice40/resources/save_asc.png
index 15b59ca1..c3e6b0ab 100644
--- a/gui/ice40/resources/save_asc.png
+++ b/gui/ice40/resources/save_asc.png
Binary files differ
diff --git a/gui/resources/open_json.png b/gui/resources/open_json.png
index 90c07267..7352824b 100644
--- a/gui/resources/open_json.png
+++ b/gui/resources/open_json.png
Binary files differ