HAL  v4.5.0-151-g9638bf6b9
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 
112  QString numberOfNets() const;
113 
117  QString numberOfPins() const;
118 
122  QString numberOfPinGroups() const;
123 
127  QString numberOfInputNets() const;
128 
132  QString numberOfOutputNets() const;
133 
137  QString numberOfInternalNets() const;
138 
142  QString isTopModule() const;
143 
147  void changeName();
148 
152  void copyName() const;
153 
157  void pyCopyName() const;
158 
162  void copyId() const;
163 
167  void pyCopyId() const;
168 
172  void changeType();
173 
177  void copyType() const;
178 
182  void pyCopyType() const;
183 
187  void copyModule() const;
188 
192  void pyCopyModule() const;
193 
197  void copyNumberOfAllGates() const;
198 
202  void pyCopyAllGates() const;
203 
207  void copyNumberOfDirectGates() const;
208 
212  void pyCopyDirectMemberGates() const;
213 
217  void copyNumberOfGatesInSubmodules() const;
218 
222  void pyCopyGatesInSubmodules() const;
223 
227  void copyNumberOfSubmodules() const;
228 
232  void pyCopyGetSubmodules() const;
233 
237  void copyNumberOfNets() const;
238 
242  void pyCopyGetNets() const;
243 
247  void copyNumberOfPins() const;
248 
252  void pyCopyGetPins() const;
253 
257  void copyNumberOfPinGroups() const;
258 
262  void pyCopyGetPinGroups() const;
263 
267  void copyNumberOfInputs() const;
268 
272  void pyCopyGetInputNets() const;
273 
277  void copyNumberOfOutputs() const;
278 
282  void pyCopyGetOutputNets() const;
283 
287  void copyNumberOfInternalNets() const;
288 
292  void pyCopyGetInternalNets() const;
293 
297  void pyCopyIsTopModule() const;
298 
302  void copyParentID() const;
303 
307  void pyCopyInputPins() const;
308 
312  void pyCopyOutputPins() const;
313 
317  void setParentAsSelection();
318 
322  void addParentToSelection();
323 
327  void navModule();
328 
332  void changeParentAction();
333 
339  void handleModuleRemoved(Module* module);
340 
346  void handleModuleChanged(Module* module);
347 
354  void handleSubmoduleChanged(Module* parentModule, u32 affectedModuleId);
355 
362  void handleGateChanged(Module* parentModule, u32 affectedGateId);
363 
370  void handleNetChaned(Net* net, u32 affectedGateId);
371 
375  void refresh();
376 
377  Module* mModule;
378 
379  QMenu* mNameEntryContextMenu;
380  QMenu* mIdEntryContextMenu;
381  QMenu* mTypeEntryContextMenu;
382  QMenu* mModuleEntryContextMenu;
383  QMenu* mNumOfAllGatesContextMenu;
384  QMenu* mNumOfDirectGatesContextMenu;
385  QMenu* mNumOfGatesInSubmodulesContextMenu;
386  QMenu* mNumOfSubmodulesContextMenu;
387  QMenu* mNumOfNetsContextMenu;
388  QMenu* mNumOfPinsContextMenu;
389  QMenu* mNumOfPinGroupsContextMenu;
390  QMenu* mNumOfInputNetsContextMenu;
391  QMenu* mNumOfOutputNetsContextMenu;
392  QMenu* mNumOfInternalNetsContextMenu;
393  QMenu* mIsTopModuleContextMenu;
394  QAction* mChangeParentAction;//is disabled if current module is the top module
395 
396  std::function<void()> mModuleDoubleClickedAction;
397  QIcon mPyIcon;
398 
399  static const QString nameRowKey;
400  static const QString idRowKey;
401  static const QString typeRowKey;
402  static const QString moduleRowKey;
403  static const QString noOfAllGatesRowKey;
404  static const QString noOfDirectGatesRowKey;
405  static const QString noOfGatesInSubmodulesRowKey;
406  static const QString noOfModulesRowKey;
407  static const QString noOfNetsRowKey;
408  static const QString noOfPinsKey;
409  static const QString noOfPinGroupsKey;
410  static const QString noOfInputNetsKey;
411  static const QString noOfOutputNetsKey;
412  static const QString noOfInternalNetsKey;
413  static const QString isTopModuleKey;
414 
415  };
416 }
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