HAL
hal::FFComponent Class Reference

#include <ff_component.h>

Inheritance diagram for hal::FFComponent:
Inheritance graph
Collaboration diagram for hal::FFComponent:
Collaboration graph

Public Member Functions

 FFComponent (std::unique_ptr< GateTypeComponent > component, const BooleanFunction &next_state_bf, const BooleanFunction &clock_bf)
 
ComponentType get_type () const override
 
std::vector< GateTypeComponent * > get_components (const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const override
 
BooleanFunction get_next_state_function () const
 
void set_next_state_function (const BooleanFunction &next_state_bf)
 
BooleanFunction get_clock_function () const
 
void set_clock_function (const BooleanFunction &clock_bf)
 
BooleanFunction get_async_reset_function () const
 
void set_async_reset_function (const BooleanFunction &async_reset_bf)
 
BooleanFunction get_async_set_function () const
 
void set_async_set_function (const BooleanFunction &async_set_bf)
 
const std::pair< AsyncSetResetBehavior, AsyncSetResetBehavior > & get_async_set_reset_behavior () const
 
void set_async_set_reset_behavior (const AsyncSetResetBehavior behav_state, const AsyncSetResetBehavior behav_neg_state)
 
- 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 34 of file ff_component.h.

Constructor & Destructor Documentation

◆ FFComponent()

hal::FFComponent::FFComponent ( std::unique_ptr< GateTypeComponent component,
const BooleanFunction next_state_bf,
const BooleanFunction clock_bf 
)

Construct a new FFComponent with given child component and the Boolean functions describing the next state and the clock signal.

Parameters
[in]component- Another component to be added as a child component.
[in]next_state_bf- The function describing the internal state.
[in]clock_bf- The function describing the clock input.

Definition at line 5 of file ff_component.cpp.

Member Function Documentation

◆ get_async_reset_function()

BooleanFunction hal::FFComponent::get_async_reset_function ( ) const

Get the Boolean function describing the asynchronous reset behavior of the flip-flop. Returns an empty function if asynchronous reset is not supported by the flip-flop.

Returns
The function describing the asynchronous reset behavior.

Definition at line 63 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init(), and hal::TEST_F().

◆ get_async_set_function()

BooleanFunction hal::FFComponent::get_async_set_function ( ) const

Get the Boolean function describing the asynchronous set behavior of the flip-flop. Returns an empty function if asynchronous set is not supported by the flip-flop.

Returns
The function describing the asynchronous set behavior.

Definition at line 73 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init(), and hal::TEST_F().

◆ get_async_set_reset_behavior()

const std::pair< AsyncSetResetBehavior, AsyncSetResetBehavior > & hal::FFComponent::get_async_set_reset_behavior ( ) const

Get the behavior of the internal state and the negated internal state when both asynchronous set and reset are active at the same time.

Returns
The values specifying the behavior for the internal and negated internal state.

Definition at line 83 of file ff_component.cpp.

Referenced by hal::gate_type_components_init(), and hal::TEST_F().

◆ get_clock_function()

BooleanFunction hal::FFComponent::get_clock_function ( ) const

Get the Boolean function describing the clock input of the flip-flop.

Returns
The function describing the clock input.

Definition at line 53 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init(), and hal::TEST_F().

◆ get_components()

std::vector< GateTypeComponent * > hal::FFComponent::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 20 of file ff_component.cpp.

◆ get_next_state_function()

BooleanFunction hal::FFComponent::get_next_state_function ( ) const

Get the Boolean function describing the next internal state of the flip-flop.

Returns
The function describing the internal state.

Definition at line 43 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init(), and hal::TEST_F().

◆ get_type()

FFComponent::ComponentType hal::FFComponent::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 10 of file ff_component.cpp.

◆ is_class_of()

bool hal::FFComponent::is_class_of ( const GateTypeComponent component)
static

Check whether a component is a FFComponent.

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

Definition at line 15 of file ff_component.cpp.

References hal::GateTypeComponent::get_type().

Referenced by hal::gate_type_components_init(), hal::FlipFlopWizardPage::setData(), hal::TEST_F(), and hal::GatelibraryFrameFF::update().

◆ set_async_reset_function()

void hal::FFComponent::set_async_reset_function ( const BooleanFunction async_reset_bf)

Set the Boolean function describing the asynchronous reset behavior of the flip-flop.

Parameters
[in]async_reset_bf- The function describing the asynchronous reset behavior.

Definition at line 68 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init(), and hal::GateLibraryWizard::setComponents().

◆ set_async_set_function()

void hal::FFComponent::set_async_set_function ( const BooleanFunction async_set_bf)

Set the Boolean function describing the asynchronous set behavior of the flip-flop.

Parameters
[in]async_set_bf- The function describing the asynchronous set behavior.

Definition at line 78 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init(), and hal::GateLibraryWizard::setComponents().

◆ set_async_set_reset_behavior()

void hal::FFComponent::set_async_set_reset_behavior ( const AsyncSetResetBehavior  behav_state,
const AsyncSetResetBehavior  behav_neg_state 
)

Set the behavior of the internal state and the negated internal state when both asynchronous set and reset are active at the same time.

Parameters
[in]behav_state- The behavior of the internal state.
[in]behav_neg_state- The behavior of the negated internal state.

Definition at line 88 of file ff_component.cpp.

Referenced by hal::gate_type_components_init(), and hal::GateLibraryWizard::setComponents().

◆ set_clock_function()

void hal::FFComponent::set_clock_function ( const BooleanFunction clock_bf)

Set the Boolean function describing the clock input of the flip-flop.

Parameters
[in]clock_bf- The function describing the clock input.

Definition at line 58 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init().

◆ set_next_state_function()

void hal::FFComponent::set_next_state_function ( const BooleanFunction next_state_bf)

Set the Boolean function describing the next internal state of the flip-flop.

Parameters
[in]next_state_bf- The function describing the internal state.

Definition at line 48 of file ff_component.cpp.

References hal::BooleanFunction::clone().

Referenced by hal::gate_type_components_init().


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