HAL
hal::Gate Class Reference

#include <gate.h>

Inheritance diagram for hal::Gate:
Inheritance graph
Collaboration diagram for hal::Gate:
Collaboration graph

Public Member Functions

bool operator== (const Gate &other) const
 
bool operator!= (const Gate &other) const
 
ssize_t get_hash () const
 
u32 get_id () const
 
Netlistget_netlist () const
 
const std::string & get_name () const
 
void set_name (const std::string &name)
 
GateTypeget_type () const
 
bool has_location () const
 
void set_location_x (i32 x)
 
i32 get_location_x () const
 
void set_location_y (i32 y)
 
i32 get_location_y () const
 
void set_location (const std::pair< i32, i32 > &location)
 
std::pair< i32, i32get_location () const
 
Moduleget_module () const
 
std::vector< Module * > get_modules (const std::function< bool(Module *)> &filter=nullptr, bool recursive=true) const
 
Groupingget_grouping () const
 
BooleanFunction get_boolean_function (const std::string &name) const
 
BooleanFunction get_boolean_function (const GatePin *pin=nullptr) const
 
std::unordered_map< std::string, BooleanFunctionget_boolean_functions (bool only_custom_functions=false) const
 
Result< BooleanFunctionget_resolved_boolean_function (const GatePin *pin, const bool use_net_variables=false) const
 
bool add_boolean_function (const std::string &name, const BooleanFunction &func)
 
bool mark_vcc_gate ()
 
bool mark_gnd_gate ()
 
bool unmark_vcc_gate ()
 
bool unmark_gnd_gate ()
 
bool is_vcc_gate () const
 
bool is_gnd_gate () const
 
const std::vector< Net * > & get_fan_in_nets () const
 
std::vector< Net * > get_fan_in_nets (const std::function< bool(Net *)> &filter) const
 
Netget_fan_in_net (const std::string &pin_name) const
 
Netget_fan_in_net (const GatePin *pin) const
 
bool is_fan_in_net (const Net *net) const
 
const std::vector< Endpoint * > & get_fan_in_endpoints () const
 
std::vector< Endpoint * > get_fan_in_endpoints (const std::function< bool(Endpoint *)> &filter) const
 
Endpointget_fan_in_endpoint (const std::string &pin_name) const
 
Endpointget_fan_in_endpoint (const GatePin *pin) const
 
Endpointget_fan_in_endpoint (const Net *net) const
 
const std::vector< Net * > & get_fan_out_nets () const
 
std::vector< Net * > get_fan_out_nets (const std::function< bool(Net *)> &filter) const
 
Netget_fan_out_net (const std::string &pin_name) const
 
Netget_fan_out_net (const GatePin *pin) const
 
bool is_fan_out_net (const Net *net) const
 
const std::vector< Endpoint * > & get_fan_out_endpoints () const
 
std::vector< Endpoint * > get_fan_out_endpoints (const std::function< bool(Endpoint *)> &filter) const
 
Endpointget_fan_out_endpoint (const std::string &pin_name) const
 
Endpointget_fan_out_endpoint (const GatePin *pin) const
 
Endpointget_fan_out_endpoint (const Net *net) const
 
std::vector< Gate * > get_unique_predecessors (const std::function< bool(const GatePin *pin, Endpoint *ep)> &filter=nullptr) const
 
std::vector< Endpoint * > get_predecessors (const std::function< bool(const GatePin *pin, Endpoint *ep)> &filter=nullptr) const
 
Endpointget_predecessor (const std::string &pin_name) const
 
Endpointget_predecessor (const GatePin *pin) const
 
std::vector< Gate * > get_unique_successors (const std::function< bool(const GatePin *pin, Endpoint *ep)> &filter=nullptr) const
 
std::vector< Endpoint * > get_successors (const std::function< bool(const GatePin *pin, Endpoint *ep)> &filter=nullptr) const
 
Endpointget_successor (const std::string &pin_name) const
 
Endpointget_successor (const GatePin *pin) const
 
Result< std::vector< std::string > > get_init_data () const
 
Result< std::monostate > set_init_data (const std::vector< std::string > &init_data)
 
- Public Member Functions inherited from hal::DataContainer
 DataContainer ()=default
 
virtual ~DataContainer ()=default
 
bool operator== (const DataContainer &other) const
 
bool operator!= (const DataContainer &other) const
 
bool set_data (const std::string &category, const std::string &key, const std::string &data_type, const std::string &value, const bool log_with_info_level=false)
 
bool has_data (const std::string &category, const std::string &key) const
 
std::tuple< std::string, std::string > get_data (const std::string &category, const std::string &key) const
 
bool delete_data (const std::string &category, const std::string &key, const bool log_with_info_level=false)
 
const std::map< std::tuple< std::string, std::string >, std::tuple< std::string, std::string > > & get_data_map () const
 
void set_data_map (const std::map< std::tuple< std::string, std::string >, std::tuple< std::string, std::string >> &map)
 

Friends

class NetlistInternalManager
 

Additional Inherited Members

- Protected Attributes inherited from hal::DataContainer
std::map< std::tuple< std::string, std::string >, std::tuple< std::string, std::string > > m_data
 

Detailed Description

Gate class containing information about a gate including its location, functions, and module.

Definition at line 57 of file gate.h.

Member Function Documentation

◆ add_boolean_function()

bool hal::Gate::add_boolean_function ( const std::string &  name,
const BooleanFunction func 
)

◆ get_boolean_function() [1/2]

BooleanFunction hal::Gate::get_boolean_function ( const GatePin pin = nullptr) const

Get the Boolean function corresponding to the given output pin. If pin is a nullptr, the Boolean function of the first output pin is returned.

Parameters
[in]pin- The pin.
Returns
The Boolean function on success, an empty Boolean function otherwise.

Definition at line 246 of file gate.cpp.

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

◆ get_boolean_function() [2/2]

BooleanFunction hal::Gate::get_boolean_function ( const std::string &  name) const

Get the Boolean function specified by the given name. This name can for example be an output pin of the gate or any other user-defined function name.

Parameters
[in]name- The name.
Returns
The Boolean function on success, an empty Boolean function otherwise.

Definition at line 209 of file gate.cpp.

References hal::BasePin< T >::get_name(), hal::BasePin< T >::get_type(), log_warning, and name.

Referenced by hal::ActionAddBooleanFunction::exec(), and hal::gate_init().

◆ get_boolean_functions()

std::unordered_map< std::string, BooleanFunction > hal::Gate::get_boolean_functions ( bool  only_custom_functions = false) const

Get a map from function name to Boolean function for all boolean functions associated with this gate.

Parameters
[in]only_custom_functions- Set true to get only Boolean functions that are local to the gate, false otherwise.
Returns
A map from function name to function on success, an empty map otherwise.

Definition at line 262 of file gate.cpp.

References hal::BasePin< T >::get_name().

Referenced by hal::gate_init(), operator==(), hal::netlist_utils::remove_buffers(), and hal::netlist_utils::remove_unused_lut_endpoints().

◆ get_fan_in_endpoint() [1/3]

Endpoint * hal::Gate::get_fan_in_endpoint ( const GatePin pin) const

Get the fan-in endpoint corresponding to the specified input pin.

Parameters
[in]pin- The input pin.
Returns
The endpoint on success, a nullptr otherwise.

Definition at line 695 of file gate.cpp.

References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), log_debug, and log_warning.

◆ get_fan_in_endpoint() [2/3]

Endpoint * hal::Gate::get_fan_in_endpoint ( const Net net) const

Get the fan-in endpoint connected to the specified input net.

Parameters
[in]net- The input net.
Returns
The endpoint on success, a nullptr otherwise.

Definition at line 717 of file gate.cpp.

References log_warning, and net.

◆ get_fan_in_endpoint() [3/3]

Endpoint * hal::Gate::get_fan_in_endpoint ( const std::string &  pin_name) const

Get the fan-in endpoint corresponding to the input pin specified by name.

Parameters
[in]pin_name- The input pin name.
Returns
The endpoint on success, a nullptr otherwise.

Definition at line 679 of file gate.cpp.

References log_warning.

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

◆ get_fan_in_endpoints() [1/2]

const std::vector< Endpoint * > & hal::Gate::get_fan_in_endpoints ( ) const

◆ get_fan_in_endpoints() [2/2]

std::vector< Endpoint * > hal::Gate::get_fan_in_endpoints ( const std::function< bool(Endpoint *)> &  filter) const

Get a vector of all fan-in endpoints of the gate, i.e., all endpoints associated with an input pin of the gate. The filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- Filter function to be evaluated on each endpoint.
Returns
A vector of all fan-in endpoints.

Definition at line 658 of file gate.cpp.

◆ get_fan_in_net() [1/2]

Net * hal::Gate::get_fan_in_net ( const GatePin pin) const

Get the fan-in net corresponding to the specified input pin.

Parameters
[in]pin- The input pin.
Returns
The fan-in net on success, a nullptr otherwise.

Definition at line 627 of file gate.cpp.

◆ get_fan_in_net() [2/2]

Net * hal::Gate::get_fan_in_net ( const std::string &  pin_name) const

Get the fan-in net corresponding to the input pin specified by name.

Parameters
[in]pin_name- The input pin name.
Returns
The fan-in net on success, a nullptr otherwise.

Definition at line 617 of file gate.cpp.

Referenced by hal::NetlistModificationDecorator::connect_gates(), hal::gate_init(), hal::netlist_utils::get_nets_at_pins(), and hal::TEST_F().

◆ get_fan_in_nets() [1/2]

const std::vector< Net * > & hal::Gate::get_fan_in_nets ( ) const

Get a vector of all fan-in nets of the gate, i.e., all nets that are connected to one of the input pins.

Returns
A vector of all fan-in nets.

Definition at line 591 of file gate.cpp.

Referenced by hal::gate_init(), hal::netlist_utils::get_next_sequential_gates(), hal::netlist_utils::get_path(), hal::ModuleModel::moduleAssignNets(), hal::ShortestPath::net(), and hal::TEST_F().

◆ get_fan_in_nets() [2/2]

std::vector< Net * > hal::Gate::get_fan_in_nets ( const std::function< bool(Net *)> &  filter) const

Get a vector of all fan-in nets of the gate, i.e., all nets that are connected to one of the input pins. The filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- Filter function to be evaluated on each net.
Returns
A vector of all fan-in nets.

Definition at line 596 of file gate.cpp.

References test::n.

◆ get_fan_out_endpoint() [1/3]

Endpoint * hal::Gate::get_fan_out_endpoint ( const GatePin pin) const

Get the fan-out endpoint corresponding to the specified input pin.

Parameters
[in]pin- The output pin.
Returns
The endpoint on success, a nullptr otherwise.

Definition at line 834 of file gate.cpp.

References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), log_debug, and log_warning.

◆ get_fan_out_endpoint() [2/3]

Endpoint * hal::Gate::get_fan_out_endpoint ( const Net net) const

Get the fan-out endpoint connected to the specified output net.

Parameters
[in]net- The output net.
Returns
The endpoint on success, a nullptr otherwise.

Definition at line 856 of file gate.cpp.

References log_warning, and net.

◆ get_fan_out_endpoint() [3/3]

Endpoint * hal::Gate::get_fan_out_endpoint ( const std::string &  pin_name) const

Get the fan-out endpoint corresponding to the output pin specified by name.

Parameters
[in]pin_name- The output pin name.
Returns
The endpoint on success, a nullptr otherwise.

Definition at line 823 of file gate.cpp.

References log_warning.

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

◆ get_fan_out_endpoints() [1/2]

const std::vector< Endpoint * > & hal::Gate::get_fan_out_endpoints ( ) const

Get a vector of all fan-out endpoints of the gate, i.e., all endpoints associated with an output pin of the gate.

Returns
A vector of all fan-out endpoints.

Definition at line 797 of file gate.cpp.

Referenced by hal::gate_init(), hal::NetlistTraversalDecorator::get_next_combinational_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates_until_depth(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), hal::netlist_utils::remove_buffers(), and hal::NetlistModificationDecorator::replace_gate().

◆ get_fan_out_endpoints() [2/2]

std::vector< Endpoint * > hal::Gate::get_fan_out_endpoints ( const std::function< bool(Endpoint *)> &  filter) const

Get a vector of all fan-out endpoints of the gate, i.e., all endpoints associated with an output pin of the gate. The filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- Filter function to be evaluated on each endpoint.
Returns
A vector of all fan-out endpoints.

Definition at line 802 of file gate.cpp.

◆ get_fan_out_net() [1/2]

Net * hal::Gate::get_fan_out_net ( const GatePin pin) const

Get the fan-out net corresponding to the specified output pin.

Parameters
[in]pin- The output pin.
Returns
The fan-out net on success, a nullptr otherwise.

Definition at line 771 of file gate.cpp.

◆ get_fan_out_net() [2/2]

Net * hal::Gate::get_fan_out_net ( const std::string &  pin_name) const

Get the fan-out net corresponding to the output pin specified by name.

Parameters
[in]pin_name- The output pin name.
Returns
The fan-out net on success, a nullptr otherwise.

Definition at line 761 of file gate.cpp.

Referenced by hal::NetlistModificationDecorator::connect_gates(), hal::gate_init(), hal::netlist_utils::get_nets_at_pins(), and hal::TEST_F().

◆ get_fan_out_nets() [1/2]

const std::vector< Net * > & hal::Gate::get_fan_out_nets ( ) const

Get a vector of all fan-out nets of the gate, i.e., all nets that are connected to one of the output pins.

Returns
A vector of all fan-out nets.

Definition at line 735 of file gate.cpp.

Referenced by hal::gate_init(), hal::boolean_influence::get_ff_dependency_matrix(), hal::netlist_utils::get_next_sequential_gates(), hal::netlist_utils::get_path(), hal::ModuleModel::moduleAssignNets(), hal::ShortestPath::net(), and hal::TEST_F().

◆ get_fan_out_nets() [2/2]

std::vector< Net * > hal::Gate::get_fan_out_nets ( const std::function< bool(Net *)> &  filter) const

Get a vector of all fan-out nets of the gate, i.e., all nets that are connected to one of the output pins. The filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- Filter function to be evaluated on each net.
Returns
A vector of all fan-out nets.

Definition at line 740 of file gate.cpp.

References test::n.

◆ get_grouping()

Grouping * hal::Gate::get_grouping ( ) const

Gets the grouping in which this gate is contained.
If no grouping contains this gate, a nullptr is returned.

Returns
The grouping.

Definition at line 204 of file gate.cpp.

Referenced by hal::ModuleContextMenu::addGateSubmenu(), hal::gate_init(), hal::SelectionDetailsWidget::groupingUnassignActionFactory(), hal::GroupingManagerWidget::removeElementsFromGrouping(), hal::NetlistModificationDecorator::replace_gate(), and hal::GroupingsOfItemModel::setGate().

◆ get_hash()

ssize_t hal::Gate::get_hash ( ) const

Hash function for python binding.

Returns
Pybind11 compatible hash.

Definition at line 90 of file gate.cpp.

Referenced by hal::gate_init().

◆ get_id()

◆ get_init_data()

Result< std::vector< std::string > > hal::Gate::get_init_data ( ) const

Get the INIT data of the gate, if available. An error is returned in case the gate does not hold any INIT data.

Returns
The INIT data as a vector on success, an error message otherwise.

Definition at line 1034 of file gate.cpp.

References ERR, hal::GateTypeComponent::get_component_as(), hal::InitComponent::get_init_category(), hal::InitComponent::get_init_identifiers(), and OK.

◆ get_location()

std::pair< i32, i32 > hal::Gate::get_location ( ) const

Get the physical location of the gate in the layout.
If no valid physical location coordinate is assigned, a negative value is returned for the respective coordinate.

Returns
A pair <x-coordinate, y-coordinate>.

Definition at line 140 of file gate.cpp.

Referenced by hal::gate_init(), and hal::NetlistModificationDecorator::replace_gate().

◆ get_location_x()

i32 hal::Gate::get_location_x ( ) const

Get the physical location x-coordinate of the gate in the layout.
If no valid physical location x-coordinate is assigned, a negative value is returned.

Returns
The gate's x-coordinate.

Definition at line 130 of file gate.cpp.

Referenced by hal::gate_init(), and operator==().

◆ get_location_y()

i32 hal::Gate::get_location_y ( ) const

Get the physical location y-coordinate of the gate in the layout.
If no valid physical location y-coordinate is assigned, a negative value is returned.

Returns
The gate's y-coordinate.

Definition at line 135 of file gate.cpp.

Referenced by hal::gate_init(), and operator==().

◆ get_module()

Module * hal::Gate::get_module ( ) const

Get the module which contains this gate.

Returns
The module.

Definition at line 174 of file gate.cpp.

Referenced by hal::gate_init(), and hal::NetlistModificationDecorator::replace_gate().

◆ get_modules()

std::vector< Module * > hal::Gate::get_modules ( const std::function< bool(Module *)> &  filter = nullptr,
bool  recursive = true 
) const

Get all modules that contain this gate, either directly or as parent of another module. If recursive is set to true, indirect parent modules are also included. Otherwise, only the module containing the gate directly is returned.
The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- An optional filter.
[in]recursive- Set true to include indirect parents as well, false otherwise.
Returns
A vector of modules.

Definition at line 179 of file gate.cpp.

References hal::Module::get_parent_modules().

Referenced by hal::gate_init().

◆ get_name()

◆ get_netlist()

◆ get_predecessor() [1/2]

Endpoint * hal::Gate::get_predecessor ( const GatePin pin) const

Get a single direct predecessor endpoint that is connected to the specified input pin. Fails if there are no or more than one predecessors.

Parameters
[in]pin- The input pin.
Returns
The predecessor endpoint on success, a nullptr otherwise.

Definition at line 912 of file gate.cpp.

References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), and log_warning.

◆ get_predecessor() [2/2]

Endpoint * hal::Gate::get_predecessor ( const std::string &  pin_name) const

Get a single direct predecessor endpoint that is connected to the input pin specified by name. Fails if there are no or more than one predecessors.

Parameters
[in]pin_name- The input pin name.
Returns
The predecessor endpoint on success, a nullptr otherwise.

Definition at line 938 of file gate.cpp.

References log_warning.

Referenced by hal::gate_init().

◆ get_predecessors()

std::vector< Endpoint * > hal::Gate::get_predecessors ( const std::function< bool(const GatePin *pin, Endpoint *ep)> &  filter = nullptr) const

Get a vector of all direct predecessor endpoints of the gate, i.e., all predecessor endpoints that are connected to an input pin of the gate. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- An optional filter being evaluated on the gate's input pin as well as the predecessor endpoint.
Returns
A vector of predecessor endpoints.

Definition at line 886 of file gate.cpp.

Referenced by hal::gate_init(), and hal::netlist_utils::get_complex_gate_chain().

◆ get_resolved_boolean_function()

Result< BooleanFunction > hal::Gate::get_resolved_boolean_function ( const GatePin pin,
const bool  use_net_variables = false 
) const

Get the resolved Boolean function corresponding to the given output pin, i.e., a Boolean function that only depends on input pins (or nets) and no internal or output pins. If fan-in nets are used to derive variable names, the variable names are generated using the BooleanFunctionNetDecorator.

Parameters
[in]pin- The output pin.
[in]use_net_variables- Set true to use variable names derived from fan-in nets of the gate, false to use input pin names instead. Defaults to false.
Returns
The Boolean function on success, an error otherwise.

Definition at line 287 of file gate.cpp.

References ERR, ERR_APPEND, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), hal::BooleanFunction::get_variable_names(), OK, hal::BooleanFunction::substitute(), and hal::utils::to_vector().

◆ get_successor() [1/2]

Endpoint * hal::Gate::get_successor ( const GatePin pin) const

Get a single direct successor endpoint that is connected to the specified output pin. Fails if there are no or more than one successors.

Parameters
[in]pin- The output pin.
Returns
The successor endpoint on success, a nullptr otherwise.

Definition at line 992 of file gate.cpp.

References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), and log_warning.

◆ get_successor() [2/2]

Endpoint * hal::Gate::get_successor ( const std::string &  pin_name) const

Get a single direct successor endpoint that is connected to the output pin specified by name. Fails if there are no or more than one successors.

Parameters
[in]pin_name- The output pin name.
Returns
The successor endpoint on success, a nullptr otherwise.

Definition at line 1018 of file gate.cpp.

References log_warning.

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

◆ get_successors()

std::vector< Endpoint * > hal::Gate::get_successors ( const std::function< bool(const GatePin *pin, Endpoint *ep)> &  filter = nullptr) const

Get a vector of all direct successor endpoints of the gate, i.e., all successor endpoints that are connected to an output pin of the gate. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- An optional filter being evaluated on the gate's output pin as well as the successor endpoint.
Returns
A vector of successor endpoints.

Definition at line 966 of file gate.cpp.

Referenced by hal::gate_init(), hal::netlist_utils::get_complex_gate_chain(), and hal::netlist_utils::get_gate_chain().

◆ get_type()

◆ get_unique_predecessors()

std::vector< Gate * > hal::Gate::get_unique_predecessors ( const std::function< bool(const GatePin *pin, Endpoint *ep)> &  filter = nullptr) const

Get a vector of all unique predecessor gates of the gate. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- An optional filter being evaluated on the gate's input pin as well as the predecessor endpoint.
Returns
A vector of unique predecessor gates.

Definition at line 874 of file gate.cpp.

Referenced by hal::gate_init().

◆ get_unique_successors()

std::vector< Gate * > hal::Gate::get_unique_successors ( const std::function< bool(const GatePin *pin, Endpoint *ep)> &  filter = nullptr) const

Get a vector of all unique successor gates of the gate. The optional filter is evaluated on every candidate such that the result only contains those matching the specified condition.

Parameters
[in]filter- An optional filter being evaluated on the gate's output pin as well as the successor endpoint.
Returns
A vector of unique successor gates.

Definition at line 954 of file gate.cpp.

Referenced by hal::gate_init().

◆ has_location()

bool hal::Gate::has_location ( ) const

Check whether the gate's location in the layout is available.

Returns
True if valid location data is available, false otherwise.

Definition at line 145 of file gate.cpp.

Referenced by hal::gate_init().

◆ is_fan_in_net()

bool hal::Gate::is_fan_in_net ( const Net net) const

Check whether the given net is a fan-in of the gate.

Parameters
[in]net- The net.
Returns
true if the net is a fan-in of the gate, false otherwise.

Definition at line 637 of file gate.cpp.

References log_warning, and net.

Referenced by hal::gate_init().

◆ is_fan_out_net()

bool hal::Gate::is_fan_out_net ( const Net net) const

Check whether the given net is a fan-out of the gate.

Parameters
[in]net- The net.
Returns
true if the net is a fan-out of the gate, false otherwise.

Definition at line 781 of file gate.cpp.

References log_warning, and net.

Referenced by hal::gate_init().

◆ is_gnd_gate()

bool hal::Gate::is_gnd_gate ( ) const

Checks whether this gate is a global gnd gate.

Returns
True if the gate is a global gnd gate.

Definition at line 586 of file gate.cpp.

Referenced by hal::gate_init(), and operator==().

◆ is_vcc_gate()

bool hal::Gate::is_vcc_gate ( ) const

Checks whether this gate is a global vcc gate.

Returns
True if the gate is a global vcc gate.

Definition at line 581 of file gate.cpp.

Referenced by hal::gate_init(), and operator==().

◆ mark_gnd_gate()

bool hal::Gate::mark_gnd_gate ( )

Mark this gate as a global gnd gate.

Returns
True on success.

Definition at line 566 of file gate.cpp.

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

◆ mark_vcc_gate()

bool hal::Gate::mark_vcc_gate ( )

Mark this gate as a global vcc gate.

Returns
True on success.

Definition at line 561 of file gate.cpp.

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

◆ operator!=()

bool hal::Gate::operator!= ( const Gate other) const

Check whether two gates are unequal. Does not check for connected nets or containing module.

Parameters
[in]other- The gate to compare against.
Returns
True if both gates are unequal, false otherwise.

Definition at line 85 of file gate.cpp.

◆ operator==()

bool hal::Gate::operator== ( const Gate other) const

Check whether two gates are equal. Does not check for connected nets or containing module.

Parameters
[in]other- The gate to compare against.
Returns
True if both gates are equal, false otherwise.

Definition at line 50 of file gate.cpp.

References get_boolean_functions(), get_id(), get_location_x(), get_location_y(), get_name(), get_type(), is_gnd_gate(), is_vcc_gate(), and log_debug.

◆ set_init_data()

Result< std::monostate > hal::Gate::set_init_data ( const std::vector< std::string > &  init_data)

Set the INIT data of the gate, if available. An error is returned in case the gate does not hold any INIT data.

Parameters
[in]init_data- The INIT data as a vector.
Returns
Ok on success, an error message otherwise.

Definition at line 1055 of file gate.cpp.

References ERR, hal::GateTypeComponent::get_component_as(), hal::InitComponent::get_init_category(), hal::InitComponent::get_init_identifiers(), and OK.

◆ set_location()

void hal::Gate::set_location ( const std::pair< i32, i32 > &  location)

Set the physical location of the gate in the layout.
Only positive coordinates are valid, negative values will be regarded as no location assigned.

Parameters
[in]location- A pair <x-coordinate, y-coordinate>.

Definition at line 168 of file gate.cpp.

Referenced by hal::gate_init().

◆ set_location_x()

void hal::Gate::set_location_x ( i32  x)

Set the physical location x-coordinate of the gate in the layout.
Only positive values are valid, negative values will be regarded as no location assigned.

Parameters
[in]x- The gate's x-coordinate.

Definition at line 150 of file gate.cpp.

Referenced by hal::gate_init().

◆ set_location_y()

void hal::Gate::set_location_y ( i32  y)

Set the physical location y-coordinate of the gate in the layout.
Only positive values are valid, negative values will be regarded as no location assigned.

Parameters
[in]y- The gate's y-coordinate.

Definition at line 159 of file gate.cpp.

Referenced by hal::gate_init().

◆ set_name()

void hal::Gate::set_name ( const std::string &  name)

Set the name of the gate.

Parameters
[in]name- The new name.

Definition at line 110 of file gate.cpp.

References log_error, name, and hal::utils::trim().

Referenced by hal::ActionRenameObject::exec(), and hal::gate_init().

◆ unmark_gnd_gate()

bool hal::Gate::unmark_gnd_gate ( )

Unmark this gate as a global gnd gate.

Returns
True on success.

Definition at line 576 of file gate.cpp.

Referenced by hal::gate_init().

◆ unmark_vcc_gate()

bool hal::Gate::unmark_vcc_gate ( )

Unmark this gate as a global vcc gate.

Returns
True on success.

Definition at line 571 of file gate.cpp.

Referenced by hal::gate_init().

Friends And Related Function Documentation

◆ NetlistInternalManager

friend class NetlistInternalManager
friend

Definition at line 542 of file gate.h.


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