HAL  v4.5.0-255-g8271db4e6
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
gate_details_tab_widget.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 
34 
35 class QButtonGroup;
36 class QVBoxLayout;
37 
38 namespace hal
39 {
40  class Gate;
41  class DetailsFrameWidget;
42  class GateInfoTable;
43  class GatePinTree;
44  class BooleanFunctionTable;
45  class LUTTableWidget;
46  class DataTableWidget;
47  class GroupingsOfItemWidget;
48  class CommentWidget;
49  class ParameterTableWidget;
50 
58  {
59  Q_OBJECT
60 
61  private:
62  enum GateTypeCategory {none, lut, ff, latch};
63 
64  public:
71 
77  void setGate(Gate* gate);
78 
79  private Q_SLOTS:
80 
81  void handleGateBooleanFunctionChanged(Gate* g);
82  void handleLutPinSelectionChanged(int id);
83 
84 
85  private:
91  void showMultiTab(GateDetailsTabWidget::GateTypeCategory gateTypeCategory);
92 
96  void hideMultiTab();
97 
103  void hideOrShorMultiTab(GateTypeCategory gateTypeCategory);
104 
108  void setupBooleanFunctionTables(Gate* gate, GateTypeCategory gateTypeCategory);
109 
113  GateTypeCategory getGateTypeCategory(Gate* gate) const;
114 
118  void handleLutConfigContextMenuRequested(QPoint pos);//might make an own class for the configstring, context menu is handled there?
119 
120  bool mMultiTabVisible = true;
121  int mMultiTabIndex;
122  QWidget* mMultiTabContent;
123 
124  Gate* mCurrentGate;
125 
126  //general tab
127  GateInfoTable* mGateInfoTable;
128  DetailsFrameWidget* mGateInformationFrame;
129 
130  //groupings tab
131  GroupingsOfItemWidget* mGroupingsOfItemTable;
132  DetailsFrameWidget* mGroupingsFrame;
133 
134  //pins tab
135  GatePinTree* mPinsTree;
136  DetailsFrameWidget* mPinsFrame;
137 
138  //ff tab
139  BooleanFunctionTable* mFfFunctionTable;
140  DetailsFrameWidget* mFfFrame;
141 
142  //latch tab
143  BooleanFunctionTable* mLatchFunctionTable;
144  DetailsFrameWidget* mLatchFrame;
145 
146  //lut tab
147  QButtonGroup* mLutPinButtonGroup;
148  QWidget* mLutRadioWidget;
149  QVBoxLayout* mLutRadioLayout;
150  std::vector<std::string> mCurrentLutPins;
151  std::string mSelectedLutPin;
152  DetailsFrameWidget* mLutFrame;
153 
154  QLabel* mLutConfigLabel;
155  DetailsFrameWidget* mLutConfigurationFrame;
156 
157  LUTTableWidget* mLutTable;
158  DetailsFrameWidget* mTruthTableFrame;
159 
160  //boolean function tab
161  BooleanFunctionTable* mFullFunctionTable;
162  DetailsFrameWidget* mBooleanFunctionsFrame;
163 
164  //data tab
165  DataTableWidget* mDataTable;
166  DetailsFrameWidget* mDataFrame;
167 
168  //comment tab
169  CommentWidget* mCommentWidget;
170 
171  //parameter tab
172  ParameterTableWidget* mParameterTable;
173  DetailsFrameWidget* mParameterFrame;
174  };
175 }
A table view that shows BooleanFunctions and clear-preset behaviors.
A widget to display the data of a DataContainer (Module, Gate or Net)
The DetailsTabWidget that is responsible for showing Gate details.
GateDetailsTabWidget(QWidget *parent=nullptr)
Definition: gate.h:59
A widget to display the pins of a given gate.
Definition: gate_pin_tree.h:43
A TableView to display all groupings that contain a specified Gate, Net or Module.
A view for truth-tables (based on the LUTTableModel)
A widget to display the typed parameters of a gate.
Definition: defines.h:45
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const