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

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

Inheritance diagram for hal::StateTableComponent:
Inheritance graph
Collaboration diagram for hal::StateTableComponent:
Collaboration graph

Classes

struct  StateTable
 
struct  TableRow
 

Public Types

enum class  TableInputSymbol {
  LOW , HIGH , DONT_CARE , RISING ,
  FALLING , NOT_RISING , NOT_FALLING
}
 
enum class  TableOutputSymbol {
  LOW , HIGH , UNSPECIFIED , UNKNOWN ,
  HOLD
}
 
- Public Types inherited from hal::GateTypeComponent
enum class  ComponentType {
  lut , ff , latch , ram ,
  mac , init , state , ram_port ,
  state_table
}
 

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::vector< StateTable > & get_state_tables () const
 
Result< const StateTable * > get_state_table_for_pin (const std::string &pin_name) const
 
Result< const StateTable * > get_state_table_for_pin (const GatePin *pin) const
 
- 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< StateTableComponent > create (std::unique_ptr< GateTypeComponent > component, std::vector< StateTable > tables)
 
static bool is_class_of (const GateTypeComponent *component)
 

Detailed Description

A component describing the behavior of a sequential gate type via a Liberty statetable. Acts as a subcomponent of FFComponent or LatchComponent.

Definition at line 43 of file state_table_component.h.

Member Enumeration Documentation

◆ TableInputSymbol

Symbol for an input column or current-state column entry in a statetable row. L/H and H/L are expanded into two rows at parse time and never appear in stored rows.

Enumerator
LOW 

Logic low (L).

HIGH 

Logic high (H).

DONT_CARE 

Don't care (-).

RISING 

Rising edge (R).

FALLING 

Falling edge (F).

NOT_RISING 

Not rising edge (~R).

NOT_FALLING 

Not falling edge (~F).

Definition at line 50 of file state_table_component.h.

◆ TableOutputSymbol

Symbol for a next-state column entry in a statetable row. L/H and H/L are expanded into two rows at parse time and never appear in stored rows.

Enumerator
LOW 

Force low (L).

HIGH 

Force high (H).

UNSPECIFIED 

Output not specified (-).

UNKNOWN 

Unknown (X).

HOLD 

Hold current value (N).

Definition at line 65 of file state_table_component.h.

Member Function Documentation

◆ create()

std::unique_ptr< StateTableComponent > hal::StateTableComponent::create ( std::unique_ptr< GateTypeComponent >  component,
std::vector< StateTable >  tables 
)
static

Create a new StateTableComponent.

Parameters
[in]component- Child component to take ownership of (typically nullptr or an InitComponent).
[in]tables- Per-pin state tables, fully resolved to pin names.
Returns
The StateTableComponent.

Definition at line 12 of file state_table_component.cpp.

◆ get_components()

std::vector< GateTypeComponent * > hal::StateTableComponent::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 27 of file state_table_component.cpp.

◆ get_state_table_for_pin() [1/2]

Result< const StateTableComponent::StateTable * > hal::StateTableComponent::get_state_table_for_pin ( const GatePin *  pin) const

Get the state table for a specific pin.

Parameters
[in]pin- The pin.
Returns
The StateTable for that pin on success, an error otherwise.

Definition at line 65 of file state_table_component.cpp.

References ERR, and hal::BasePin< T >::get_name().

◆ get_state_table_for_pin() [2/2]

Result< const StateTableComponent::StateTable * > hal::StateTableComponent::get_state_table_for_pin ( const std::string &  pin_name) const

Get the state table for a specific pin.

Parameters
[in]pin_name- The name of the pin.
Returns
The StateTable for that pin on success, an error otherwise.

Definition at line 53 of file state_table_component.cpp.

References ERR, and OK.

◆ get_state_tables()

const std::vector< StateTableComponent::StateTable > & hal::StateTableComponent::get_state_tables ( ) const

Get all per-pin state tables.

Returns
The state tables.

Definition at line 48 of file state_table_component.cpp.

◆ get_type()

StateTableComponent::ComponentType hal::StateTableComponent::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 17 of file state_table_component.cpp.

◆ is_class_of()

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

Check whether a component is a StateTableComponent.

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

Definition at line 22 of file state_table_component.cpp.

References hal::GateTypeComponent::get_type().


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