Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into q3k/gl
@ -115,7 +115,7 @@ foreach (family ${FAMILIES})
|
||||
include(${family}/family.cmake)
|
||||
foreach (target ${family_targets})
|
||||
# Include family-specific source files to all family targets and set defines appropriately
|
||||
target_include_directories(${target} PRIVATE ${family}/ generated/ gui/${family}/)
|
||||
target_include_directories(${target} PRIVATE ${family}/ generated/ gui/${family}/ gui/)
|
||||
target_compile_definitions(${target} PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family} ARCH_${ufamily} ARCHNAME=${family} QT_NO_KEYWORDS)
|
||||
target_link_libraries(${target} LINK_PUBLIC gui_${family} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${GUI_LIBRARY_FILES_${ufamily}})
|
||||
endforeach (target)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Simulated annealing implementation based on arachne-pnr
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
@ -408,6 +408,7 @@ NEXTPNR_NAMESPACE_BEGIN
|
||||
bool route_design(Context *ctx)
|
||||
{
|
||||
try {
|
||||
int totalVisitCnt = 0, totalRevisitCnt = 0, totalOvertimeRevisitCnt = 0;
|
||||
delay_t ripup_penalty = ctx->getRipupDelayPenalty();
|
||||
RipupScoreboard scores;
|
||||
|
||||
@ -637,12 +638,22 @@ bool route_design(Context *ctx)
|
||||
"nets with ripup.\n",
|
||||
iterCnt, normalRouteCnt, int(ripupQueue.size()));
|
||||
|
||||
totalVisitCnt += visitCnt;
|
||||
totalRevisitCnt += revisitCnt;
|
||||
totalOvertimeRevisitCnt += overtimeRevisitCnt;
|
||||
|
||||
if (iterCnt == 8 || iterCnt == 16 || iterCnt == 32 ||
|
||||
iterCnt == 64 || iterCnt == 128)
|
||||
ripup_penalty += ctx->getRipupDelayPenalty();
|
||||
}
|
||||
|
||||
log_info("routing complete after %d iterations.\n", iterCnt);
|
||||
|
||||
log_info("visited %d PIPs (%.2f%% revisits, %.2f%% "
|
||||
"overtime revisits).\n",
|
||||
totalVisitCnt, (100.0 * totalRevisitCnt) / totalVisitCnt,
|
||||
(100.0 * totalOvertimeRevisitCnt) / totalVisitCnt);
|
||||
|
||||
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
||||
return true;
|
||||
} catch (log_execution_error_exception) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
@ -22,6 +22,7 @@
|
||||
#include <QApplication>
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#include <boost/program_options.hpp>
|
||||
#include "application.h"
|
||||
#include "log.h"
|
||||
#include "mainwindow.h"
|
||||
#include "nextpnr.h"
|
||||
@ -107,7 +108,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (vm.count("gui")) {
|
||||
QApplication a(argc, argv);
|
||||
Application a(argc, argv);
|
||||
MainWindow w(&ctx);
|
||||
w.show();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <dave@ds0.me>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* jsonparse.cc -- liberally copied from the yosys file of the same name by
|
||||
*
|
||||
* Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
47
gui/application.cc
Normal file
@ -0,0 +1,47 @@
|
||||
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
|
||||
* Copyright (C) 2018 Serge Bazanski <q3k@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 "application.h"
|
||||
#include <QMessageBox>
|
||||
#include <QSurfaceFormat>
|
||||
#include <exception>
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
Application::Application(int &argc, char **argv) : QApplication(argc, argv)
|
||||
{
|
||||
QSurfaceFormat fmt;
|
||||
fmt.setSamples(10);
|
||||
QSurfaceFormat::setDefaultFormat(fmt);
|
||||
}
|
||||
|
||||
bool Application::notify(QObject *receiver, QEvent *event)
|
||||
{
|
||||
bool retVal = true;
|
||||
try {
|
||||
retVal = QApplication::notify(receiver, event);
|
||||
} catch (...) {
|
||||
QMessageBox::critical(0, "Error", "Fatal error !!!");
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
38
gui/application.h
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Miodrag Milanovic <miodrag@symbioticeda.com>
|
||||
* Copyright (C) 2018 Serge Bazanski <q3k@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 APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <QApplication>
|
||||
#include "nextpnr.h"
|
||||
|
||||
NEXTPNR_NAMESPACE_BEGIN
|
||||
|
||||
class Application : public QApplication
|
||||
{
|
||||
public:
|
||||
Application(int &argc, char **argv);
|
||||
bool notify(QObject *receiver, QEvent *event);
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
||||
#endif // APPLICATION_H
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 <QAction>
|
||||
#include <QFileDialog>
|
||||
#include <QGridLayout>
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 BASEMAINWINDOW_H
|
||||
#define BASEMAINWINDOW_H
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 "designwidget.h"
|
||||
#include <QAction>
|
||||
#include <QGridLayout>
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 DESIGNWIDGET_H
|
||||
#define DESIGNWIDGET_H
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 "mainwindow.h"
|
||||
|
||||
static void initMainResource() { Q_INIT_RESOURCE(nextpnr); }
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 "mainwindow.h"
|
||||
#include <QAction>
|
||||
#include <QFileDialog>
|
||||
@ -26,6 +45,18 @@ MainWindow::MainWindow(Context *_ctx, QWidget *parent)
|
||||
task = new TaskManager(_ctx);
|
||||
connect(task, SIGNAL(log(std::string)), this, SLOT(writeInfo(std::string)));
|
||||
|
||||
connect(task, SIGNAL(loadfile_finished(bool)), this,
|
||||
SLOT(loadfile_finished(bool)));
|
||||
connect(task, SIGNAL(pack_finished(bool)), this, SLOT(pack_finished(bool)));
|
||||
connect(task, SIGNAL(place_finished(bool)), this,
|
||||
SLOT(place_finished(bool)));
|
||||
connect(task, SIGNAL(route_finished(bool)), this,
|
||||
SLOT(route_finished(bool)));
|
||||
|
||||
connect(task, SIGNAL(taskCanceled()), this, SLOT(taskCanceled()));
|
||||
connect(task, SIGNAL(taskStarted()), this, SLOT(taskStarted()));
|
||||
connect(task, SIGNAL(taskPaused()), this, SLOT(taskPaused()));
|
||||
|
||||
createMenu();
|
||||
}
|
||||
|
||||
@ -33,29 +64,67 @@ MainWindow::~MainWindow() { delete task; }
|
||||
|
||||
void MainWindow::createMenu()
|
||||
{
|
||||
QMenu *menu_Custom = new QMenu("&ICE 40", menuBar);
|
||||
menuBar->addAction(menu_Custom->menuAction());
|
||||
QMenu *menu_Design = new QMenu("&Design", menuBar);
|
||||
menuBar->addAction(menu_Design->menuAction());
|
||||
|
||||
QAction *actionPlay = new QAction("Play", this);
|
||||
QIcon icon1;
|
||||
icon1.addFile(QStringLiteral(":/icons/resources/control_play.png"));
|
||||
actionPlay->setIcon(icon1);
|
||||
actionPack = new QAction("Pack", this);
|
||||
QIcon iconPack;
|
||||
iconPack.addFile(QStringLiteral(":/icons/resources/pack.png"));
|
||||
actionPack->setIcon(iconPack);
|
||||
actionPack->setStatusTip("Pack current design");
|
||||
connect(actionPack, SIGNAL(triggered()), task, SIGNAL(pack()));
|
||||
actionPack->setEnabled(false);
|
||||
|
||||
actionPlace = new QAction("Place", this);
|
||||
QIcon iconPlace;
|
||||
iconPlace.addFile(QStringLiteral(":/icons/resources/place.png"));
|
||||
actionPlace->setIcon(iconPlace);
|
||||
actionPlace->setStatusTip("Place current design");
|
||||
connect(actionPlace, SIGNAL(triggered()), task, SIGNAL(place()));
|
||||
actionPlace->setEnabled(false);
|
||||
|
||||
actionRoute = new QAction("Route", this);
|
||||
QIcon iconRoute;
|
||||
iconRoute.addFile(QStringLiteral(":/icons/resources/route.png"));
|
||||
actionRoute->setIcon(iconRoute);
|
||||
actionRoute->setStatusTip("Route current design");
|
||||
connect(actionRoute, SIGNAL(triggered()), task, SIGNAL(route()));
|
||||
actionRoute->setEnabled(false);
|
||||
|
||||
QToolBar *taskFPGABar = new QToolBar();
|
||||
addToolBar(Qt::TopToolBarArea, taskFPGABar);
|
||||
|
||||
taskFPGABar->addAction(actionPack);
|
||||
taskFPGABar->addAction(actionPlace);
|
||||
taskFPGABar->addAction(actionRoute);
|
||||
|
||||
menu_Design->addAction(actionPack);
|
||||
menu_Design->addAction(actionPlace);
|
||||
menu_Design->addAction(actionRoute);
|
||||
|
||||
actionPlay = new QAction("Play", this);
|
||||
QIcon iconPlay;
|
||||
iconPlay.addFile(QStringLiteral(":/icons/resources/control_play.png"));
|
||||
actionPlay->setIcon(iconPlay);
|
||||
actionPlay->setStatusTip("Continue running task");
|
||||
connect(actionPlay, SIGNAL(triggered()), task, SLOT(continue_thread()));
|
||||
actionPlay->setEnabled(false);
|
||||
|
||||
QAction *actionPause = new QAction("Pause", this);
|
||||
QIcon icon2;
|
||||
icon2.addFile(QStringLiteral(":/icons/resources/control_pause.png"));
|
||||
actionPause->setIcon(icon2);
|
||||
actionPause = new QAction("Pause", this);
|
||||
QIcon iconPause;
|
||||
iconPause.addFile(QStringLiteral(":/icons/resources/control_pause.png"));
|
||||
actionPause->setIcon(iconPause);
|
||||
actionPause->setStatusTip("Pause running task");
|
||||
connect(actionPause, SIGNAL(triggered()), task, SLOT(pause_thread()));
|
||||
actionPause->setEnabled(false);
|
||||
|
||||
QAction *actionStop = new QAction("Stop", this);
|
||||
QIcon icon3;
|
||||
icon3.addFile(QStringLiteral(":/icons/resources/control_stop.png"));
|
||||
actionStop->setIcon(icon3);
|
||||
actionStop = new QAction("Stop", this);
|
||||
QIcon iconStop;
|
||||
iconStop.addFile(QStringLiteral(":/icons/resources/control_stop.png"));
|
||||
actionStop->setIcon(iconStop);
|
||||
actionStop->setStatusTip("Stop running task");
|
||||
connect(actionStop, SIGNAL(triggered()), task, SLOT(terminate_thread()));
|
||||
actionStop->setEnabled(false);
|
||||
|
||||
QToolBar *taskToolBar = new QToolBar();
|
||||
addToolBar(Qt::TopToolBarArea, taskToolBar);
|
||||
@ -73,10 +142,81 @@ void MainWindow::open()
|
||||
tabWidget->setCurrentWidget(info);
|
||||
|
||||
std::string fn = fileName.toStdString();
|
||||
Q_EMIT task->parsejson(fn);
|
||||
disableActions();
|
||||
Q_EMIT task->loadfile(fn);
|
||||
}
|
||||
}
|
||||
|
||||
bool MainWindow::save() { return false; }
|
||||
|
||||
void MainWindow::disableActions()
|
||||
{
|
||||
actionPack->setEnabled(false);
|
||||
actionPlace->setEnabled(false);
|
||||
actionRoute->setEnabled(false);
|
||||
|
||||
actionPlay->setEnabled(false);
|
||||
actionPause->setEnabled(false);
|
||||
actionStop->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindow::loadfile_finished(bool status)
|
||||
{
|
||||
disableActions();
|
||||
if (status) {
|
||||
log("Loading design successful.\n");
|
||||
actionPack->setEnabled(true);
|
||||
} else {
|
||||
log("Loading design failed.\n");
|
||||
}
|
||||
}
|
||||
void MainWindow::pack_finished(bool status)
|
||||
{
|
||||
disableActions();
|
||||
if (status) {
|
||||
log("Packing design successful.\n");
|
||||
actionPlace->setEnabled(true);
|
||||
} else {
|
||||
log("Packing design failed.\n");
|
||||
}
|
||||
}
|
||||
void MainWindow::place_finished(bool status)
|
||||
{
|
||||
disableActions();
|
||||
if (status) {
|
||||
log("Placing design successful.\n");
|
||||
actionRoute->setEnabled(true);
|
||||
} else {
|
||||
log("Placing design failed.\n");
|
||||
}
|
||||
}
|
||||
void MainWindow::route_finished(bool status)
|
||||
{
|
||||
disableActions();
|
||||
if (status)
|
||||
log("Routing design successful.\n");
|
||||
else
|
||||
log("Routing design failed.\n");
|
||||
}
|
||||
|
||||
void MainWindow::taskCanceled()
|
||||
{
|
||||
log("CANCELED\n");
|
||||
disableActions();
|
||||
}
|
||||
|
||||
void MainWindow::taskStarted()
|
||||
{
|
||||
disableActions();
|
||||
actionPause->setEnabled(true);
|
||||
actionStop->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::taskPaused()
|
||||
{
|
||||
disableActions();
|
||||
actionPlay->setEnabled(true);
|
||||
actionStop->setEnabled(true);
|
||||
}
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
@ -20,9 +39,25 @@ class MainWindow : public BaseMainWindow
|
||||
protected Q_SLOTS:
|
||||
virtual void open();
|
||||
virtual bool save();
|
||||
void loadfile_finished(bool status);
|
||||
void pack_finished(bool status);
|
||||
void place_finished(bool status);
|
||||
void route_finished(bool status);
|
||||
|
||||
void taskCanceled();
|
||||
void taskStarted();
|
||||
void taskPaused();
|
||||
|
||||
private:
|
||||
void disableActions();
|
||||
|
||||
TaskManager *task;
|
||||
QAction *actionPack;
|
||||
QAction *actionPlace;
|
||||
QAction *actionRoute;
|
||||
QAction *actionPlay;
|
||||
QAction *actionPause;
|
||||
QAction *actionStop;
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -3,5 +3,8 @@
|
||||
<file>resources/control_play.png</file>
|
||||
<file>resources/control_pause.png</file>
|
||||
<file>resources/control_stop.png</file>
|
||||
<file>resources/pack.png</file>
|
||||
<file>resources/place.png</file>
|
||||
<file>resources/route.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Before Width: | Height: | Size: 598 B After Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 592 B After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 403 B After Width: | Height: | Size: 695 B |
BIN
gui/ice40/resources/pack.png
Normal file
After Width: | Height: | Size: 853 B |
BIN
gui/ice40/resources/place.png
Normal file
After Width: | Height: | Size: 825 B |
BIN
gui/ice40/resources/route.png
Normal file
After Width: | Height: | Size: 683 B |
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 "worker.h"
|
||||
#include <fstream>
|
||||
#include "bitstream.h"
|
||||
@ -24,33 +43,61 @@ Worker::Worker(Context *_ctx, TaskManager *parent) : ctx(_ctx)
|
||||
parent->clearTerminate();
|
||||
throw WorkerInterruptionRequested();
|
||||
}
|
||||
if (parent->isPaused()) {
|
||||
Q_EMIT taskPaused();
|
||||
}
|
||||
while (parent->isPaused()) {
|
||||
if (parent->shouldTerminate()) {
|
||||
parent->clearTerminate();
|
||||
throw WorkerInterruptionRequested();
|
||||
}
|
||||
QThread::sleep(1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void Worker::parsejson(const std::string &filename)
|
||||
void Worker::loadfile(const std::string &filename)
|
||||
{
|
||||
Q_EMIT taskStarted();
|
||||
std::string fn = filename;
|
||||
std::ifstream f(fn);
|
||||
try {
|
||||
if (!parse_json_file(f, fn, ctx))
|
||||
log_error("Loading design failed.\n");
|
||||
if (!pack_design(ctx))
|
||||
log_error("Packing design failed.\n");
|
||||
Q_EMIT loadfile_finished(parse_json_file(f, fn, ctx));
|
||||
} catch (WorkerInterruptionRequested) {
|
||||
Q_EMIT taskCanceled();
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::pack()
|
||||
{
|
||||
Q_EMIT taskStarted();
|
||||
try {
|
||||
Q_EMIT pack_finished(pack_design(ctx));
|
||||
} catch (WorkerInterruptionRequested) {
|
||||
Q_EMIT taskCanceled();
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::place()
|
||||
{
|
||||
Q_EMIT taskStarted();
|
||||
try {
|
||||
double freq = 50e6;
|
||||
assign_budget(ctx, freq);
|
||||
print_utilisation(ctx);
|
||||
|
||||
if (!place_design_sa(ctx))
|
||||
log_error("Placing design failed.\n");
|
||||
if (!route_design(ctx))
|
||||
log_error("Routing design failed.\n");
|
||||
Q_EMIT log("DONE\n");
|
||||
} catch (log_execution_error_exception) {
|
||||
Q_EMIT place_finished(place_design_sa(ctx));
|
||||
} catch (WorkerInterruptionRequested) {
|
||||
Q_EMIT log("CANCELED\n");
|
||||
Q_EMIT taskCanceled();
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::route()
|
||||
{
|
||||
Q_EMIT taskStarted();
|
||||
try {
|
||||
Q_EMIT route_finished(route_design(ctx));
|
||||
} catch (WorkerInterruptionRequested) {
|
||||
Q_EMIT taskCanceled();
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,9 +105,27 @@ TaskManager::TaskManager(Context *ctx) : toTerminate(false), toPause(false)
|
||||
{
|
||||
Worker *worker = new Worker(ctx, this);
|
||||
worker->moveToThread(&workerThread);
|
||||
|
||||
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
|
||||
connect(this, &TaskManager::parsejson, worker, &Worker::parsejson);
|
||||
|
||||
connect(this, &TaskManager::loadfile, worker, &Worker::loadfile);
|
||||
connect(this, &TaskManager::pack, worker, &Worker::pack);
|
||||
connect(this, &TaskManager::place, worker, &Worker::place);
|
||||
connect(this, &TaskManager::route, worker, &Worker::route);
|
||||
|
||||
connect(worker, &Worker::log, this, &TaskManager::info);
|
||||
connect(worker, &Worker::loadfile_finished, this,
|
||||
&TaskManager::loadfile_finished);
|
||||
connect(worker, &Worker::pack_finished, this, &TaskManager::pack_finished);
|
||||
connect(worker, &Worker::place_finished, this,
|
||||
&TaskManager::place_finished);
|
||||
connect(worker, &Worker::route_finished, this,
|
||||
&TaskManager::route_finished);
|
||||
|
||||
connect(worker, &Worker::taskCanceled, this, &TaskManager::taskCanceled);
|
||||
connect(worker, &Worker::taskStarted, this, &TaskManager::taskStarted);
|
||||
connect(worker, &Worker::taskPaused, this, &TaskManager::taskPaused);
|
||||
|
||||
workerThread.start();
|
||||
}
|
||||
|
||||
@ -77,6 +142,7 @@ void TaskManager::info(const std::string &result) { Q_EMIT log(result); }
|
||||
void TaskManager::terminate_thread()
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
toPause = false;
|
||||
toTerminate = true;
|
||||
}
|
||||
|
||||
@ -102,7 +168,9 @@ void TaskManager::continue_thread()
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
toPause = false;
|
||||
Q_EMIT taskStarted();
|
||||
}
|
||||
|
||||
bool TaskManager::isPaused()
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 WORKER_H
|
||||
#define WORKER_H
|
||||
|
||||
@ -15,9 +34,19 @@ class Worker : public QObject
|
||||
public:
|
||||
Worker(Context *ctx, TaskManager *parent);
|
||||
public Q_SLOTS:
|
||||
void parsejson(const std::string &filename);
|
||||
void loadfile(const std::string &);
|
||||
void pack();
|
||||
void place();
|
||||
void route();
|
||||
Q_SIGNALS:
|
||||
void log(const std::string &text);
|
||||
void loadfile_finished(bool status);
|
||||
void pack_finished(bool status);
|
||||
void place_finished(bool status);
|
||||
void route_finished(bool status);
|
||||
void taskCanceled();
|
||||
void taskStarted();
|
||||
void taskPaused();
|
||||
|
||||
private:
|
||||
Context *ctx;
|
||||
@ -41,8 +70,20 @@ class TaskManager : public QObject
|
||||
void continue_thread();
|
||||
Q_SIGNALS:
|
||||
void terminate();
|
||||
void parsejson(const std::string &);
|
||||
void loadfile(const std::string &);
|
||||
void pack();
|
||||
void place();
|
||||
void route();
|
||||
|
||||
// redirected signals
|
||||
void log(const std::string &text);
|
||||
void loadfile_finished(bool status);
|
||||
void pack_finished(bool status);
|
||||
void place_finished(bool status);
|
||||
void route_finished(bool status);
|
||||
void taskCanceled();
|
||||
void taskStarted();
|
||||
void taskPaused();
|
||||
|
||||
private:
|
||||
QMutex mutex;
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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>
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 "line_editor.h"
|
||||
#include <QKeyEvent>
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 LINE_EDITOR_H
|
||||
#define LINE_EDITOR_H
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 "pythontab.h"
|
||||
#include <QGridLayout>
|
||||
#include "emb.h"
|
||||
|
@ -1,3 +1,22 @@
|
||||
/*
|
||||
* 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 PYTHONTAB_H
|
||||
#define PYTHONTAB_H
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
@ -166,6 +166,11 @@ enum TileType : uint32_t
|
||||
TILE_IO = 2,
|
||||
TILE_RAMB = 3,
|
||||
TILE_RAMT = 4,
|
||||
TILE_DSP0 = 5,
|
||||
TILE_DSP1 = 6,
|
||||
TILE_DSP2 = 7,
|
||||
TILE_DSP3 = 8,
|
||||
TILE_IPCON = 9
|
||||
};
|
||||
|
||||
struct ConfigBitPOD
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
@ -370,6 +370,21 @@ void write_asc(const Context *ctx, std::ostream &out)
|
||||
case TILE_RAMT:
|
||||
out << ".ramt_tile";
|
||||
break;
|
||||
case TILE_DSP0:
|
||||
out << ".dsp0_tile";
|
||||
break;
|
||||
case TILE_DSP1:
|
||||
out << ".dsp1_tile";
|
||||
break;
|
||||
case TILE_DSP2:
|
||||
out << ".dsp2_tile";
|
||||
break;
|
||||
case TILE_DSP3:
|
||||
out << ".dsp3_tile";
|
||||
break;
|
||||
case TILE_IPCON:
|
||||
out << ".ipcon_tile";
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -36,10 +36,6 @@ wire_names = dict()
|
||||
wire_names_r = dict()
|
||||
wire_xy = dict()
|
||||
|
||||
num_tile_types = 5
|
||||
tile_sizes = {i: (0, 0) for i in range(num_tile_types)}
|
||||
tile_bits = [[] for _ in range(num_tile_types)]
|
||||
|
||||
cbit_re = re.compile(r'B(\d+)\[(\d+)\]')
|
||||
|
||||
portpins = dict()
|
||||
@ -69,6 +65,11 @@ tiletypes["LOGIC"] = 1
|
||||
tiletypes["IO"] = 2
|
||||
tiletypes["RAMB"] = 3
|
||||
tiletypes["RAMT"] = 4
|
||||
tiletypes["DSP0"] = 5
|
||||
tiletypes["DSP1"] = 6
|
||||
tiletypes["DSP2"] = 7
|
||||
tiletypes["DSP3"] = 8
|
||||
tiletypes["IPCON"] = 9
|
||||
|
||||
wiretypes["LOCAL"] = 1
|
||||
wiretypes["GLOBAL"] = 2
|
||||
@ -187,6 +188,16 @@ def pipdelay(src, dst):
|
||||
# print(src, dst, src_type, dst_type, file=sys.stderr)
|
||||
assert 0
|
||||
|
||||
|
||||
def init_tiletypes(device):
|
||||
global num_tile_types, tile_sizes, tile_bits
|
||||
if device == "5k":
|
||||
num_tile_types = 10
|
||||
else:
|
||||
num_tile_types = 5
|
||||
tile_sizes = {i: (0, 0) for i in range(num_tile_types)}
|
||||
tile_bits = [[] for _ in range(num_tile_types)]
|
||||
|
||||
with open(sys.argv[1], "r") as f:
|
||||
mode = None
|
||||
|
||||
@ -198,6 +209,7 @@ with open(sys.argv[1], "r") as f:
|
||||
|
||||
if line[0] == ".device":
|
||||
dev_name = line[1]
|
||||
init_tiletypes(dev_name)
|
||||
dev_width = int(line[2])
|
||||
dev_height = int(line[3])
|
||||
num_wires = int(line[4])
|
||||
@ -237,6 +249,31 @@ with open(sys.argv[1], "r") as f:
|
||||
mode = None
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp0_tile":
|
||||
tiles[(int(line[1]), int(line[2]))] = "dsp0"
|
||||
mode = None
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp1_tile":
|
||||
tiles[(int(line[1]), int(line[2]))] = "dsp1"
|
||||
mode = None
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp2_tile":
|
||||
tiles[(int(line[1]), int(line[2]))] = "dsp2"
|
||||
mode = None
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp3_tile":
|
||||
tiles[(int(line[1]), int(line[2]))] = "dsp3"
|
||||
mode = None
|
||||
continue
|
||||
|
||||
if line[0] == ".ipcon_tile":
|
||||
tiles[(int(line[1]), int(line[2]))] = "ipcon"
|
||||
mode = None
|
||||
continue
|
||||
|
||||
if line[0] == ".logic_tile_bits":
|
||||
mode = ("bits", 1)
|
||||
tile_sizes[1] = (int(line[1]), int(line[2]))
|
||||
@ -257,6 +294,31 @@ with open(sys.argv[1], "r") as f:
|
||||
tile_sizes[4] = (int(line[1]), int(line[2]))
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp0_tile_bits":
|
||||
mode = ("bits", 5)
|
||||
tile_sizes[5] = (int(line[1]), int(line[2]))
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp1_tile_bits":
|
||||
mode = ("bits", 6)
|
||||
tile_sizes[6] = (int(line[1]), int(line[2]))
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp2_tile_bits":
|
||||
mode = ("bits", 7)
|
||||
tile_sizes[7] = (int(line[1]), int(line[2]))
|
||||
continue
|
||||
|
||||
if line[0] == ".dsp3_tile_bits":
|
||||
mode = ("bits", 8)
|
||||
tile_sizes[8] = (int(line[1]), int(line[2]))
|
||||
continue
|
||||
|
||||
if line[0] == ".ipcon_tile_bits":
|
||||
mode = ("bits", 9)
|
||||
tile_sizes[9] = (int(line[1]), int(line[2]))
|
||||
continue
|
||||
|
||||
if line[0] == ".ieren":
|
||||
mode = ("ieren",)
|
||||
continue
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@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
|
||||
@ -25,6 +25,7 @@
|
||||
#include <boost/program_options.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include "application.h"
|
||||
#include "bitstream.h"
|
||||
#include "design_utils.h"
|
||||
#include "jsonparse.h"
|
||||
@ -330,10 +331,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (vm.count("gui")) {
|
||||
QApplication a(argc, argv);
|
||||
QSurfaceFormat fmt;
|
||||
fmt.setSamples(10);
|
||||
QSurfaceFormat::setDefaultFormat(fmt);
|
||||
Application a(argc, argv);
|
||||
MainWindow w(&ctx);
|
||||
w.show();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* nextpnr -- Next Generation Place and Route
|
||||
*
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@clifford.at>
|
||||
* Copyright (C) 2018 Clifford Wolf <clifford@symbioticeda.com>
|
||||
* Copyright (C) 2018 David Shah <david@symbioticeda.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
|