aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/base.qrc2
-rw-r--r--gui/basewindow.cc35
-rw-r--r--gui/basewindow.h5
-rw-r--r--gui/designwidget.cc68
-rw-r--r--gui/designwidget.h3
-rw-r--r--gui/ice40/mainwindow.cc1
-rw-r--r--gui/infotab.cc58
-rw-r--r--gui/infotab.h48
-rw-r--r--gui/resources/cross.pngbin0 -> 655 bytes
-rw-r--r--gui/resources/splash.pngbin4651 -> 0 bytes
-rw-r--r--gui/yosys_edit.cc96
-rw-r--r--gui/yosys_edit.h57
-rw-r--r--gui/yosystab.cc108
-rw-r--r--gui/yosystab.h59
14 files changed, 35 insertions, 505 deletions
diff --git a/gui/base.qrc b/gui/base.qrc
index bf21986b..1a848f54 100644
--- a/gui/base.qrc
+++ b/gui/base.qrc
@@ -9,6 +9,6 @@
<file>resources/resultset_previous.png</file>
<file>resources/resultset_next.png</file>
<file>resources/resultset_last.png</file>
- <file>resources/splash.png</file>
+ <file>resources/cross.png</file>
</qresource>
</RCC>
diff --git a/gui/basewindow.cc b/gui/basewindow.cc
index 81c89e45..4a225bd6 100644
--- a/gui/basewindow.cc
+++ b/gui/basewindow.cc
@@ -29,7 +29,6 @@
#include "log.h"
#include "mainwindow.h"
#include "pythontab.h"
-#include "yosystab.h"
static void initBasenameResource() { Q_INIT_RESOURCE(base); }
@@ -95,29 +94,12 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
splitter_v->addWidget(centralTabWidget);
splitter_v->addWidget(tabWidget);
- displaySplash();
}
BaseMainWindow::~BaseMainWindow() {}
void BaseMainWindow::closeTab(int index) { delete centralTabWidget->widget(index); }
-void BaseMainWindow::displaySplash()
-{
- splash = new QSplashScreen();
- splash->setPixmap(QPixmap(":/icons/resources/splash.png"));
- splash->show();
- connect(designview, SIGNAL(finishContextLoad()), splash, SLOT(close()));
- connect(designview, SIGNAL(contextLoadStatus(std::string)), this, SLOT(displaySplashMessage(std::string)));
- QCoreApplication::instance()->processEvents();
-}
-
-void BaseMainWindow::displaySplashMessage(std::string msg)
-{
- splash->showMessage(msg.c_str(), Qt::AlignCenter | Qt::AlignBottom, Qt::white);
- QCoreApplication::instance()->processEvents();
-}
-
void BaseMainWindow::writeInfo(std::string text) { console->info(text); }
void BaseMainWindow::createMenusAndBars()
@@ -147,10 +129,6 @@ void BaseMainWindow::createMenusAndBars()
actionExit->setStatusTip("Exit the application");
connect(actionExit, SIGNAL(triggered()), this, SLOT(close()));
- QAction *actionYosys = new QAction("Yosys", this);
- actionYosys->setStatusTip("Run Yosys");
- connect(actionYosys, SIGNAL(triggered()), this, SLOT(yosys()));
-
QAction *actionAbout = new QAction("About", this);
menuBar = new QMenuBar();
@@ -183,19 +161,6 @@ void BaseMainWindow::createMenusAndBars()
mainToolBar->addAction(actionNew);
mainToolBar->addAction(actionOpen);
mainToolBar->addAction(actionSave);
- mainToolBar->addAction(actionYosys);
}
-void BaseMainWindow::yosys()
-{
- QString folder = QFileDialog::getExistingDirectory(0, ("Select Work Folder"), QDir::currentPath(),
- QFileDialog::ShowDirsOnly);
- if (!folder.isEmpty() && !folder.isNull()) {
- YosysTab *yosysTab = new YosysTab(folder);
- yosysTab->setAttribute(Qt::WA_DeleteOnClose);
- centralTabWidget->addTab(yosysTab, "Yosys");
- centralTabWidget->setCurrentWidget(yosysTab);
- centralTabWidget->setTabToolTip(centralTabWidget->indexOf(yosysTab), folder);
- }
-}
NEXTPNR_NAMESPACE_END
diff --git a/gui/basewindow.h b/gui/basewindow.h
index 087880ed..eee426c7 100644
--- a/gui/basewindow.h
+++ b/gui/basewindow.h
@@ -26,7 +26,6 @@
#include <QMenu>
#include <QMenuBar>
#include <QProgressBar>
-#include <QSplashScreen>
#include <QStatusBar>
#include <QTabWidget>
#include <QToolBar>
@@ -50,17 +49,14 @@ class BaseMainWindow : public QMainWindow
protected:
void createMenusAndBars();
- void displaySplash();
protected Q_SLOTS:
void writeInfo(std::string text);
- void displaySplashMessage(std::string msg);
void closeTab(int index);
virtual void new_proj() = 0;
virtual void open_proj() = 0;
virtual bool save_proj() = 0;
- void yosys();
Q_SIGNALS:
void contextChanged(Context *ctx);
@@ -78,7 +74,6 @@ class BaseMainWindow : public QMainWindow
QAction *actionNew;
QAction *actionOpen;
QProgressBar *progressBar;
- QSplashScreen *splash;
DesignWidget *designview;
};
diff --git a/gui/designwidget.cc b/gui/designwidget.cc
index 335ed929..d28b843b 100644
--- a/gui/designwidget.cc
+++ b/gui/designwidget.cc
@@ -125,11 +125,27 @@ DesignWidget::DesignWidget(QWidget *parent) : QWidget(parent), ctx(nullptr), net
updateButtons();
});
+ actionClear = new QAction("", this);
+ actionClear->setIcon(QIcon(":/icons/resources/cross.png"));
+ actionClear->setEnabled(true);
+ connect(actionClear, &QAction::triggered, this, [this] {
+ history_index = -1;
+ history.clear();
+ QTreeWidgetItem *clickItem = treeWidget->selectedItems().at(0);
+ if (clickItem->parent()) {
+ ElementType type = static_cast<ElementTreeItem *>(clickItem)->getType();
+ if (type != ElementType::NONE)
+ addToHistory(treeWidget->selectedItems().at(0));
+ }
+ updateButtons();
+ });
+
QToolBar *toolbar = new QToolBar();
toolbar->addAction(actionFirst);
toolbar->addAction(actionPrev);
toolbar->addAction(actionNext);
toolbar->addAction(actionLast);
+ toolbar->addAction(actionClear);
QWidget *topWidget = new QWidget();
QVBoxLayout *vbox1 = new QVBoxLayout();
@@ -230,7 +246,6 @@ void DesignWidget::newContext(Context *ctx)
bel_root->setText(0, "Bels");
treeWidget->insertTopLevelItem(0, bel_root);
if (ctx) {
- Q_EMIT contextLoadStatus("Configuring bels...");
for (auto bel : ctx->getBels()) {
auto id = ctx->getBelName(bel);
QStringList items = QString(id.c_str(ctx)).split("/");
@@ -263,7 +278,6 @@ void DesignWidget::newContext(Context *ctx)
wire_root->setText(0, "Wires");
treeWidget->insertTopLevelItem(0, wire_root);
if (ctx) {
- Q_EMIT contextLoadStatus("Configuring wires...");
for (auto wire : ctx->getWires()) {
auto id = ctx->getWireName(wire);
QStringList items = QString(id.c_str(ctx)).split("/");
@@ -295,7 +309,6 @@ void DesignWidget::newContext(Context *ctx)
pip_root->setText(0, "Pips");
treeWidget->insertTopLevelItem(0, pip_root);
if (ctx) {
- Q_EMIT contextLoadStatus("Configuring pips...");
for (auto pip : ctx->getPips()) {
auto id = ctx->getPipName(pip);
QStringList items = QString(id.c_str(ctx)).split("/");
@@ -321,18 +334,7 @@ void DesignWidget::newContext(Context *ctx)
for (auto pip : nameToItem[2].toStdMap()) {
pip_root->addChild(pip.second);
}
-
- // Add nets to tree
- nets_root = new QTreeWidgetItem(treeWidget);
- nets_root->setText(0, "Nets");
- treeWidget->insertTopLevelItem(0, nets_root);
-
- // Add cells to tree
- cells_root = new QTreeWidgetItem(treeWidget);
- cells_root->setText(0, "Cells");
- treeWidget->insertTopLevelItem(0, cells_root);
-
- Q_EMIT finishContextLoad();
+ updateTree();
}
void DesignWidget::updateTree()
@@ -477,13 +479,12 @@ void DesignWidget::onItemSelectionChanged()
addToHistory(clickItem);
clearProperties();
- if (type == ElementType::BEL) {
- IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
- BelId bel = ctx->getBelByName(c);
- decals.push_back(ctx->getBelDecal(bel));
- Q_EMIT selected(decals);
+ IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
+ Q_EMIT selected(getDecals(type, c));
+ if (type == ElementType::BEL) {
+ BelId bel = ctx->getBelByName(c);
QtProperty *topItem = addTopLevelProperty("Bel");
addProperty(topItem, QVariant::String, "Name", c.c_str(ctx));
@@ -494,12 +495,7 @@ void DesignWidget::onItemSelectionChanged()
ElementType::CELL);
} else if (type == ElementType::WIRE) {
- IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
WireId wire = ctx->getWireByName(c);
-
- decals.push_back(ctx->getWireDecal(wire));
- Q_EMIT selected(decals);
-
QtProperty *topItem = addTopLevelProperty("Wire");
addProperty(topItem, QVariant::String, "Name", c.c_str(ctx));
@@ -551,12 +547,7 @@ void DesignWidget::onItemSelectionChanged()
}
}
} else if (type == ElementType::PIP) {
- IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
PipId pip = ctx->getPipByName(c);
-
- decals.push_back(ctx->getPipDecal(pip));
- Q_EMIT selected(decals);
-
QtProperty *topItem = addTopLevelProperty("Pip");
addProperty(topItem, QVariant::String, "Name", c.c_str(ctx));
@@ -576,7 +567,6 @@ void DesignWidget::onItemSelectionChanged()
addProperty(delayItem, QVariant::Double, "Fall", delay.fallDelay());
addProperty(delayItem, QVariant::Double, "Average", delay.avgDelay());
} else if (type == ElementType::NET) {
- IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
NetInfo *net = ctx->nets.at(c).get();
QtProperty *topItem = addTopLevelProperty("Net");
@@ -613,7 +603,7 @@ void DesignWidget::onItemSelectionChanged()
auto name = ctx->getWireName(item.first).c_str(ctx);
QtProperty *wireItem = addSubGroup(wiresItem, name);
- addProperty(wireItem, QVariant::String, "Name", name);
+ addProperty(wireItem, QVariant::String, "Wire", name, ElementType::WIRE);
if (item.second.pip != PipId())
addProperty(wireItem, QVariant::String, "Pip", ctx->getPipName(item.second.pip).c_str(ctx),
@@ -625,7 +615,6 @@ void DesignWidget::onItemSelectionChanged()
}
} else if (type == ElementType::CELL) {
- IdString c = static_cast<IdStringTreeItem *>(clickItem)->getData();
CellInfo *cell = ctx->cells.at(c).get();
QtProperty *topItem = addTopLevelProperty("Cell");
@@ -689,19 +678,28 @@ std::vector<DecalXY> DesignWidget::getDecals(ElementType type, IdString value)
WireId wire = ctx->getWireByName(value);
if (wire != WireId()) {
decals.push_back(ctx->getWireDecal(wire));
- Q_EMIT selected(decals);
}
} break;
case ElementType::PIP: {
PipId pip = ctx->getPipByName(value);
if (pip != PipId()) {
decals.push_back(ctx->getPipDecal(pip));
- Q_EMIT selected(decals);
}
} break;
case ElementType::NET: {
+ NetInfo *net = ctx->nets.at(value).get();
+ for (auto &item : net->wires) {
+ decals.push_back(ctx->getWireDecal(item.first));
+ if (item.second.pip != PipId()) {
+ decals.push_back(ctx->getPipDecal(item.second.pip));
+ }
+ }
} break;
case ElementType::CELL: {
+ CellInfo *cell = ctx->cells.at(value).get();
+ if (cell->bel != BelId()) {
+ decals.push_back(ctx->getBelDecal(cell->bel));
+ }
} break;
default:
break;
diff --git a/gui/designwidget.h b/gui/designwidget.h
index 1afe817d..b5877f60 100644
--- a/gui/designwidget.h
+++ b/gui/designwidget.h
@@ -65,8 +65,6 @@ class DesignWidget : public QWidget
void info(std::string text);
void selected(std::vector<DecalXY> decal);
void highlight(std::vector<DecalXY> decal, int group);
- void finishContextLoad();
- void contextLoadStatus(std::string text);
private Q_SLOTS:
void prepareMenuProperty(const QPoint &pos);
@@ -104,6 +102,7 @@ class DesignWidget : public QWidget
QAction *actionPrev;
QAction *actionNext;
QAction *actionLast;
+ QAction *actionClear;
QColor highlightColors[8];
QMap<QTreeWidgetItem *, int> highlightSelected;
diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc
index 4b1f2c57..28792ed3 100644
--- a/gui/ice40/mainwindow.cc
+++ b/gui/ice40/mainwindow.cc
@@ -226,7 +226,6 @@ void MainWindow::new_proj()
ctx = std::unique_ptr<Context>(new Context(chipArgs));
actionLoadJSON->setEnabled(true);
- Q_EMIT displaySplash();
Q_EMIT contextChanged(ctx.get());
}
}
diff --git a/gui/infotab.cc b/gui/infotab.cc
deleted file mode 100644
index dd44b806..00000000
--- a/gui/infotab.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
- *
- * 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.
- *
- */
-
-#include "infotab.h"
-#include <QGridLayout>
-
-NEXTPNR_NAMESPACE_BEGIN
-
-InfoTab::InfoTab(QWidget *parent) : QWidget(parent)
-{
- plainTextEdit = new QPlainTextEdit();
- plainTextEdit->setReadOnly(true);
- QFont f("unexistent");
- f.setStyleHint(QFont::Monospace);
- plainTextEdit->setFont(f);
-
- plainTextEdit->setContextMenuPolicy(Qt::CustomContextMenu);
- QAction *clearAction = new QAction("Clear &buffer", this);
- clearAction->setStatusTip("Clears display buffer");
- connect(clearAction, SIGNAL(triggered()), this, SLOT(clearBuffer()));
- contextMenu = plainTextEdit->createStandardContextMenu();
- contextMenu->addSeparator();
- contextMenu->addAction(clearAction);
- connect(plainTextEdit, SIGNAL(customContextMenuRequested(const QPoint)), this, SLOT(showContextMenu(const QPoint)));
-
- QGridLayout *mainLayout = new QGridLayout();
- mainLayout->addWidget(plainTextEdit);
- setLayout(mainLayout);
-}
-
-void InfoTab::info(std::string str)
-{
- plainTextEdit->moveCursor(QTextCursor::End);
- plainTextEdit->insertPlainText(str.c_str());
- plainTextEdit->moveCursor(QTextCursor::End);
-}
-
-void InfoTab::showContextMenu(const QPoint &pt) { contextMenu->exec(mapToGlobal(pt)); }
-
-void InfoTab::clearBuffer() { plainTextEdit->clear(); }
-
-NEXTPNR_NAMESPACE_END
diff --git a/gui/infotab.h b/gui/infotab.h
deleted file mode 100644
index 41529973..00000000
--- a/gui/infotab.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
- *
- * 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 INFOTAB_H
-#define INFOTAB_H
-
-#include <QMenu>
-#include <QPlainTextEdit>
-#include "nextpnr.h"
-
-NEXTPNR_NAMESPACE_BEGIN
-
-class InfoTab : public QWidget
-{
- Q_OBJECT
-
- public:
- explicit InfoTab(QWidget *parent = 0);
- void info(std::string str);
- public Q_SLOTS:
- void clearBuffer();
- private Q_SLOTS:
- void showContextMenu(const QPoint &pt);
-
- private:
- QPlainTextEdit *plainTextEdit;
- QMenu *contextMenu;
-};
-
-NEXTPNR_NAMESPACE_END
-
-#endif // INFOTAB_H
diff --git a/gui/resources/cross.png b/gui/resources/cross.png
new file mode 100644
index 00000000..1514d51a
--- /dev/null
+++ b/gui/resources/cross.png
Binary files differ
diff --git a/gui/resources/splash.png b/gui/resources/splash.png
deleted file mode 100644
index 14d2842b..00000000
--- a/gui/resources/splash.png
+++ /dev/null
Binary files differ
diff --git a/gui/yosys_edit.cc b/gui/yosys_edit.cc
deleted file mode 100644
index 72d2430d..00000000
--- a/gui/yosys_edit.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
- * Copyright (C) 2018 Alex Tsui
- *
- * 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.
- *
- */
-
-#include "yosys_edit.h"
-#include <QKeyEvent>
-#include <QToolTip>
-
-NEXTPNR_NAMESPACE_BEGIN
-
-YosysLineEditor::YosysLineEditor(QWidget *parent) : QLineEdit(parent), index(0)
-{
- setContextMenuPolicy(Qt::CustomContextMenu);
- QAction *clearAction = new QAction("Clear &history", this);
- clearAction->setStatusTip("Clears line edit history");
- connect(clearAction, SIGNAL(triggered()), this, SLOT(clearHistory()));
- contextMenu = createStandardContextMenu();
- contextMenu->addSeparator();
- contextMenu->addAction(clearAction);
-
- connect(this, SIGNAL(returnPressed()), SLOT(textInserted()));
- connect(this, SIGNAL(customContextMenuRequested(const QPoint)), this, SLOT(showContextMenu(const QPoint)));
-}
-
-void YosysLineEditor::keyPressEvent(QKeyEvent *ev)
-{
-
- if (ev->key() == Qt::Key_Up || ev->key() == Qt::Key_Down) {
- QToolTip::hideText();
- if (lines.empty())
- return;
- if (ev->key() == Qt::Key_Up)
- index--;
- if (ev->key() == Qt::Key_Down)
- index++;
-
- if (index < 0)
- index = 0;
- if (index >= lines.size()) {
- index = lines.size();
- clear();
- return;
- }
- setText(lines[index]);
- } else if (ev->key() == Qt::Key_Escape) {
- QToolTip::hideText();
- clear();
- return;
- } else if (ev->key() == Qt::Key_Tab) {
- return;
- }
- QToolTip::hideText();
-
- QLineEdit::keyPressEvent(ev);
-}
-
-// This makes TAB work
-bool YosysLineEditor::focusNextPrevChild(bool next) { return false; }
-
-void YosysLineEditor::textInserted()
-{
- if (lines.empty() || lines.back() != text())
- lines += text();
- if (lines.size() > 100)
- lines.removeFirst();
- index = lines.size();
- clear();
- Q_EMIT textLineInserted(lines.back());
-}
-
-void YosysLineEditor::showContextMenu(const QPoint &pt) { contextMenu->exec(mapToGlobal(pt)); }
-
-void YosysLineEditor::clearHistory()
-{
- lines.clear();
- index = 0;
- clear();
-}
-
-NEXTPNR_NAMESPACE_END
diff --git a/gui/yosys_edit.h b/gui/yosys_edit.h
deleted file mode 100644
index 05e4ae36..00000000
--- a/gui/yosys_edit.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
- * Copyright (C) 2018 Alex Tsui
- *
- * 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 YOSYS_EDIT_H
-#define YOSYS_EDIT_H
-
-#include <QLineEdit>
-#include <QMenu>
-#include "nextpnr.h"
-
-NEXTPNR_NAMESPACE_BEGIN
-
-class YosysLineEditor : public QLineEdit
-{
- Q_OBJECT
-
- public:
- explicit YosysLineEditor(QWidget *parent = 0);
-
- private Q_SLOTS:
- void textInserted();
- void showContextMenu(const QPoint &pt);
- void clearHistory();
-
- Q_SIGNALS:
- void textLineInserted(QString);
-
- protected:
- void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
- bool focusNextPrevChild(bool next) Q_DECL_OVERRIDE;
-
- private:
- int index;
- QStringList lines;
- QMenu *contextMenu;
-};
-
-NEXTPNR_NAMESPACE_END
-
-#endif // YOSYS_EDIT_H
diff --git a/gui/yosystab.cc b/gui/yosystab.cc
deleted file mode 100644
index d83b969e..00000000
--- a/gui/yosystab.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
- *
- * 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.
- *
- */
-
-#include "yosystab.h"
-#include <QGridLayout>
-#include <QMessageBox>
-
-NEXTPNR_NAMESPACE_BEGIN
-
-YosysTab::YosysTab(QString folder, QWidget *parent) : QWidget(parent)
-{
- QFont f("unexistent");
- f.setStyleHint(QFont::Monospace);
-
- console = new QPlainTextEdit();
- console->setMinimumHeight(100);
- console->setReadOnly(true);
- console->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
- console->setFont(f);
-
- console->setContextMenuPolicy(Qt::CustomContextMenu);
- QAction *clearAction = new QAction("Clear &buffer", this);
- clearAction->setStatusTip("Clears display buffer");
- connect(clearAction, SIGNAL(triggered()), this, SLOT(clearBuffer()));
- contextMenu = console->createStandardContextMenu();
- contextMenu->addSeparator();
- contextMenu->addAction(clearAction);
- connect(console, SIGNAL(customContextMenuRequested(const QPoint)), this, SLOT(showContextMenu(const QPoint)));
-
- lineEdit = new YosysLineEditor();
- lineEdit->setMinimumHeight(30);
- lineEdit->setMaximumHeight(30);
- lineEdit->setFont(f);
- lineEdit->setFocus();
- lineEdit->setEnabled(false);
- lineEdit->setPlaceholderText("yosys>");
- connect(lineEdit, SIGNAL(textLineInserted(QString)), this, SLOT(editLineReturnPressed(QString)));
-
- QGridLayout *mainLayout = new QGridLayout();
- mainLayout->addWidget(console, 0, 0);
- mainLayout->addWidget(lineEdit, 1, 0);
- setLayout(mainLayout);
-
- process = new QProcess();
- connect(process, SIGNAL(readyReadStandardError()), this, SLOT(onReadyReadStandardError()));
- connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(onReadyReadStandardOutput()));
- connect(process, &QProcess::started, this, [this] { lineEdit->setEnabled(true); });
-/*
-#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
- connect(process, &QProcess::error, this, [this](QProcess::ProcessError error) {
-#else
- connect(process, &QProcess::errorOccurred, this, [this](QProcess::ProcessError error) {
-#endif
- if (error == QProcess::FailedToStart) {
- QMessageBox::critical(
- this, QString::fromUtf8("Yosys cannot be started!"),
- QString::fromUtf8("<p>Please make sure you have Yosys installed and available in path</p>"));
- Q_EMIT deleteLater();
- }
- });
-*/
- process->setWorkingDirectory(folder);
- process->start("yosys");
-}
-
-YosysTab::~YosysTab()
-{
- process->terminate();
- process->waitForFinished(1000); // in ms
- process->kill();
- process->close();
-}
-
-void YosysTab::displayString(QString text)
-{
- QTextCursor cursor = console->textCursor();
- cursor.movePosition(QTextCursor::End);
- cursor.insertText(text);
- cursor.movePosition(QTextCursor::End);
- console->setTextCursor(cursor);
-}
-
-void YosysTab::onReadyReadStandardOutput() { displayString(process->readAllStandardOutput()); }
-void YosysTab::onReadyReadStandardError() { displayString(process->readAllStandardError()); }
-
-void YosysTab::editLineReturnPressed(QString text) { process->write(text.toLatin1() + "\n"); }
-
-void YosysTab::showContextMenu(const QPoint &pt) { contextMenu->exec(mapToGlobal(pt)); }
-
-void YosysTab::clearBuffer() { console->clear(); }
-
-NEXTPNR_NAMESPACE_END
diff --git a/gui/yosystab.h b/gui/yosystab.h
deleted file mode 100644
index 1c668d15..00000000
--- a/gui/yosystab.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * nextpnr -- Next Generation Place and Route
- *
- * Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
- *
- * 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 YOSYSTAB_H
-#define YOSYSTAB_H
-
-#include <QLineEdit>
-#include <QMenu>
-#include <QPlainTextEdit>
-#include <QProcess>
-#include "nextpnr.h"
-#include "yosys_edit.h"
-
-NEXTPNR_NAMESPACE_BEGIN
-
-class YosysTab : public QWidget
-{
- Q_OBJECT
-
- public:
- explicit YosysTab(QString folder, QWidget *parent = 0);
- ~YosysTab();
-
- private:
- void displayString(QString text);
- private Q_SLOTS:
- void showContextMenu(const QPoint &pt);
- void editLineReturnPressed(QString text);
- void onReadyReadStandardOutput();
- void onReadyReadStandardError();
- public Q_SLOTS:
- void clearBuffer();
-
- private:
- QPlainTextEdit *console;
- YosysLineEditor *lineEdit;
- QMenu *contextMenu;
- QProcess *process;
-};
-
-NEXTPNR_NAMESPACE_END
-
-#endif // YOSYSTAB_H