From 9b98a7175be440a6a59ddcc022615e04b8538bda Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 21 Jun 2018 20:41:20 +0200 Subject: [PATCH 1/6] Add total visit counts to router log output Signed-off-by: Clifford Wolf --- common/route.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/route.cc b/common/route.cc index 967f9aa1..29b94b8a 100644 --- a/common/route.cc +++ b/common/route.cc @@ -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) { From 56c09fc5e5f7fb5c299f7a0b52e839556146615d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 22 Jun 2018 15:35:07 +0200 Subject: [PATCH 2/6] routing flow supported in gui --- gui/ice40/mainwindow.cc | 151 +++++++++++++++++++++++--- gui/ice40/mainwindow.h | 16 +++ gui/ice40/nextpnr.qrc | 3 + gui/ice40/resources/control_pause.png | Bin 598 -> 721 bytes gui/ice40/resources/control_play.png | Bin 592 -> 717 bytes gui/ice40/resources/control_stop.png | Bin 403 -> 695 bytes gui/ice40/resources/pack.png | Bin 0 -> 853 bytes gui/ice40/resources/place.png | Bin 0 -> 825 bytes gui/ice40/resources/route.png | Bin 0 -> 683 bytes gui/ice40/worker.cc | 76 ++++++++++--- gui/ice40/worker.h | 26 ++++- 11 files changed, 241 insertions(+), 31 deletions(-) create mode 100644 gui/ice40/resources/pack.png create mode 100644 gui/ice40/resources/place.png create mode 100644 gui/ice40/resources/route.png diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 4c7bc18f..0a248938 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -26,6 +26,15 @@ 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 +42,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 +120,84 @@ 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 \ No newline at end of file diff --git a/gui/ice40/mainwindow.h b/gui/ice40/mainwindow.h index 712f341a..9083ed8a 100644 --- a/gui/ice40/mainwindow.h +++ b/gui/ice40/mainwindow.h @@ -20,9 +20,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 diff --git a/gui/ice40/nextpnr.qrc b/gui/ice40/nextpnr.qrc index cbdb8b26..3bc68978 100644 --- a/gui/ice40/nextpnr.qrc +++ b/gui/ice40/nextpnr.qrc @@ -3,5 +3,8 @@ resources/control_play.png resources/control_pause.png resources/control_stop.png + resources/pack.png + resources/place.png + resources/route.png diff --git a/gui/ice40/resources/control_pause.png b/gui/ice40/resources/control_pause.png index 2d9ce9c4ec4b787b77e2407809c8887b6252dc6e..ec61099b0b82dcbb0277392c855aa5ed5b17a6d9 100644 GIT binary patch delta 644 zcmV-~0(&g!N+a58VemLQ$WB14uxSH28PQ}j&nYk5idI@c^C8L zyw7>hcbNcyiE*8Cfk~4^lU38yNY>Gs>CgIc;~7onyDueM;D6&W9obJa2Z=)=&L)N3 zy%h6eCr3~F>o%;x+TQ>p^I2c0Y>yviIld-=tn@%V9S}8IT_{!R5Z+_Ch0UxTYjubY zFr%4GeU;lC74TEKeW=Sl5HvMAeX=GiUD%DrWY78$Ld*n!b75@ktedM+7b-uxz>7nb z#SWC}9Rsqt6@TV#ukbjI2?3S>^Nq&Xy7}UR5ZrPn4fEve4qSI7NE-Z7x$i*vBQ$yu zU=4pcVsK`Rilz(q5s)BVi$YriY!g7O(F3Wa!ilKB;_7P#y$G0!9V7(YEG$3(cD$hh zj%#hAN&7Zjn`cQn{O_u#u;N`6&`SXOah3qE0K4juv46NwZNvF{LAXi}0r)Sqda$_k z+yGcVd`>c=+<}Io4m*;_EaXoV$W;^#@SXs0WAS9tMG+{E*BHU#4QA*#4=Fe zC9)?tb22Z$Mko$*)B-o{eDn8J9)C=ll~HKMZqmBK4L400004Y*#fD()@Z8_{UAXRf!H8DO)5c}|if+39qG-G6T9=llI0*6TIQX0twm zlwz@1Su_y<#c()O27`fy#f%p1x~?-#)7Wme<7b=AhIKj}t=(=bMjvNzr~MuZg=Ct# zTCD`Id5F*FgY9+;-ENndyrfd8-V+sIk|x?lbD>axN~J2Ai^W%{R^I>_0Z9u6gEF#7 z3lqsO`axO|41aEe+5MaGZvzY)!Rz%>ZIaFm1`(QmI2;}*8vul1oDqP_<%0A191#F! zt<-e;el*!!b37j5bUJ~VflB7sY_>Z96B0i2TQf;rE|&zL3V_Sy(jtQ#4hJuiB;SJs za^GMMG2iA17@ zu9onU=tR%s@qpE8<)+e3LCts*q1kNe=s^iVd*7~dyYuW6o&f){000DSh{q>u9_~oGjU_W#>7Qa zS0y#oMPmwKEKy9G)&?pOYpS-Xky_~#ifJq#r3@be7U)oz!C_!v7|L3^Cs_R z<~;BDxaW=mz}Tp6EP_FmNtIdEDb9B7mX*l z{i7uPYA;7kd3g)QVC)rxA$;8vC|jeaS%$3%AWB_OF8f4{mJFo|55c22v$T`7VytGO z85j|cC%=pBjskcjxd*)11x{77(<9$RNrwG!M09PX(8Nd#urDkdGiz{FkfHKZhPUAg zuyq;A^$wKyj(={lvm0dYt+CjS0S!z(`Uiz&kHQGvdKiF>!wP}VYHcDs$=o?Oyder% zG%yFhrD*IKOGQx2dUJM<=yixCaG}};p{2k@U4rHHcQmqSFd2!Ra5$`5qf21SSmfF& z{F!LtQ3(7o4ssQV7|F^dthv`YWQoCXG)@e#d=17x0)NjP!1#=x{L8Y^u!=4$ue{U^ z%wN7H=(^Z}hNS4dV&KFaeFe^(x5&+;i*<0g+}zD+$@T%jFLo!o+*;vU;v^t8=K-KLWNeoX)K aoPPlwcokR7!k#4n0000 delta 514 zcmV+d0{#8X1<(YLSbqWHNklIKwavMMAp2zpDP~d=Syc|HL03`u)Dt>-Ds5 zx2tzL9fL7uv|25_*=%a{dR_WffWtC}*?PUE^Z87V$3w*Fbbq47VnMZ9ja4cY`AdOM z*t}k^goWqfa3Iq(>2kS^`CKEB4;c!UdaQM{%pRb0^=kqDR z`Ft+QRTM?Q*c*?>G#ZWQe!o+(SfpSu_%e~tRVow;40|46AsYg)1tKdF;GM&ahxB%l zGMS8=PNz+{kAuhK(XIxU37H|nLDT2+$zNXOWHKqo<8j7Y5-q?J^o+ST1Gfc`83+ad001BJ|6!3KH-7?2NklYuW6o&f){000DSh{pW zqWdOBP28BUF>%qfx*={{G^UUlOBB25T@GDNUDIPZ$9J|r<0ru@y6kgrWPexq z(f*WH^6Vt$sa4Pdn>Gm|hqxOd&DgzL7wR=Nyr>K3{Pb3xpRu)a{!~pxk zvN5v>H{?FlfAoQu4ArC_RK=cUvVXG|j$fk$^mXB~n=vwggxd`0yuu$MtBBP1{EPt=OvJ9Lb zzoZ#S=|M}?tX?rIf~cDdhC%+ULtZ9Vk%00CtQH)B-8@~cHeoaZlEEz3%!**H)`4ub z1B2lR_CBYW39ubyVV+vz zX1wqIUggQpbnj)!_4vg${d94Kp`Q7K1urc;@%WipPnf<#XDPx#07*qoM6N<$f)r3HO8@`> delta 336 zcmV-W0k8hI1(O4i83+Ub006c6H|migH-7;oNklm3YgTot7F)m$AE(JC>37%jK%YTdz zc}1IZ;f0opGWdxBx;Rl@XzG}46S&UgQ6wI6lQE987w+r=Q{sp)?}bM^Pp<+NZM|j7 iwxl;zS^RpJD+a= diff --git a/gui/ice40/resources/pack.png b/gui/ice40/resources/pack.png new file mode 100644 index 0000000000000000000000000000000000000000..da3c2a2d74bab159ba0f65d7db601768258afcb2 GIT binary patch literal 853 zcmV-b1FHOqP)5TQ^(M5v$(QKVE?W+9X! z*o}&~6c?_FreF)9NJB7b5Nbn{G0n4+%uJhR9(V5R|NFTpb|HgjefT!tIhLx@DR+N) zV+fHiR5Yt19}k|KnCsND{tH-`IMJ)3AE?OtyZ4>Un|6(d%h#JK`i&a7^xW9>`yBy` zS4SOHeOpC7$?hH5-#7Rswiue_8Ju*2N@$58=a#2OTA3png`w3v->gWif7t%e$ z$NLVS!tFT#8WL|Wa&K~+{%4P2cRfwesYV1_!F=3OaRVHl(>=`%&{x*s30c}#CNE@&;ItrAv!f!)Oy$Q9t$uS=(sD$-J{T*^(8Eez1E-l3}} zPrfHZ1`qsIFe&gipuL8-IZbo2Yg{lFGKs?ZZWcOaOdk*3`5T;$?AjbG1#`B510Er^h2)2r3Y{!8_2Gj=$KzuN5 zaErtW8W_Y2iJJjY)5pmTVJoPJYpanPOEuYHclM^C1F>${hFRpdi8a<2H|Xudf78bm(zwJ9`K%6I?q*Ua~ fW9JvIbn5*B+_J)rUMBs>00000NkvXXu0mjfH&TkY literal 0 HcmV?d00001 diff --git a/gui/ice40/resources/place.png b/gui/ice40/resources/place.png new file mode 100644 index 0000000000000000000000000000000000000000..0905f933b87ab32f21098d7db8d603209730c753 GIT binary patch literal 825 zcmV-91IGM`P)wd|HNMlZ|>D)M67h? zOIjz3DJbk0=97q(mSBd~-ilc0Oupt^z$#N6O&at_s8u-PL@9M^gQuq(+UH^IB$&*DHP!HzH+vkEzC?S52tN1$mKhziPkOR=y$ zhl#aO1Xly_M?EkN>tM6E5T&Ht4dh{0oQr6Q1b3J=sM^ACOsvD=TSP81#0oTC1v|Df zgpp-GhL(KrE_8t&(jeFR1W%(osQ12tvSpHp_}~HR_8G{VUO;FILQv(P-b)es=)ZlJM#c>{Wx-rgY3D#Ol9rJl39A<60Xo5cneo(9g5a4q>ayzV-7%Ue2}0_ z&TIets{Cl`n(nefrZ+9F8|N&Kp}^StU2b+&pVj;XvgEdBL3Wlp00000NkvXXu0mjf DwZ3{L literal 0 HcmV?d00001 diff --git a/gui/ice40/resources/route.png b/gui/ice40/resources/route.png new file mode 100644 index 0000000000000000000000000000000000000000..258c16c63a20f7474764507475af7961ecf4263a GIT binary patch literal 683 zcmV;c0#yBpP)A3WJ2dfsV78ToP)wU4~UJxT^#Yl8pW;T)B2y+W_BqqmW z&#t|w0SE!KR$a#7aL!?!V{G>0(f7&GF0n$i_yAiovkXpE$M|c8KDe}2*w(W8jK3Y2*x)V03j=u2XF48q6F<0_UD&z zFmi~T?K=p$491faq~>RsPR$VB89_xzOpK2V+=|x$1lD3~x!;g2Mz5ELE831k>xd528II@{FM*4t5cwMI2$KMmfFm;RN43xW+e;$tzEyd|PV<@i4gUfKh|U-I$hymfQ} zt?kWDj37pE;wZ>1WHG%+SvbnRqEaTN#u*-slSm{u7_C6WGBh|el4$>24G=QE;Y9f< z)G2BOvC3T5Jn;{4ig%R|E{ITA5W$|ds8uW$Z^f(HeLnnp>dACn(D>^wEGjH6Et2~F zjpx1H%%|rOCx{iqDPk27MT{DNK*OCgPK;oDLHt!jVx&(zZS&Lq>Ld9Y&Ck!LvbvJw zmn1{|Z(}o^vo(KE_?LclearTerminate(); 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(); + } +} + + 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 +122,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 +148,9 @@ void TaskManager::continue_thread() { QMutexLocker locker(&mutex); toPause = false; + Q_EMIT taskStarted(); } + bool TaskManager::isPaused() { QMutexLocker locker(&mutex); diff --git a/gui/ice40/worker.h b/gui/ice40/worker.h index 181fafa3..320dc94c 100644 --- a/gui/ice40/worker.h +++ b/gui/ice40/worker.h @@ -15,9 +15,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 +51,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; From aa81f9d648e4d699249e6f47e732bcd50b6b08ba Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 22 Jun 2018 16:19:17 +0200 Subject: [PATCH 3/6] Switched from clifford@clifford.at to clifford@symbioticeda.com for copyright headers Signed-off-by: Clifford Wolf --- common/design_utils.cc | 2 +- common/design_utils.h | 2 +- common/log.cc | 2 +- common/log.h | 2 +- common/nextpnr.cc | 2 +- common/nextpnr.h | 2 +- common/place_sa.cc | 2 +- common/place_sa.h | 2 +- common/pybindings.cc | 2 +- common/pybindings.h | 2 +- common/pycontainers.h | 2 +- common/route.cc | 2 +- common/route.h | 2 +- dummy/arch.cc | 2 +- dummy/arch.h | 2 +- dummy/arch_place.cc | 2 +- dummy/arch_place.h | 2 +- dummy/main.cc | 2 +- dummy/pybindings.cc | 2 +- frontend/json/jsonparse.cc | 2 +- ice40/arch.cc | 2 +- ice40/arch.h | 2 +- ice40/arch_place.cc | 2 +- ice40/arch_place.h | 2 +- ice40/bitstream.cc | 2 +- ice40/bitstream.h | 2 +- ice40/cells.cc | 2 +- ice40/cells.h | 2 +- ice40/main.cc | 2 +- ice40/pack.cc | 2 +- ice40/pack.h | 2 +- ice40/pcf.cc | 2 +- ice40/pcf.h | 2 +- ice40/pybindings.cc | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/common/design_utils.cc b/common/design_utils.cc index 92533fa3..28237b35 100644 --- a/common/design_utils.cc +++ b/common/design_utils.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/common/design_utils.h b/common/design_utils.h index d7f0b733..13e4ec1d 100644 --- a/common/design_utils.h +++ b/common/design_utils.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/common/log.cc b/common/log.cc index 495f83b1..73c764a4 100644 --- a/common/log.cc +++ b/common/log.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2012 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/common/log.h b/common/log.h index 65b3f178..ca936745 100644 --- a/common/log.h +++ b/common/log.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2012 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/common/nextpnr.cc b/common/nextpnr.cc index b24f66ea..d29d3fec 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/common/nextpnr.h b/common/nextpnr.h index 1cf0cbbb..9c6c9d68 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/common/place_sa.cc b/common/place_sa.cc index 058f0a84..7a876256 100644 --- a/common/place_sa.cc +++ b/common/place_sa.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Simulated annealing implementation based on arachne-pnr diff --git a/common/place_sa.h b/common/place_sa.h index 3c49c031..1fd8c712 100644 --- a/common/place_sa.h +++ b/common/place_sa.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/common/pybindings.cc b/common/pybindings.cc index 02dc2395..a9c32c1c 100644 --- a/common/pybindings.cc +++ b/common/pybindings.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/common/pybindings.h b/common/pybindings.h index 7616c055..4379a1aa 100644 --- a/common/pybindings.h +++ b/common/pybindings.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/common/pycontainers.h b/common/pycontainers.h index 9160dfb6..06e772a0 100644 --- a/common/pycontainers.h +++ b/common/pycontainers.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/common/route.cc b/common/route.cc index 29b94b8a..a60f1c41 100644 --- a/common/route.cc +++ b/common/route.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/common/route.h b/common/route.h index af0de42e..7a7260f5 100644 --- a/common/route.h +++ b/common/route.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/dummy/arch.cc b/dummy/arch.cc index 0ed0f11e..64c0ca1e 100644 --- a/dummy/arch.cc +++ b/dummy/arch.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/dummy/arch.h b/dummy/arch.h index d8068b22..5bdf633e 100644 --- a/dummy/arch.h +++ b/dummy/arch.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/dummy/arch_place.cc b/dummy/arch_place.cc index f35cb6fe..e4881329 100644 --- a/dummy/arch_place.cc +++ b/dummy/arch_place.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/dummy/arch_place.h b/dummy/arch_place.h index 1111ac42..213472d9 100644 --- a/dummy/arch_place.h +++ b/dummy/arch_place.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/dummy/main.cc b/dummy/main.cc index 110c5b6c..b6caa4c1 100644 --- a/dummy/main.cc +++ b/dummy/main.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/dummy/pybindings.cc b/dummy/pybindings.cc index 87716267..59bf402f 100644 --- a/dummy/pybindings.cc +++ b/dummy/pybindings.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/frontend/json/jsonparse.cc b/frontend/json/jsonparse.cc index a832e9e5..eba6b6f1 100644 --- a/frontend/json/jsonparse.cc +++ b/frontend/json/jsonparse.cc @@ -5,7 +5,7 @@ * * jsonparse.cc -- liberally copied from the yosys file of the same name by * - * Copyright (C) 2012 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ice40/arch.cc b/ice40/arch.cc index 963b5994..f14c8045 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ice40/arch.h b/ice40/arch.h index f3a46f5c..2433396e 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index c607c9c6..25044525 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/arch_place.h b/ice40/arch_place.h index d276b9c4..339bf485 100644 --- a/ice40/arch_place.h +++ b/ice40/arch_place.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc index e722cea4..0fa57410 100644 --- a/ice40/bitstream.cc +++ b/ice40/bitstream.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/bitstream.h b/ice40/bitstream.h index 4dcb79bc..2b6cda1d 100644 --- a/ice40/bitstream.h +++ b/ice40/bitstream.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/cells.cc b/ice40/cells.cc index c2bc4609..3f94d4ba 100644 --- a/ice40/cells.cc +++ b/ice40/cells.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/cells.h b/ice40/cells.h index 36c1ba19..b1f3d516 100644 --- a/ice40/cells.h +++ b/ice40/cells.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/main.cc b/ice40/main.cc index 9e925148..8db95e73 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ice40/pack.cc b/ice40/pack.cc index 35cef8b8..e9f02ddf 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/pack.h b/ice40/pack.h index 92b76653..cdebdd79 100644 --- a/ice40/pack.h +++ b/ice40/pack.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/pcf.cc b/ice40/pcf.cc index 87d27ff1..13fe199e 100644 --- a/ice40/pcf.cc +++ b/ice40/pcf.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/pcf.h b/ice40/pcf.h index b86a7609..315f6270 100644 --- a/ice40/pcf.h +++ b/ice40/pcf.h @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any diff --git a/ice40/pybindings.cc b/ice40/pybindings.cc index 6ce35583..97eebd3e 100644 --- a/ice40/pybindings.cc +++ b/ice40/pybindings.cc @@ -1,7 +1,7 @@ /* * nextpnr -- Next Generation Place and Route * - * Copyright (C) 2018 Clifford Wolf + * Copyright (C) 2018 Clifford Wolf * Copyright (C) 2018 David Shah * * Permission to use, copy, modify, and/or distribute this software for any From b4764031d9c4d9b9fe57e733645f96383f620fde Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 22 Jun 2018 16:21:20 +0200 Subject: [PATCH 4/6] Added credits --- gui/basewindow.cc | 19 +++++++++++++++++++ gui/basewindow.h | 19 +++++++++++++++++++ gui/designwidget.cc | 19 +++++++++++++++++++ gui/designwidget.h | 19 +++++++++++++++++++ gui/dummy/mainwindow.cc | 19 +++++++++++++++++++ gui/dummy/mainwindow.h | 19 +++++++++++++++++++ gui/ice40/mainwindow.cc | 19 +++++++++++++++++++ gui/ice40/mainwindow.h | 19 +++++++++++++++++++ gui/ice40/worker.cc | 19 +++++++++++++++++++ gui/ice40/worker.h | 19 +++++++++++++++++++ gui/infotab.cc | 19 +++++++++++++++++++ gui/infotab.h | 19 +++++++++++++++++++ gui/line_editor.cc | 19 +++++++++++++++++++ gui/line_editor.h | 19 +++++++++++++++++++ gui/pythontab.cc | 19 +++++++++++++++++++ gui/pythontab.h | 19 +++++++++++++++++++ 16 files changed, 304 insertions(+) diff --git a/gui/basewindow.cc b/gui/basewindow.cc index f16b205d..ac28e95f 100644 --- a/gui/basewindow.cc +++ b/gui/basewindow.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 #include #include diff --git a/gui/basewindow.h b/gui/basewindow.h index 55e4affc..f4ca5129 100644 --- a/gui/basewindow.h +++ b/gui/basewindow.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 7b1ce543..cc161c9e 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 #include diff --git a/gui/designwidget.h b/gui/designwidget.h index 5bd12d4d..498e73d7 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/dummy/mainwindow.cc b/gui/dummy/mainwindow.cc index da162dd0..354b86ed 100644 --- a/gui/dummy/mainwindow.cc +++ b/gui/dummy/mainwindow.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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); } diff --git a/gui/dummy/mainwindow.h b/gui/dummy/mainwindow.h index c2786906..f16b7ad3 100644 --- a/gui/dummy/mainwindow.h +++ b/gui/dummy/mainwindow.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 0a248938..bd7cb091 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 #include diff --git a/gui/ice40/mainwindow.h b/gui/ice40/mainwindow.h index 9083ed8a..376cb901 100644 --- a/gui/ice40/mainwindow.h +++ b/gui/ice40/mainwindow.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc index 9df24f65..0c0f800c 100644 --- a/gui/ice40/worker.cc +++ b/gui/ice40/worker.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 #include "bitstream.h" diff --git a/gui/ice40/worker.h b/gui/ice40/worker.h index 320dc94c..ae4dd146 100644 --- a/gui/ice40/worker.h +++ b/gui/ice40/worker.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/infotab.cc b/gui/infotab.cc index 29d557d2..9127bd06 100644 --- a/gui/infotab.cc +++ b/gui/infotab.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/infotab.h b/gui/infotab.h index 3e0220c4..0116755e 100644 --- a/gui/infotab.h +++ b/gui/infotab.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/line_editor.cc b/gui/line_editor.cc index 6299c9cc..d4be9d3a 100644 --- a/gui/line_editor.cc +++ b/gui/line_editor.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/line_editor.h b/gui/line_editor.h index 5f27e502..91837182 100644 --- a/gui/line_editor.h +++ b/gui/line_editor.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 diff --git a/gui/pythontab.cc b/gui/pythontab.cc index 19aa0162..531038a1 100644 --- a/gui/pythontab.cc +++ b/gui/pythontab.cc @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 #include "emb.h" diff --git a/gui/pythontab.h b/gui/pythontab.h index 52a8ff8d..f37381d7 100644 --- a/gui/pythontab.h +++ b/gui/pythontab.h @@ -1,3 +1,22 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * + * 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 From cf78f1b0e4b937406471d2d44a74a9fba8e8c657 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 22 Jun 2018 16:40:22 +0200 Subject: [PATCH 5/6] ice40: Add UltraPlus tiles to database Signed-off-by: David Shah --- ice40/arch.h | 5 ++++ ice40/bitstream.cc | 15 ++++++++++ ice40/chipdb.py | 70 +++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 86 insertions(+), 4 deletions(-) diff --git a/ice40/arch.h b/ice40/arch.h index 2433396e..66292783 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -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 diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc index 0fa57410..165971aa 100644 --- a/ice40/bitstream.cc +++ b/ice40/bitstream.cc @@ -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); } diff --git a/ice40/chipdb.py b/ice40/chipdb.py index fe25c1f1..100aaa6f 100644 --- a/ice40/chipdb.py +++ b/ice40/chipdb.py @@ -36,10 +36,6 @@ wire_names = dict() wire_names_r = dict() wire_xy = dict() -num_tile_types = 5 -tile_sizes = {_: (0, 0) for _ 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 = {_: (0, 0) for _ 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 From e5bd4764b27c86fa804700b18bcac5cf18815314 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 22 Jun 2018 16:48:56 +0200 Subject: [PATCH 6/6] Added custom QApplication implementation --- CMakeLists.txt | 2 +- dummy/main.cc | 3 ++- gui/application.cc | 47 +++++++++++++++++++++++++++++++++++++++++ gui/application.h | 38 +++++++++++++++++++++++++++++++++ gui/ice40/mainwindow.cc | 24 ++++++++++----------- gui/ice40/mainwindow.h | 4 ++-- gui/ice40/worker.cc | 19 +++++++++-------- ice40/main.cc | 3 ++- 8 files changed, 114 insertions(+), 26 deletions(-) create mode 100644 gui/application.cc create mode 100644 gui/application.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a64369f..1b05d296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/dummy/main.cc b/dummy/main.cc index b6caa4c1..fa1259d4 100644 --- a/dummy/main.cc +++ b/dummy/main.cc @@ -22,6 +22,7 @@ #include #include #include +#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(); diff --git a/gui/application.cc b/gui/application.cc new file mode 100644 index 00000000..eaabeefb --- /dev/null +++ b/gui/application.cc @@ -0,0 +1,47 @@ + +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * Copyright (C) 2018 Serge Bazanski + * + * 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 +#include +#include + +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 diff --git a/gui/application.h b/gui/application.h new file mode 100644 index 00000000..321f6b65 --- /dev/null +++ b/gui/application.h @@ -0,0 +1,38 @@ +/* + * nextpnr -- Next Generation Place and Route + * + * Copyright (C) 2018 Miodrag Milanovic + * Copyright (C) 2018 Serge Bazanski + * + * 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 +#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 \ No newline at end of file diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index bd7cb091..a0739f92 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -45,14 +45,17 @@ 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(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(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())); + connect(task, SIGNAL(taskPaused()), this, SLOT(taskPaused())); createMenu(); } @@ -146,7 +149,7 @@ void MainWindow::open() bool MainWindow::save() { return false; } -void MainWindow::disableActions() +void MainWindow::disableActions() { actionPack->setEnabled(false); actionPlace->setEnabled(false); @@ -163,8 +166,7 @@ void MainWindow::loadfile_finished(bool status) if (status) { log("Loading design successful.\n"); actionPack->setEnabled(true); - } - else { + } else { log("Loading design failed.\n"); } } @@ -174,8 +176,7 @@ void MainWindow::pack_finished(bool status) if (status) { log("Packing design successful.\n"); actionPlace->setEnabled(true); - } - else { + } else { log("Packing design failed.\n"); } } @@ -185,8 +186,7 @@ void MainWindow::place_finished(bool status) if (status) { log("Placing design successful.\n"); actionRoute->setEnabled(true); - } - else { + } else { log("Placing design failed.\n"); } } @@ -216,7 +216,7 @@ void MainWindow::taskPaused() { disableActions(); actionPlay->setEnabled(true); - actionStop->setEnabled(true); + actionStop->setEnabled(true); } NEXTPNR_NAMESPACE_END \ No newline at end of file diff --git a/gui/ice40/mainwindow.h b/gui/ice40/mainwindow.h index 376cb901..c0c4bef8 100644 --- a/gui/ice40/mainwindow.h +++ b/gui/ice40/mainwindow.h @@ -43,7 +43,7 @@ class MainWindow : public BaseMainWindow void pack_finished(bool status); void place_finished(bool status); void route_finished(bool status); - + void taskCanceled(); void taskStarted(); void taskPaused(); @@ -57,7 +57,7 @@ class MainWindow : public BaseMainWindow QAction *actionRoute; QAction *actionPlay; QAction *actionPause; - QAction *actionStop; + QAction *actionStop; }; NEXTPNR_NAMESPACE_END diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc index 0c0f800c..ecf473ce 100644 --- a/gui/ice40/worker.cc +++ b/gui/ice40/worker.cc @@ -43,8 +43,7 @@ Worker::Worker(Context *_ctx, TaskManager *parent) : ctx(_ctx) parent->clearTerminate(); throw WorkerInterruptionRequested(); } - if (parent->isPaused()) - { + if (parent->isPaused()) { Q_EMIT taskPaused(); } while (parent->isPaused()) { @@ -102,25 +101,27 @@ void Worker::route() } } - 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::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::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::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); diff --git a/ice40/main.cc b/ice40/main.cc index 8db95e73..8ae9ccf0 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -24,6 +24,7 @@ #include #include #include +#include "application.h" #include "bitstream.h" #include "design_utils.h" #include "jsonparse.h" @@ -329,7 +330,7 @@ int main(int argc, char *argv[]) } if (vm.count("gui")) { - QApplication a(argc, argv); + Application a(argc, argv); MainWindow w(&ctx); w.show();