HAL
hal::RAMPortComponent Class Reference

#include <ram_port_component.h>

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

Public Member Functions

 RAMPortComponent (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)
 
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 BooleanFunctionget_clock_function () const
 
void set_clock_function (const BooleanFunction &clock_bf)
 
const BooleanFunctionget_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
 
GateTypeComponentget_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 bool is_class_of (const GateTypeComponent *component)
 
- Static Public Member Functions inherited from hal::GateTypeComponent
static std::unique_ptr< GateTypeComponentcreate_lut_component (std::unique_ptr< GateTypeComponent > component, bool init_ascending)
 
static std::unique_ptr< GateTypeComponentcreate_ff_component (std::unique_ptr< GateTypeComponent > component, const BooleanFunction &next_state_bf, const BooleanFunction &clock_bf)
 
static std::unique_ptr< GateTypeComponentcreate_latch_component (std::unique_ptr< GateTypeComponent > component)
 
static std::unique_ptr< GateTypeComponentcreate_ram_component (std::unique_ptr< GateTypeComponent > component, const u32 bit_size)
 
static std::unique_ptr< GateTypeComponentcreate_mac_component ()
 
static std::unique_ptr< GateTypeComponentcreate_init_component (const std::string &init_category, const std::vector< std::string > &init_identifiers)
 
static std::unique_ptr< GateTypeComponentcreate_state_component (std::unique_ptr< GateTypeComponent > component, const std::string &state_identifier, const std::string &neg_state_identifier)
 
static std::unique_ptr< GateTypeComponentcreate_ram_port_component (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)
 

Additional Inherited Members

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

Detailed Description

Definition at line 33 of file ram_port_component.h.

Constructor & Destructor Documentation

◆ RAMPortComponent()

hal::RAMPortComponent::RAMPortComponent ( 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 
)

Construct 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- True if the port is a write port, false otherwise.

Definition at line 5 of file ram_port_component.cpp.

Member Function Documentation

◆ 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 58 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 68 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 25 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 48 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 78 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 15 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 20 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 if it is a read port.

Definition at line 88 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 63 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 73 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 53 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 83 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 93 of file ram_port_component.cpp.

Referenced by hal::gate_type_components_init().


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