HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
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 
39  {
40  Q_OBJECT
41 
42  public:
43 
49  ModuleInfoTable(QWidget* parent = nullptr);
50 
57 
58  private:
59 
65  QString name() const;
66 
72  QString id() const;
73 
79  QString type() const;
80 
86  QString parentModule() const;
87 
91  QString numberOfAllGates() const;
92 
96  QString numberOfDirectGateMembers() const;
97 
101  QString numberOfGatesInSubmodules() const;
102 
106  QString numberOfSubModules() const;
107 
111  QString numberOfNets() const;
112 
116  QString numberOfPins() const;
117 
121  QString numberOfPinGroups() const;
122 
126  QString numberOfInputNets() const;
127 
131  QString numberOfOutputNets() const;
132 
136  QString numberOfInternalNets() const;
137 
141  QString isTopModule() const;
142 
146  void changeName();
147 
151  void copyName() const;
152 
156  void pyCopyName() const;
157 
161  void copyId() const;
162 
166  void pyCopyId() const;
167 
171  void changeType();
172 
176  void copyType() const;
177 
181  void pyCopyType() const;
182 
186  void copyModule() const;
187 
191  void pyCopyModule() const;
192 
196  void copyNumberOfAllGates() const;
197 
201  void pyCopyAllGates() const;
202 
206  void copyNumberOfDirectGates() const;
207 
211  void pyCopyDirectMemberGates() const;
212 
216  void copyNumberOfGatesInSubmodules() const;
217 
221  void pyCopyGatesInSubmodules() const;
222 
226  void copyNumberOfSubmodules() const;
227 
231  void pyCopyGetSubmodules() const;
232 
236  void copyNumberOfNets() const;
237 
241  void pyCopyGetNets() const;
242 
246  void copyNumberOfPins() const;
247 
251  void pyCopyGetPins() const;
252 
256  void copyNumberOfPinGroups() const;
257 
261  void pyCopyGetPinGroups() const;
262 
266  void copyNumberOfInputs() const;
267 
271  void pyCopyGetInputNets() const;
272 
276  void copyNumberOfOutputs() const;
277 
281  void pyCopyGetOutputNets() const;
282 
286  void copyNumberOfInternalNets() const;
287 
291  void pyCopyGetInternalNets() const;
292 
296  void pyCopyIsTopModule() const;
297 
301  void copyParentID() const;
302 
306  void pyCopyInputPins() const;
307 
311  void pyCopyOutputPins() const;
312 
316  void setParentAsSelection();
317 
321  void addParentToSelection();
322 
326  void navModule();
327 
331  void changeParentAction();
332 
338  void handleModuleRemoved(Module* module);
339 
345  void handleModuleChanged(Module* module);
346 
353  void handleSubmoduleChanged(Module* parentModule, u32 affectedModuleId);
354 
361  void handleGateChanged(Module* parentModule, u32 affectedGateId);
362 
369  void handleNetChaned(Net* net, u32 affectedGateId);
370 
374  void refresh();
375 
376  Module* mModule;
377 
378  QMenu* mNameEntryContextMenu;
379  QMenu* mIdEntryContextMenu;
380  QMenu* mTypeEntryContextMenu;
381  QMenu* mModuleEntryContextMenu;
382  QMenu* mNumOfAllGatesContextMenu;
383  QMenu* mNumOfDirectGatesContextMenu;
384  QMenu* mNumOfGatesInSubmodulesContextMenu;
385  QMenu* mNumOfSubmodulesContextMenu;
386  QMenu* mNumOfNetsContextMenu;
387  QMenu* mNumOfPinsContextMenu;
388  QMenu* mNumOfPinGroupsContextMenu;
389  QMenu* mNumOfInputNetsContextMenu;
390  QMenu* mNumOfOutputNetsContextMenu;
391  QMenu* mNumOfInternalNetsContextMenu;
392  QMenu* mIsTopModuleContextMenu;
393  QAction* mChangeParentAction;//is disabled if current module is the top module
394 
395  std::function<void()> mModuleDoubleClickedAction;
396  QIcon mPyIcon;
397 
398  static const QString nameRowKey;
399  static const QString idRowKey;
400  static const QString typeRowKey;
401  static const QString moduleRowKey;
402  static const QString noOfAllGatesRowKey;
403  static const QString noOfDirectGatesRowKey;
404  static const QString noOfGatesInSubmodulesRowKey;
405  static const QString noOfModulesRowKey;
406  static const QString noOfNetsRowKey;
407  static const QString noOfPinsKey;
408  static const QString noOfPinGroupsKey;
409  static const QString noOfInputNetsKey;
410  static const QString noOfOutputNetsKey;
411  static const QString noOfInternalNetsKey;
412  static const QString isTopModuleKey;
413 
414  };
415 }
ModuleInfoTable(QWidget *parent=nullptr)
void setModule(hal::Module *module)
Definition: net.h:58
uint32_t u32
Definition: defines.h:41
const Module * module(const Gate *g, const NodeBoxes &boxes)
Definition: defines.h:45
Net * net
Q_OBJECTQ_OBJECT
QObject * parent() const const