HAL
gatelibrary_frame_ram.cpp
Go to the documentation of this file.
1
#include "
gui/gatelibrary_management/gatelibrary_frames/gatelibrary_frame_ram.h
"
2
#include "
gui/gatelibrary_management/gatelibrary_label.h
"
3
#include "
hal_core/netlist/gate_library/gate_type_component/ram_component.h
"
4
5
namespace
hal
6
{
7
GateLibraryFrameRAM::GateLibraryFrameRAM
(
QWidget
* parent)
8
:
GatelibraryComponentFrame
(
"RAM"
, parent)
9
{
10
mBitSize =
new
GateLibraryLabel
(
true
,
" - "
,
this
);
11
12
mLayout
->
addRow
(
new
GateLibraryLabel
(
false
,
"RAM bit size:"
,
parent
), mBitSize);
13
14
mLayout
->
setFieldGrowthPolicy
(
QFormLayout::AllNonFixedFieldsGrow
);
15
16
}
17
18
void
GateLibraryFrameRAM::update
(
GateType
* gt)
19
{
20
if
(gt->
has_component_of_type
(
GateTypeComponent::ComponentType::ram
))
21
{
22
auto
ram
= gt->
get_component_as
<
RAMComponent
>([](
const
GateTypeComponent
* c) {
return
RAMComponent::is_class_of
(c);});
23
24
if
(
ram
!=
nullptr
)
25
{
26
mBitSize->
setText
(
QString::fromStdString
(std::to_string(
ram
->get_bit_size())));
27
show
();
28
}
29
else
30
hide
();
31
}
32
else
33
hide
();
34
}
35
}
36
hal::GateLibraryFrameRAM::GateLibraryFrameRAM
GateLibraryFrameRAM(QWidget *parent=nullptr)
Definition:
gatelibrary_frame_ram.cpp:7
hal::GateLibraryLabel
Definition:
gatelibrary_label.h:34
hal::GateTypeComponent
Definition:
gate_type_component.h:40
hal::GateTypeComponent::ComponentType::ram
@ ram
hal::GateType
Definition:
gate_type.h:52
hal::GateType::has_component_of_type
bool has_component_of_type(const GateTypeComponent::ComponentType type) const
Definition:
gate_type.cpp:54
hal::GateType::get_component_as
T * get_component_as(const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const
Definition:
gate_type.h:89
hal::GatelibraryComponentFrame
Definition:
gatelibrary_component_frame.h:38
hal::GatelibraryComponentFrame::mLayout
QFormLayout * mLayout
Definition:
gatelibrary_component_frame.h:43
hal::RAMComponent
Definition:
ram_component.h:33
hal::RAMComponent::is_class_of
static bool is_class_of(const GateTypeComponent *component)
Definition:
ram_component.cpp:14
gatelibrary_frame_ram.h
gatelibrary_label.h
hal
Definition:
parser_liberty.cpp:10
hal::GateTypeProperty::ram
@ ram
QFormLayout::AllNonFixedFieldsGrow
AllNonFixedFieldsGrow
QFormLayout::addRow
void addRow(QWidget *label, QWidget *field)
QFormLayout::setFieldGrowthPolicy
void setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy)
QLabel::setText
void setText(const QString &)
QObject::parent
QObject * parent() const const
QString::fromStdString
QString fromStdString(const std::string &str)
QWidget
QWidget::hide
void hide()
QWidget::show
void show()
QWidget::update
void update()
ram_component.h
plugins
gui
src
gatelibrary_management
gatelibrary_frames
gatelibrary_frame_ram.cpp
Generated on Fri Feb 14 2025 14:22:42 for HAL by
1.9.1