HAL
module_info_table.h
Go to the documentation of this file.
1 // MIT License
2 //
3 // Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved.
4 // Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved.
5 // Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved.
6 // Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in all
16 // copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 // SOFTWARE.
25 
26 #pragma once
27 
29 
30 namespace hal
31 {
32  class Module;
33  class Net;
34 
36  {
37  Q_OBJECT
38 
39  public:
40 
46  ModuleInfoTable(QWidget* parent = nullptr);
47 
54 
55  private:
56 
62  QString name() const;
63 
69  QString id() const;
70 
76  QString type() const;
77 
83  QString parentModule() const;
84 
88  QString numberOfAllGates() const;
89 
93  QString numberOfDirectGateMembers() const;
94 
98  QString numberOfGatesInSubmodules() const;
99 
103  QString numberOfSubModules() const;
104 
108  QString numberOfNets() const;
109 
113  QString numberOfPins() const;
114 
118  QString numberOfPinGroups() const;
119 
123  QString numberOfInputNets() const;
124 
128  QString numberOfOutputNets() const;
129 
133  QString numberOfInternalNets() const;
134 
138  QString isTopModule() const;
139 
143  void changeName();
144 
148  void copyName() const;
149 
153  void pyCopyName() const;
154 
158  void copyId() const;
159 
163  void pyCopyId() const;
164 
168  void changeType();
169 
173  void copyType() const;
174 
178  void pyCopyType() const;
179 
183  void copyModule() const;
184 
188  void pyCopyModule() const;
189 
193  void copyNumberOfAllGates() const;
194 
198  void pyCopyAllGates() const;
199 
203  void copyNumberOfDirectGates() const;
204 
208  void pyCopyDirectMemberGates() const;
209 
213  void copyNumberOfGatesInSubmodules() const;
214 
218  void pyCopyGatesInSubmodules() const;
219 
223  void copyNumberOfSubmodules() const;
224 
228  void pyCopyGetSubmodules() const;
229 
233  void copyNumberOfNets() const;
234 
238  void pyCopyGetNets() const;
239 
243  void copyNumberOfPins() const;
244 
248  void pyCopyGetPins() const;
249 
253  void copyNumberOfPinGroups() const;
254 
258  void pyCopyGetPinGroups() const;
259 
263  void copyNumberOfInputs() const;
264 
268  void pyCopyGetInputNets() const;
269 
273  void copyNumberOfOutputs() const;
274 
278  void pyCopyGetOutputNets() const;
279 
283  void copyNumberOfInternalNets() const;
284 
288  void pyCopyGetInternalNets() const;
289 
293  void pyCopyIsTopModule() const;
294 
298  void copyParentID() const;
299 
303  void pyCopyInputPins() const;
304 
308  void pyCopyOutputPins() const;
309 
313  void setParentAsSelection();
314 
318  void addParentToSelection();
319 
323  void navModule();
324 
328  void changeParentAction();
329 
335  void handleModuleRemoved(Module* module);
336 
342  void handleModuleChanged(Module* module);
343 
350  void handleSubmoduleChanged(Module* parentModule, u32 affectedModuleId);
351 
358  void handleGateChanged(Module* parentModule, u32 affectedGateId);
359 
366  void handleNetChaned(Net* net, u32 affectedGateId);
367 
371  void refresh();
372 
373  Module* mModule;
374 
375  QMenu* mNameEntryContextMenu;
376  QMenu* mIdEntryContextMenu;
377  QMenu* mTypeEntryContextMenu;
378  QMenu* mModuleEntryContextMenu;
379  QMenu* mNumOfAllGatesContextMenu;
380  QMenu* mNumOfDirectGatesContextMenu;
381  QMenu* mNumOfGatesInSubmodulesContextMenu;
382  QMenu* mNumOfSubmodulesContextMenu;
383  QMenu* mNumOfNetsContextMenu;
384  QMenu* mNumOfPinsContextMenu;
385  QMenu* mNumOfPinGroupsContextMenu;
386  QMenu* mNumOfInputNetsContextMenu;
387  QMenu* mNumOfOutputNetsContextMenu;
388  QMenu* mNumOfInternalNetsContextMenu;
389  QMenu* mIsTopModuleContextMenu;
390  QAction* mChangeParentAction;//is disabled if current module is the top module
391 
392  std::function<void()> mModuleDoubleClickedAction;
393  QIcon mPyIcon;
394 
395  static const QString nameRowKey;
396  static const QString idRowKey;
397  static const QString typeRowKey;
398  static const QString moduleRowKey;
399  static const QString noOfAllGatesRowKey;
400  static const QString noOfDirectGatesRowKey;
401  static const QString noOfGatesInSubmodulesRowKey;
402  static const QString noOfModulesRowKey;
403  static const QString noOfNetsRowKey;
404  static const QString noOfPinsKey;
405  static const QString noOfPinGroupsKey;
406  static const QString noOfInputNetsKey;
407  static const QString noOfOutputNetsKey;
408  static const QString noOfInternalNetsKey;
409  static const QString isTopModuleKey;
410 
411  };
412 }
ModuleInfoTable(QWidget *parent=nullptr)
void setModule(hal::Module *module)
Definition: net.h:58
const Module * module(const Gate *g, const NodeBoxes &boxes)
quint32 u32
Net * net
Q_OBJECTQ_OBJECT
QObject * parent() const const