HAL
module_info_table.cpp
Go to the documentation of this file.
2 
4 
5 #include "gui/gui_globals.h"
13 
14 #include <QMenu>
15 #include <QInputDialog>
16 
17 namespace hal
18 {
19  const QString ModuleInfoTable::nameRowKey = "Name";
20  const QString ModuleInfoTable::idRowKey = "ID";
21  const QString ModuleInfoTable::typeRowKey = "Type";
22  const QString ModuleInfoTable::moduleRowKey = "Parent";
23  const QString ModuleInfoTable::noOfAllGatesRowKey = "Total number of gates";
24  const QString ModuleInfoTable::noOfDirectGatesRowKey = "Number of direct member gates";
25  const QString ModuleInfoTable::noOfGatesInSubmodulesRowKey = "Number of gates in submodules";
26  const QString ModuleInfoTable::noOfModulesRowKey = "Number of submodules";
27  const QString ModuleInfoTable::noOfNetsRowKey = "Number of nets";
28  const QString ModuleInfoTable::noOfPinsKey = "Number of pins";
29  const QString ModuleInfoTable::noOfPinGroupsKey = "Number of pin groups";
30  const QString ModuleInfoTable::noOfInputNetsKey = "Number of inputs";
31  const QString ModuleInfoTable::noOfOutputNetsKey = "Number of outputs";
32  const QString ModuleInfoTable::noOfInternalNetsKey = "Number of internal nets";
33  const QString ModuleInfoTable::isTopModuleKey = "Is top module?";
34 
35  ModuleInfoTable::ModuleInfoTable(QWidget* parent) : GeneralTableWidget(parent), mModule(nullptr), mPyIcon(":/icons/python")
36  {
37  mNameEntryContextMenu = new QMenu();
38  mNameEntryContextMenu->addAction("Name to clipboard", std::bind(&ModuleInfoTable::copyName, this));
39  mNameEntryContextMenu->addSection("Misc");
40  mNameEntryContextMenu->addAction("Change name", std::bind(&ModuleInfoTable::changeName, this));
41  mNameEntryContextMenu->addSection("Python");
42  mNameEntryContextMenu->addAction(mPyIcon, "Get name", std::bind(&ModuleInfoTable::pyCopyName, this));
43 
44  mIdEntryContextMenu = new QMenu();
45  mIdEntryContextMenu->addAction("ID to clipboard", std::bind(&ModuleInfoTable::copyId, this));
46  mIdEntryContextMenu->addSection("Python");
47  mIdEntryContextMenu->addAction(mPyIcon, "Get ID", std::bind(&ModuleInfoTable::pyCopyId, this));
48 
49  mTypeEntryContextMenu = new QMenu();
50  mTypeEntryContextMenu->addAction("Type to clipboard", std::bind(&ModuleInfoTable::copyType, this));
51  mTypeEntryContextMenu->addSection("Misc");
52  mTypeEntryContextMenu->addAction("Change type", std::bind(&ModuleInfoTable::changeType, this));
53  mTypeEntryContextMenu->addSection("Python");
54  mTypeEntryContextMenu->addAction(mPyIcon, "Get type", std::bind(&ModuleInfoTable::pyCopyType, this));
55 
56  mModuleEntryContextMenu = new QMenu();
57  mModuleEntryContextMenu->addAction("Parent name to clipboard", std::bind(&ModuleInfoTable::copyModule, this));
58  mModuleEntryContextMenu->addAction("Parent ID to clipboard", std::bind(&ModuleInfoTable::copyParentID, this));
59  mModuleEntryContextMenu->addAction("Set as current Selection", std::bind(&ModuleInfoTable::setParentAsSelection, this));
60  mModuleEntryContextMenu->addAction("Add to current Selection", std::bind(&ModuleInfoTable::addParentToSelection, this));
61  mChangeParentAction = mModuleEntryContextMenu->addAction("Change parent", std::bind(&ModuleInfoTable::changeParentAction, this));
62  mModuleEntryContextMenu->addSection("Python");
63  mModuleEntryContextMenu->addAction(mPyIcon, "Get parent", std::bind(&ModuleInfoTable::pyCopyModule, this));
64 
65  mNumOfAllGatesContextMenu = new QMenu();
66  mNumOfAllGatesContextMenu->addAction("Number of gates to clipboard", std::bind(&ModuleInfoTable::copyNumberOfAllGates, this));
67  mNumOfAllGatesContextMenu->addAction(mPyIcon, "Get all gates recursively", std::bind(&ModuleInfoTable::pyCopyAllGates, this));
68 
69  mNumOfDirectGatesContextMenu = new QMenu();
70  mNumOfDirectGatesContextMenu->addAction("Number of gates to clipboard", std::bind(&ModuleInfoTable::copyNumberOfDirectGates,this));
71  mNumOfDirectGatesContextMenu->addAction(mPyIcon, "Get direct member gates", std::bind(&ModuleInfoTable::pyCopyDirectMemberGates, this));
72 
73  mNumOfGatesInSubmodulesContextMenu = new QMenu();
74  mNumOfGatesInSubmodulesContextMenu->addAction("Number of gates in submodules", std::bind(&ModuleInfoTable::copyNumberOfGatesInSubmodules, this));
75 
76  mNumOfSubmodulesContextMenu = new QMenu();
77  mNumOfSubmodulesContextMenu->addAction("Number of submodules to clipboard", std::bind(&ModuleInfoTable::copyNumberOfSubmodules, this));
78  mNumOfSubmodulesContextMenu->addAction(mPyIcon, "Get submodules", std::bind(&ModuleInfoTable::pyCopyGetSubmodules, this));
79 
80  mNumOfNetsContextMenu = new QMenu();
81  mNumOfNetsContextMenu->addAction("Number of nets to clipboard", std::bind(&ModuleInfoTable::copyNumberOfNets, this));
82  mNumOfNetsContextMenu->addAction(mPyIcon, "Get nets", std::bind(&ModuleInfoTable::pyCopyGetNets, this));
83 
84  mNumOfPinsContextMenu = new QMenu;
85  mNumOfPinsContextMenu->addAction("Number of pins to clipboard", std::bind(&ModuleInfoTable::copyNumberOfPins, this));
86  mNumOfPinsContextMenu->addAction(mPyIcon, "Get pins", std::bind(&ModuleInfoTable::pyCopyGetPins, this));
87 
88  mNumOfPinGroupsContextMenu = new QMenu;
89  mNumOfPinGroupsContextMenu->addAction("Number of pin groups to clipboard", std::bind(&ModuleInfoTable::copyNumberOfPinGroups, this));
90  mNumOfPinGroupsContextMenu->addAction(mPyIcon, "Get pin groups", std::bind(&ModuleInfoTable::pyCopyGetPinGroups, this));
91 
92  mNumOfInputNetsContextMenu = new QMenu;//making this widget the parent changes the context menu's background color...
93  mNumOfInputNetsContextMenu->addAction("Number of input nets to clipboard", std::bind(&ModuleInfoTable::copyNumberOfInputs, this));
94  mNumOfInputNetsContextMenu->addAction(mPyIcon, "Get input nets", std::bind(&ModuleInfoTable::pyCopyGetInputNets,this));
95  mNumOfInputNetsContextMenu->addAction(mPyIcon, "Get input pins", std::bind(&ModuleInfoTable::pyCopyInputPins, this));
96 
97  mNumOfOutputNetsContextMenu = new QMenu;
98  mNumOfOutputNetsContextMenu->addAction("Number of output nets to clipboard", std::bind(&ModuleInfoTable::copyNumberOfOutputs, this));
99  mNumOfOutputNetsContextMenu->addAction(mPyIcon, "Get output nets", std::bind(&ModuleInfoTable::pyCopyGetOutputNets, this));
100  mNumOfOutputNetsContextMenu->addAction(mPyIcon, "Get output pins", std::bind(&ModuleInfoTable::pyCopyOutputPins, this));
101 
102  mNumOfInternalNetsContextMenu = new QMenu;
103  mNumOfInternalNetsContextMenu->addAction("Number of internal nets to clipboard", std::bind(&ModuleInfoTable::copyNumberOfInternalNets, this));
104  mNumOfInternalNetsContextMenu->addAction(mPyIcon, "Get internal nets", std::bind(&ModuleInfoTable::pyCopyGetInternalNets, this));
105 
106  mIsTopModuleContextMenu = new QMenu;
107  mIsTopModuleContextMenu->addAction(mPyIcon, "Check if module is top module", std::bind(&ModuleInfoTable::pyCopyIsTopModule, this));
108 
109  mModuleDoubleClickedAction = std::bind(&ModuleInfoTable::navModule, this);
110 
111  connect(gNetlistRelay, &NetlistRelay::moduleRemoved, this, &ModuleInfoTable::handleModuleRemoved);
112  connect(gNetlistRelay, &NetlistRelay::moduleNameChanged, this, &ModuleInfoTable::handleModuleChanged);
113  connect(gNetlistRelay, &NetlistRelay::moduleParentChanged, this, &ModuleInfoTable::handleModuleChanged);
114  connect(gNetlistRelay, &NetlistRelay::moduleTypeChanged, this, &ModuleInfoTable::handleModuleChanged);
115  connect(gNetlistRelay, &NetlistRelay::moduleSubmoduleAdded, this, &ModuleInfoTable::handleSubmoduleChanged);
116  connect(gNetlistRelay, &NetlistRelay::moduleSubmoduleRemoved, this, &ModuleInfoTable::handleSubmoduleChanged);
117  connect(gNetlistRelay, &NetlistRelay::moduleGateAssigned, this, &ModuleInfoTable::handleGateChanged);
118  connect(gNetlistRelay, &NetlistRelay::moduleGateRemoved, this, &ModuleInfoTable::handleGateChanged);
119  connect(gNetlistRelay, &NetlistRelay::netSourceAdded, this, &ModuleInfoTable::handleNetChaned);
120  connect(gNetlistRelay, &NetlistRelay::netSourceRemoved, this, &ModuleInfoTable::handleNetChaned);
121  connect(gNetlistRelay, &NetlistRelay::netDestinationAdded, this, &ModuleInfoTable::handleNetChaned);
122  connect(gNetlistRelay, &NetlistRelay::netDestinationRemoved, this, &ModuleInfoTable::handleNetChaned);
123  }
124 
126  {
128  {
129  mModule = module;
130  module->is_top_module() ? mChangeParentAction->setEnabled(false) : mChangeParentAction->setEnabled(true);
131 
132  setRow(nameRowKey, name(), mNameEntryContextMenu);
133  setRow(idRowKey, id(), mIdEntryContextMenu);
134  setRow(typeRowKey, type(), mTypeEntryContextMenu);
135  setRow(moduleRowKey, parentModule(), mModuleEntryContextMenu, mModuleDoubleClickedAction);
136  setRow(noOfAllGatesRowKey, numberOfAllGates(), mNumOfAllGatesContextMenu);
137  setRow(noOfDirectGatesRowKey, numberOfDirectGateMembers(), mNumOfDirectGatesContextMenu);
138  setRow(noOfGatesInSubmodulesRowKey, numberOfGatesInSubmodules(), mNumOfGatesInSubmodulesContextMenu);
139  setRow(noOfModulesRowKey, numberOfSubModules(), mNumOfSubmodulesContextMenu);
140  setRow(noOfNetsRowKey, numberOfNets(), mNumOfNetsContextMenu);
141  setRow(noOfPinsKey, numberOfPins(), mNumOfPinsContextMenu);
142  setRow(noOfPinGroupsKey, numberOfPinGroups(), mNumOfPinGroupsContextMenu);
143  setRow(noOfInputNetsKey, numberOfInputNets(), mNumOfInputNetsContextMenu);
144  setRow(noOfOutputNetsKey, numberOfOutputNets(), mNumOfOutputNetsContextMenu);
145  setRow(noOfInternalNetsKey, numberOfInternalNets(), mNumOfInternalNetsContextMenu);
146  setRow(isTopModuleKey, isTopModule(), mIsTopModuleContextMenu);
147 
148  adjustSize();
149  }
150  }
151 
152  QString ModuleInfoTable::name() const
153  {
154  return QString::fromStdString(mModule->get_name());
155  }
156 
157  QString ModuleInfoTable::id() const
158  {
159  return QString::number(mModule->get_id());
160  }
161 
162  QString ModuleInfoTable::type() const
163  {
164  QString type = QString::fromStdString(mModule->get_type());
165 
166  if(type.isEmpty())
167  type = "None";
168 
169  return type;
170  }
171 
172  QString ModuleInfoTable::parentModule() const
173  {
174  QString parentModule = "None";
175 
176  Module* module = mModule->get_parent_module();
177 
178  if(module)
179  parentModule = QString::fromStdString(module->get_name()) + "[ID:" + QString::number(module->get_id()) + "]";
180 
181  return parentModule;
182  }
183 
184  QString ModuleInfoTable::numberOfAllGates() const
185  {
186  return QString::number(mModule->get_gates(nullptr, true).size());
187 // QString numOfGates = "";
188 
189 // int numOfAllChilds = mModule->get_gates(nullptr, true).size();
190 // int numOfDirectChilds = mModule->get_gates(nullptr, false).size();
191 // int numOfChildsInModules = numOfAllChilds - numOfDirectChilds;
192 
193 // numOfGates.append(QString::number(numOfAllChilds));
194 
195 // if(numOfChildsInModules > 0)
196 // numOfGates.append(" (" + QString::number(numOfDirectChilds) + " direct members and " + QString::number(numOfChildsInModules) +" in submodules)");
197 
198 // return numOfGates;
199  }
200 
201  QString ModuleInfoTable::numberOfDirectGateMembers() const
202  {
203  return QString::number(mModule->get_gates().size());
204  }
205 
206  QString ModuleInfoTable::numberOfGatesInSubmodules() const
207  {
208  return QString::number(mModule->get_gates(nullptr, true).size() - mModule->get_gates().size());
209  }
210 
211  QString ModuleInfoTable::numberOfSubModules() const
212  {
213  return QString::number(mModule->get_submodules(nullptr, true).size());
214  }
215 
216  QString ModuleInfoTable::numberOfNets() const
217  {
218  return QString::number(mModule->get_internal_nets().size());
219  }
220 
221  QString ModuleInfoTable::numberOfPins() const
222  {
223  return QString::number(mModule->get_pins().size());
224  }
225 
226  QString ModuleInfoTable::numberOfPinGroups() const
227  {
228  return QString::number(mModule->get_pin_groups().size());
229  }
230 
231  QString ModuleInfoTable::numberOfInputNets() const
232  {
233  return QString::number(mModule->get_input_nets().size());
234  }
235 
236  QString ModuleInfoTable::numberOfOutputNets() const
237  {
238  return QString::number(mModule->get_output_nets().size());
239  }
240 
241  QString ModuleInfoTable::numberOfInternalNets() const
242  {
243  return QString::number(mModule->get_internal_nets().size());
244  }
245 
246  QString ModuleInfoTable::isTopModule() const
247  {
248  return mModule->is_top_module() ? "True" : "False";
249  }
250 
251  void ModuleInfoTable::changeName()
252  {
253  QString oldName = QString::fromStdString(mModule->get_name());
254  QString prompt = "Change module name";
255 
256  bool confirm;
257  QString newName = QInputDialog::getText(this, prompt, "New name:", QLineEdit::Normal, oldName, &confirm);
258 
259  if (confirm)
260  {
261  ActionRenameObject* act = new ActionRenameObject(newName);
262  act->setObject(UserActionObject(mModule->get_id(), UserActionObjectType::ObjectType::Module));
263  act->exec();
264  }
265  }
266 
267  void ModuleInfoTable::copyName() const
268  {
269  copyToClipboard(name());
270  }
271 
272  void ModuleInfoTable::pyCopyName() const
273  {
275  }
276 
277  void ModuleInfoTable::copyId() const
278  {
279  copyToClipboard(id());
280  }
281 
282  void ModuleInfoTable::pyCopyId() const
283  {
285  }
286 
287  void ModuleInfoTable::changeType()
288  {
289  const QString type = QString::fromStdString(mModule->get_type());
290  bool confirm;
291 
292  const QString newType = QInputDialog::getText(this, "Change module type", "New type:", QLineEdit::Normal, type, &confirm);
293 
294  if (confirm)
295  {
296  ActionSetObjectType* act = new ActionSetObjectType(newType);
297  act->setObject(UserActionObject(mModule->get_id(),UserActionObjectType::Module));
298  act->exec();
299  }
300  }
301 
302  void ModuleInfoTable::copyType() const
303  {
305  }
306 
307  void ModuleInfoTable::pyCopyType() const
308  {
310  }
311 
312  void ModuleInfoTable::copyModule() const
313  {
314  auto parentMod = mModule->get_parent_module();
315  if(!parentMod) return;
316 
317  copyToClipboard(QString::fromStdString(parentMod->get_name()));
318  }
319 
320  void ModuleInfoTable::pyCopyModule() const
321  {
323  }
324 
325  void ModuleInfoTable::pyCopyAllGates() const
326  {
328  }
329 
330  void ModuleInfoTable::copyNumberOfAllGates() const
331  {
332  copyToClipboard(numberOfAllGates());
333  }
334 
335  void ModuleInfoTable::copyNumberOfDirectGates() const
336  {
337  copyToClipboard(numberOfDirectGateMembers());
338  }
339 
340  void ModuleInfoTable::pyCopyDirectMemberGates() const
341  {
343  }
344 
345  void ModuleInfoTable::copyNumberOfGatesInSubmodules() const
346  {
347  copyToClipboard(numberOfGatesInSubmodules());
348  }
349 
350  void ModuleInfoTable::pyCopyGatesInSubmodules() const
351  {
352 
353  }
354 
355  void ModuleInfoTable::copyNumberOfSubmodules() const
356  {
357  copyToClipboard(numberOfSubModules());
358  }
359 
360  void ModuleInfoTable::pyCopyGetSubmodules() const
361  {
363  }
364 
365  void ModuleInfoTable::copyNumberOfNets() const
366  {
367  copyToClipboard(numberOfNets());
368  }
369 
370  void ModuleInfoTable::pyCopyGetNets() const
371  {
373  }
374 
375  void ModuleInfoTable::copyNumberOfPins() const
376  {
377  copyToClipboard(numberOfPins());
378  }
379 
380  void ModuleInfoTable::copyNumberOfPinGroups() const
381  {
382  copyToClipboard(numberOfPinGroups());
383  }
384 
385  void ModuleInfoTable::pyCopyGetPinGroups() const
386  {
388  }
389 
390  void ModuleInfoTable::copyNumberOfInputs() const
391  {
392  copyToClipboard(numberOfInputNets());
393  }
394 
395  void ModuleInfoTable::pyCopyGetInputNets() const
396  {
398  }
399 
400  void ModuleInfoTable::copyNumberOfOutputs() const
401  {
402  copyToClipboard(numberOfOutputNets());
403  }
404 
405  void ModuleInfoTable::pyCopyGetOutputNets() const
406  {
408  }
409 
410  void ModuleInfoTable::copyNumberOfInternalNets() const
411  {
412  copyToClipboard(numberOfInternalNets());
413  }
414 
415  void ModuleInfoTable::pyCopyGetInternalNets() const
416  {
418  }
419 
420  void ModuleInfoTable::pyCopyIsTopModule() const
421  {
423  }
424 
425  void ModuleInfoTable::copyParentID() const
426  {
427  auto parentMod = mModule->get_parent_module();
428  if(!parentMod) return;
429 
430  copyToClipboard(QString::number(parentMod->get_id()));
431  }
432 
433  void ModuleInfoTable::pyCopyInputPins() const
434  {
436  }
437 
438  void ModuleInfoTable::pyCopyOutputPins() const
439  {
441  }
442 
443  void ModuleInfoTable::setParentAsSelection()
444  {
445  auto parentMod = mModule->get_parent_module();
446  if(!parentMod) return;
447 
449  gSelectionRelay->addModule(parentMod->get_id());
450  gSelectionRelay->relaySelectionChanged(this);//function cant be const because of this
451  }
452 
453  void ModuleInfoTable::addParentToSelection()
454  {
455  auto parentMod = mModule->get_parent_module();
456  if(!parentMod) return;
457 
458  gSelectionRelay->addModule(parentMod->get_id());
459  gSelectionRelay->relaySelectionChanged(this);//function cant be const because of this
460  }
461 
462  void ModuleInfoTable::pyCopyGetPins() const
463  {
465  }
466 
467  void ModuleInfoTable::navModule()
468  {
469  Module* parentModule = mModule->get_parent_module();
470 
471  if(parentModule != nullptr)
472  {
473  u32 parentModuleId = parentModule->get_id();
474 
476  gSelectionRelay->addModule(parentModuleId);
478  }
479  }
480 
481  void ModuleInfoTable::changeParentAction()
482  {
483  QSet<u32> excludeMods;
484  if (mModule)
485  {
486  Module* parentMod = mModule->get_parent_module();
487  if (parentMod) excludeMods.insert(parentMod->get_id());
488  }
489  ModuleDialog md(excludeMods, "Move to module", false, nullptr, this);
490  if (md.exec() != QDialog::Accepted) return;
491  if (md.isNewModule())
492  {
494  bool ok;
495  QString name = QInputDialog::getText(nullptr, "", "New module will be created under \"" + topModName + "\"\nModule Name:", QLineEdit::Normal, "", &ok);
496  if (!ok || name.isEmpty()) return;
497 
498  ActionCreateObject* actNewModule = new ActionCreateObject(UserActionObjectType::Module, name);
499  actNewModule->setParentId(gNetlist->get_top_module()->get_id());
500  UserActionCompound* compound = new UserActionCompound;
501  compound->setUseCreatedObject();
502  compound->addAction(actNewModule);
503  compound->addAction(new ActionAddItemsToObject(QSet<u32>() << mModule->get_id()));
504  compound->exec();
505  return;
506  }
507  ActionAddItemsToObject* addAct = new ActionAddItemsToObject(QSet<u32>() << mModule->get_id());
508  addAct->setObject(UserActionObject(md.selectedId(), UserActionObjectType::Module));
509  addAct->exec();
510 
511  }
512 
513  void ModuleInfoTable::refresh()
514  {
515  setModule(mModule);
516  }
517 
518  void ModuleInfoTable::handleModuleRemoved(Module* module)
519  {
520  if(mModule == module)
521  {
522  mModule = nullptr;
523 
524  const QString notification("Displayed module has been removed.");
525 
526  setRow(nameRowKey, notification, nullptr);
527  setRow(idRowKey, notification, nullptr);
528  setRow(typeRowKey, notification, nullptr);
529  setRow(moduleRowKey, notification, nullptr, nullptr);
530  setRow(noOfAllGatesRowKey, notification, nullptr);
531  setRow(noOfModulesRowKey, notification, nullptr);
532  setRow(noOfNetsRowKey, notification, nullptr);
533 
534  adjustSize();
535  }
536  }
537 
538  void ModuleInfoTable::handleModuleChanged(Module* module)
539  {
540  if(mModule == module)
541  refresh();
542  }
543 
544  void ModuleInfoTable::handleSubmoduleChanged(Module* parentModule, u32 affectedModuleId)
545  {
546  Q_UNUSED(affectedModuleId);
547 
548  if(!mModule)
549  return;
550 
551  if(mModule == parentModule || mModule->contains_module(parentModule))
552  refresh();
553  }
554 
555  void ModuleInfoTable::handleGateChanged(Module* parentModule, u32 affectedGateId)
556  {
557  Q_UNUSED(affectedGateId);
558 
559  if(!mModule)
560  return;
561 
562  if(mModule == parentModule || mModule->contains_module(parentModule))
563  refresh();
564  }
565 
566  void ModuleInfoTable::handleNetChaned(Net* net, u32 affectedGateId)
567  {
568  Q_UNUSED(net);
569 
570  if(!mModule)
571  return;
572 
573  Gate* affectedGate = gNetlist->get_gate_by_id(affectedGateId);
574  std::vector<Gate*> allChildGates = mModule->get_gates(nullptr, true);
575 
576  if(std::find(std::begin(allChildGates), std::end(allChildGates), affectedGate) != std::end(allChildGates))
577  refresh();
578  }
579 }
void setRow(const QString &key, const QString &val, QMenu *contextMenu=nullptr, std::function< void()> doubleClickAction=nullptr)
void copyToClipboard(const QString &text) const
Module * get_parent_module() const
Definition: module.cpp:125
std::vector< ModulePin * > get_pins(const std::function< bool(ModulePin *)> &filter=nullptr) const
Definition: module.cpp:871
const std::unordered_set< Net * > & get_internal_nets() const
Definition: module.cpp:550
bool is_top_module() const
Definition: module.cpp:312
const std::vector< Gate * > & get_gates() const
Definition: module.cpp:391
std::string get_name() const
Definition: module.cpp:87
const std::unordered_set< Net * > & get_input_nets() const
Definition: module.cpp:540
bool contains_module(const Module *other, bool recursive=false) const
Definition: module.cpp:307
std::vector< PinGroup< ModulePin > * > get_pin_groups(const std::function< bool(PinGroup< ModulePin > *)> &filter=nullptr) const
Definition: module.cpp:962
std::vector< Module * > get_submodules(const std::function< bool(Module *)> &filter=nullptr, bool recursive=false) const
Definition: module.cpp:259
std::string get_type() const
Definition: module.cpp:106
const std::unordered_set< Net * > & get_output_nets() const
Definition: module.cpp:545
u32 get_id() const
Definition: module.cpp:82
ModuleInfoTable(QWidget *parent=nullptr)
void setModule(hal::Module *module)
Module * get_top_module() const
Definition: netlist.cpp:608
Gate * get_gate_by_id(const u32 gate_id) const
Definition: netlist.cpp:193
bool is_module_in_netlist(const Module *module) const
Definition: netlist.cpp:647
void netDestinationRemoved(Net *n, const u32 dst_gate_id) const
void moduleTypeChanged(Module *m) const
void netSourceAdded(Net *n, const u32 src_gate_id) const
void moduleGateRemoved(Module *m, const u32 removed_gate) const
void moduleGateAssigned(Module *m, const u32 assigned_gate) const
void netSourceRemoved(Net *n, const u32 src_gate_id) const
void netDestinationAdded(Net *n, const u32 dst_gate_id) const
void moduleSubmoduleRemoved(Module *m, const u32 removed_module) const
void moduleNameChanged(Module *m) const
void moduleRemoved(Module *m) const
void moduleParentChanged(Module *m) const
void moduleSubmoduleAdded(Module *m, const u32 added_module) const
static QString pyCodeModuleIsTopModule(u32 moduleId)
static QString pyCodeModuleType(u32 moduleId)
static QString pyCodeModuleOutputNets(u32 moduleId)
static QString pyCodeModuleInternalNets(u32 moduleId)
static QString pyCodeModuleInputNets(u32 moduleId)
static QString pyCodeModuleNets(u32 moduleId)
static QString pyCodeModulePins(u32 moduleId)
static QString pyCodeModuleInputPins(u32 moduleId)
static QString pyCodeModuleModule(u32 moduleId)
static QString pyCodeModuleOutputPins(u32 moduleId)
static QString pyCodeModuleId(u32 moduleId)
static QString pyCodeModuleSubmodules(u32 moduleId)
static QString pyCodeModuleGates(u32 moduleId, bool recursively=false)
static QString pyCodeModulePinGroups(u32 moduleId)
static QString pyCodeModuleName(u32 moduleId)
void relaySelectionChanged(void *sender)
const Module * module(const Gate *g, const NodeBoxes &boxes)
SelectionRelay * gSelectionRelay
Definition: plugin_gui.cpp:83
Netlist * gNetlist
Definition: plugin_gui.cpp:80
NetlistRelay * gNetlistRelay
Definition: plugin_gui.cpp:81
quint32 u32
PinType type
Net * net
std::string name
void setEnabled(bool)
QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
QAction * addAction(const QString &text)
QAction * addSection(const QString &text)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QSet::iterator insert(const T &value)
QString fromStdString(const std::string &str)
QString number(int n, int base)