HAL  v4.5.0-254-g8f9f6a423
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::RAMPortComponent Class Reference

#include <hal_core/netlist/gate_library/gate_type_component/ram_port_component.h>

Inheritance diagram for hal::RAMPortComponent:
Inheritance graph
Collaboration diagram for hal::RAMPortComponent:
Collaboration graph

Public Member Functions

ComponentType get_type () const override
 
std::vector< GateTypeComponent * > get_components (const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const override
 
const std::string & get_data_group () const
 
void set_data_group (const std::string &data_group)
 
const std::string & get_address_group () const
 
void set_address_group (const std::string &addr_group)
 
const BooleanFunction & get_clock_function () const
 
void set_clock_function (const BooleanFunction &clock_bf)
 
const BooleanFunction & get_enable_function () const
 
void set_enable_function (const BooleanFunction &enable_bf)
 
bool is_write_port () const
 
void set_write_port (bool is_write)
 
- Public Member Functions inherited from hal::GateTypeComponent
virtual ~GateTypeComponent ()=default
 
template<typename T >
T * convert_to ()
 
template<typename T >
const T * convert_to () const
 
GateTypeComponent * get_component (const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const
 
template<typename T >
T * get_component_as (const std::function< bool(const GateTypeComponent *)> &filter=nullptr)
 

Static Public Member Functions

static std::unique_ptr< RAMPortComponent > create (std::unique_ptr< GateTypeComponent > component, const std::string &data_group, const std::string &addr_group, const BooleanFunction &clock_bf, const BooleanFunction &enable_bf, bool is_write)
 
static bool is_class_of (const GateTypeComponent *component)
 

Additional Inherited Members

- Public Types inherited from hal::GateTypeComponent
enum class  ComponentType {
  lut , ff , latch , ram ,
  mac , init , state , ram_port ,
  state_table
}
 

Detailed Description

A gate type component that describes a single read or write port of a random access memory.

Definition at line 38 of file ram_port_component.h.

Member Function Documentation

◆ create()

std::unique_ptr< RAMPortComponent > hal::RAMPortComponent::create ( std::unique_ptr< GateTypeComponent >  component,
const std::string &  data_group,
const std::string &  addr_group,
const BooleanFunction &  clock_bf,
const BooleanFunction &  enable_bf,
bool  is_write 
)
static

Create a new RAMPortComponent with given child component, the write/read data/address pin groups, and the write/read clock/enable functions.

Parameters
[in]component- Another component to be added as a child component.
[in]data_group- The name of the read or write data pin group.
[in]addr_group- The name of the read or write address pin group.
[in]clock_bf- The read or write clock's Boolean function.
[in]enable_bf- The read or write enable's Boolean function.
[in]is_write- Set true for write port, false for read port.
Returns
The RAMPortComponent.

Definition at line 17 of file ram_port_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::GateLibraryWizard::setComponents().

◆ get_address_group()

const std::string & hal::RAMPortComponent::get_address_group ( ) const

Get the name of the read or write address pin group.

Returns
The name of the pin group.

Definition at line 70 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().

◆ get_clock_function()

const BooleanFunction & hal::RAMPortComponent::get_clock_function ( ) const

Get the Boolean function determining the read or write clock.

Returns
The Boolean function.

Definition at line 80 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().

◆ get_components()

std::vector< GateTypeComponent * > hal::RAMPortComponent::get_components ( const std::function< bool(const GateTypeComponent *)> &  filter = nullptr) const
overridevirtual

Get the sub-components of the gate type component. A user-defined filter may be applied to the result vector, but is disabled by default.

Parameters
[in]filter- The user-defined filter function applied to all candidate components.
Returns
The sub-components of the gate type component.

Implements hal::GateTypeComponent.

Definition at line 37 of file ram_port_component.cpp.

◆ get_data_group()

const std::string & hal::RAMPortComponent::get_data_group ( ) const

Get the name of the read or write data pin group.

Returns
The name of the pin group.

Definition at line 60 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().

◆ get_enable_function()

const BooleanFunction & hal::RAMPortComponent::get_enable_function ( ) const

Get the Boolean function determining the read or write enable.

Returns
The Boolean function.

Definition at line 90 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().

◆ get_type()

RAMPortComponent::ComponentType hal::RAMPortComponent::get_type ( ) const
overridevirtual

Get the type of the gate type component.

Returns
The type of the gate type component.

Implements hal::GateTypeComponent.

Definition at line 27 of file ram_port_component.cpp.

◆ is_class_of()

bool hal::RAMPortComponent::is_class_of ( const GateTypeComponent *  component)
static

Check whether a component is a RAMPortComponent.

Parameters
[in]component- The component to check.
Returns
true if component is a RAMPortComponent, false otherwise.

Definition at line 32 of file ram_port_component.cpp.

References hal::GateTypeComponent::get_type().

Referenced by hal::gate_type_components_init(), hal::RAMPortWizardPage::initializePage(), and hal::GateLibraryFrameRAMPort::update().

◆ is_write_port()

bool hal::RAMPortComponent::is_write_port ( ) const

Check whether the port is a write or a read port.

Returns
true if the port is a write port, false otherwise.

Definition at line 100 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().

◆ set_address_group()

void hal::RAMPortComponent::set_address_group ( const std::string &  addr_group)

Set the name of the read or write address pin group.

Parameters
[in]addr_group- The name of the pin group.

Definition at line 75 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().

◆ set_clock_function()

void hal::RAMPortComponent::set_clock_function ( const BooleanFunction &  clock_bf)

Set the Boolean function determining the read or write clock.

Parameters
[in]clock_bf- The Boolean function.

Definition at line 85 of file ram_port_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init().

◆ set_data_group()

void hal::RAMPortComponent::set_data_group ( const std::string &  data_group)

Set the name of the read or write data pin group.

Parameters
[in]data_group- The name of the pin group.

Definition at line 65 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().

◆ set_enable_function()

void hal::RAMPortComponent::set_enable_function ( const BooleanFunction &  enable_bf)

Set the Boolean function determining the read or write enable.

Parameters
[in]enable_bf- The Boolean function.

Definition at line 95 of file ram_port_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init().

◆ set_write_port()

void hal::RAMPortComponent::set_write_port ( bool  is_write)

Set the port to be a write or a read port.

Parameters
[in]is_write- true to set the port to be a write port, false to set it to be a read port.

Definition at line 105 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().


The documentation for this class was generated from the following files: