-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
189 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
plugins/gui/include/gui/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_lut.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// MIT License | ||
// | ||
// Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved. | ||
// Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved. | ||
// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved. | ||
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#pragma once | ||
|
||
#include "gui/gatelibrary_management/gatelibrary_frames/gatelibrary_component_frame.h" | ||
|
||
#include <QFormLayout> | ||
#include <QLabel> | ||
|
||
namespace hal | ||
{ | ||
class GatelibraryFrameLut : public GatelibraryComponentFrame | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
GatelibraryFrameLut(QWidget* parent = nullptr); | ||
|
||
void update(GateType* gt) override; | ||
|
||
private: | ||
QLabel* mAscending; | ||
}; | ||
|
||
} | ||
|
||
|
51 changes: 51 additions & 0 deletions
51
plugins/gui/include/gui/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_state.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// MIT License | ||
// | ||
// Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved. | ||
// Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved. | ||
// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved. | ||
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved. | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#pragma once | ||
|
||
#include "gui/gatelibrary_management/gatelibrary_frames/gatelibrary_component_frame.h" | ||
|
||
#include <QFormLayout> | ||
#include <QLabel> | ||
|
||
namespace hal | ||
{ | ||
class GatelibraryFrameState : public GatelibraryComponentFrame | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
GatelibraryFrameState(QWidget* parent = nullptr); | ||
|
||
void update(GateType* gt) override; | ||
|
||
private: | ||
QLabel* mStateIdentifier; | ||
QLabel* mNegStateIdentifier; | ||
}; | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
plugins/gui/src/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_lut.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "gui/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_lut.h" | ||
#include "gui/gatelibrary_management/gatelibrary_label.h" | ||
#include "hal_core/netlist/gate_library/gate_type_component/lut_component.h" | ||
|
||
namespace hal | ||
{ | ||
GatelibraryFrameLut::GatelibraryFrameLut(QWidget* parent) | ||
: GatelibraryComponentFrame("LUT Init", parent) | ||
{ | ||
mAscending = new GateLibraryLabel(true, " - ", this); | ||
|
||
mLayout->addRow(new GateLibraryLabel(false, "Bit Order:", parent), mAscending); | ||
} | ||
|
||
void GatelibraryFrameLut::update(GateType* gt) | ||
{ | ||
if(gt->has_component_of_type(GateTypeComponent::ComponentType::init)) | ||
{ | ||
auto lutc = gt->get_component_as<LUTComponent>([](const GateTypeComponent* c) { return LUTComponent::is_class_of(c); }); | ||
|
||
if(lutc != nullptr) | ||
{ | ||
mAscending->setText(QString::fromStdString(lutc->is_init_ascending() ? "Ascending" : "Descending")); | ||
show(); | ||
} | ||
else hide(); | ||
} | ||
else hide(); | ||
} | ||
} | ||
|
35 changes: 35 additions & 0 deletions
35
plugins/gui/src/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_state.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "gui/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_state.h" | ||
#include "gui/gatelibrary_management/gatelibrary_label.h" | ||
#include "hal_core/netlist/gate_library/gate_type_component/state_component.h" | ||
|
||
namespace hal | ||
{ | ||
GatelibraryFrameState::GatelibraryFrameState(QWidget* parent) | ||
: GatelibraryComponentFrame("Internal States", parent) | ||
{ | ||
mStateIdentifier = new GateLibraryLabel(true, " - ", this); | ||
mNegStateIdentifier = new GateLibraryLabel(true, " - ", this); | ||
|
||
mLayout->addRow(new GateLibraryLabel(false, "State identifier:", parent), mStateIdentifier); | ||
mLayout->addRow(new GateLibraryLabel(false, "Neg. state identifier:", parent), mNegStateIdentifier); | ||
|
||
} | ||
|
||
void GatelibraryFrameState::update(GateType* gt) | ||
{ | ||
if(gt->has_component_of_type(GateTypeComponent::ComponentType::state)) | ||
{ | ||
auto stat = gt->get_component_as<StateComponent>([](const GateTypeComponent* c) { return StateComponent::is_class_of(c); }); | ||
|
||
if(stat != nullptr) | ||
{ | ||
mStateIdentifier->setText(QString::fromStdString(stat->get_state_identifier())); | ||
mNegStateIdentifier->setText(QString::fromStdString(stat->get_neg_state_identifier())); | ||
show(); | ||
} | ||
else hide(); | ||
} | ||
else hide(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters