|
HAL
v4.5.0-259-g577210b12
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
#include <hal_core/netlist/gate.h>


Public Member Functions | |
| bool | operator== (const Gate &other) const |
| bool | operator!= (const Gate &other) const |
| ssize_t | get_hash () const |
| u32 | get_id () const |
| Netlist * | get_netlist () const |
| const std::string & | get_name () const |
| void | set_name (const std::string &name) |
| GateType * | get_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, i32 > | get_location () const |
| Module * | get_module () const |
| std::vector< Module * > | get_modules (const std::function< bool(Module *)> &filter=nullptr, bool recursive=true) const |
| Grouping * | get_grouping () const |
| BooleanFunction | get_boolean_function (const std::string &name) const |
| Result< BooleanFunction > | get_boolean_function (const std::string &name, bool inlined, bool substitute_nets) const |
| BooleanFunction | get_boolean_function (const GatePin *pin=nullptr) const |
| Result< BooleanFunction > | get_boolean_function (const GatePin *pin, bool inlined, bool substitute_nets) const |
| bool | has_boolean_function (const std::string &name) const |
| bool | has_boolean_function (const GatePin *pin) const |
| std::unordered_map< std::string, BooleanFunction > | get_boolean_functions (bool only_custom_functions=false) const |
| Result< std::unordered_map< std::string, BooleanFunction > > | get_boolean_functions (bool only_custom_functions, bool inlined, bool substitute_nets) 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 |
| Net * | get_fan_in_net (const std::string &pin_name) const |
| Net * | get_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 |
| Endpoint * | get_fan_in_endpoint (const std::string &pin_name) const |
| Endpoint * | get_fan_in_endpoint (const GatePin *pin) const |
| Endpoint * | get_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 |
| Net * | get_fan_out_net (const std::string &pin_name) const |
| Net * | get_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 |
| Endpoint * | get_fan_out_endpoint (const std::string &pin_name) const |
| Endpoint * | get_fan_out_endpoint (const GatePin *pin) const |
| Endpoint * | get_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 |
| Endpoint * | get_predecessor (const std::string &pin_name) const |
| Endpoint * | get_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 |
| Endpoint * | get_successor (const std::string &pin_name) const |
| Endpoint * | get_successor (const GatePin *pin) const |
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) |
| Result< std::monostate > | set_parameter (const Parameter ¶m, const std::string &value) |
| Result< std::string > | get_parameter_value (const std::string &name) const |
| Result< std::string > | get_parameter_value (const Parameter &name) const |
| Result< Parameter > | get_parameter_declaration (const std::string &name) const |
| bool | has_parameter (const Parameter ¶m) const |
| bool | has_parameter (const std::string &name) const |
| bool | delete_parameter (const std::string &name) |
| const std::unordered_map< std::string, std::pair< Parameter, std::string > > & | get_parameters () const |
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 |
| std::unordered_map< std::string, std::pair< Parameter, std::string > > | m_parameters |
Gate class containing information about a gate including its location, functions, and module.
| bool hal::Gate::add_boolean_function | ( | const std::string & | name, |
| const BooleanFunction & | func | ||
| ) |
Add a Boolean function with the given name to the gate.
| [in] | name | - The name. |
| [in] | func | - The function. |
Definition at line 704 of file gate.cpp.
References hal::LUTComponent::LUTOutputConfig::bit_count, hal::LUTComponent::LUTOutputConfig::bit_offset, hal::BooleanFunction::compute_truth_table(), hal::GateTypeComponent::get_component_as(), hal::BasePin< T >::get_name(), hal::LUTComponent::get_output_pin_config(), hal::BasePin< T >::get_type(), hal::LUTComponent::LUTOutputConfig::init_identifier, hal::LUTComponent::LUTOutputConfig::input_pins, hal::LUTComponent::LUTOutputConfig::is_ascending, log_error, name, and hal::BooleanFunction::to_string().
Referenced by hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and hal::gate_init().
| Result< BooleanFunction > hal::Gate::get_boolean_function | ( | const GatePin * | pin, |
| bool | inlined, | ||
| bool | substitute_nets | ||
| ) | const |
Get the Boolean function corresponding to the given output pin, with full error reporting. When inlined is true, internal and output pin variables are recursively substituted with their definitions, and any gate-instance parameter values are reduced. When substitute_nets is true, the remaining input pin variables are additionally substituted with variable names derived from the fan-in nets using BooleanFunctionNetDecorator. substitute_nets requires inlined to be true; passing substitute_nets=true with inlined=false returns an error. Returns an error if pin is nullptr.
| [in] | pin | - The output pin. |
| [in] | inlined | - Set true to inline internal and output pins and reduce parameter-conditional expressions. |
| [in] | substitute_nets | - Set true to substitute input pin variables with fan-in net variables. Requires every input pin to have a connected net. |
Definition at line 400 of file gate.cpp.
References ERR, and hal::BasePin< T >::get_name().
| BooleanFunction hal::Gate::get_boolean_function | ( | const GatePin * | pin = nullptr | ) | const |
Get the raw Boolean function corresponding to the given output pin without inlining or net substitution. If pin is a nullptr, the Boolean function of the first output pin is returned. For full control over inlining and net substitution use the Result-returning overload.
| [in] | pin | - The pin. |
Definition at line 385 of file gate.cpp.
References hal::BasePin< T >::get_name(), and log_warning.
| BooleanFunction hal::Gate::get_boolean_function | ( | const std::string & | name | ) | const |
Get the raw Boolean function specified by the given name without inlining or net substitution. This name can for example be an output pin of the gate or any other user-defined function name. For full control over inlining and net substitution use the Result-returning overload.
| [in] | name | - The name. If empty, the first output pin is used. |
Definition at line 246 of file gate.cpp.
References log_warning, and name.
Referenced by hal::resynthesis::decompose_gate(), hal::resynthesis::decompose_gates_of_type(), hal::ActionAddBooleanFunction::exec(), and hal::gate_init().
| Result< BooleanFunction > hal::Gate::get_boolean_function | ( | const std::string & | name, |
| bool | inlined, | ||
| bool | substitute_nets | ||
| ) | const |
Get the Boolean function specified by the given name, with full error reporting. When inlined is true, internal and output pin variables are recursively substituted with their definitions, and any gate-instance parameter values are reduced. When substitute_nets is true, the remaining input pin variables are additionally substituted with variable names derived from the fan-in nets using BooleanFunctionNetDecorator. substitute_nets requires inlined to be true; passing substitute_nets=true with inlined=false returns an error.
| [in] | name | - The name. Must not be empty. |
| [in] | inlined | - Set true to inline internal and output pins and reduce parameter-conditional expressions. |
| [in] | substitute_nets | - Set true to substitute input pin variables with fan-in net variables. Requires inlined=true and every input pin to have a connected net. |
Definition at line 268 of file gate.cpp.
References ERR, ERR_APPEND, hal::BooleanFunctionNetDecorator::get_boolean_variable(), hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), hal::BooleanFunction::get_parameters(), hal::BasePin< T >::get_type(), hal::BooleanFunction::get_variable_names(), name, OK, and hal::BooleanFunction::substitute().
| Result< std::unordered_map< std::string, BooleanFunction > > hal::Gate::get_boolean_functions | ( | bool | only_custom_functions, |
| bool | inlined, | ||
| bool | substitute_nets | ||
| ) | const |
Get a map from function name to Boolean function for all boolean functions associated with this gate, with full error reporting. When inlined is true, internal and output pin variables are recursively substituted with their definitions and gate-instance parameter values are reduced. When substitute_nets is true, the remaining input pin variables are additionally substituted with variable names derived from the fan-in nets using BooleanFunctionNetDecorator. substitute_nets requires inlined to be true. Aborts and returns an error on the first failure.
| [in] | only_custom_functions | - Set true to get only Boolean functions that are local to the gate, false otherwise. |
| [in] | inlined | - Set true to inline internal and output pins and reduce parameter-conditional expressions. |
| [in] | substitute_nets | - Set true to substitute input pin variables with fan-in net variables. Requires inlined=true and every input pin to have a connected net. |
Definition at line 475 of file gate.cpp.
References ERR_APPEND, hal::BasePin< T >::get_name(), and OK.
| std::unordered_map< std::string, BooleanFunction > hal::Gate::get_boolean_functions | ( | bool | only_custom_functions = false | ) | const |
Get a map from function name to raw Boolean function for all boolean functions associated with this gate. For full control over inlining and net substitution use the Result-returning overload.
| [in] | only_custom_functions | - Set true to get only Boolean functions that are local to the gate, false otherwise. |
Definition at line 451 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 the fan-in endpoint corresponding to the specified input pin.
| [in] | pin | - The input pin. |
nullptr otherwise. Definition at line 930 of file gate.cpp.
References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), log_debug, and log_warning.
Get the fan-in endpoint connected to the specified input net.
| [in] | net | - The input net. |
nullptr otherwise. Definition at line 952 of file gate.cpp.
References log_warning, and net.
| 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.
| [in] | pin_name | - The input pin name. |
nullptr otherwise. Definition at line 914 of file gate.cpp.
References log_warning.
Referenced by hal::gate_init().
| const std::vector< Endpoint * > & hal::Gate::get_fan_in_endpoints | ( | ) | const |
Get a vector of all fan-in endpoints of the gate, i.e., all endpoints associated with an input pin of the gate.
Definition at line 888 of file gate.cpp.
Referenced by hal::cte::ClockTree::from_netlist(), hal::gate_init(), hal::NetlistTraversalDecorator::get_combinational_cone(), hal::NetlistTraversalDecorator::get_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates_until(), hal::NetlistTraversalDecorator::get_next_matching_gates_until_depth(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), hal::netlist_utils::remove_buffers(), hal::netlist_utils::remove_unused_lut_endpoints(), hal::NetlistModificationDecorator::replace_gate(), and hal::xilinx_toolbox::split_lut().
| 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.
| [in] | filter | - Filter function to be evaluated on each endpoint. |
| 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.
| [in] | pin_name | - The input pin name. |
nullptr otherwise. Definition at line 852 of file gate.cpp.
Referenced by hal::NetlistSimulatorController::add_waveform_group(), hal::z3_utils::compare_netlists(), hal::NetlistModificationDecorator::connect_gates(), hal::gate_init(), hal::SimulationInput::NetGroup::get_nets(), hal::netlist_utils::get_nets_at_pins(), hal::GraphicsGate::GraphicsGate(), hal::GatePinsTreeModel::setGate(), hal::xilinx_toolbox::split_shift_register(), and hal::BooleanFunctionDecorator::substitute_power_ground_pins().
| 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.
Definition at line 826 of file gate.cpp.
Referenced by hal::gate_init(), hal::netlist_utils::get_next_sequential_gates(), hal::netlist_utils::get_path(), hal::ModuleModel::moduleAssignNets(), and hal::ShortestPath::net().
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.
| [in] | filter | - Filter function to be evaluated on each net. |
Get the fan-out endpoint corresponding to the specified output pin.
| [in] | pin | - The output pin. |
nullptr otherwise. Definition at line 1069 of file gate.cpp.
References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), log_debug, and log_warning.
Get the fan-out endpoint connected to the specified output net.
| [in] | net | - The output net. |
nullptr otherwise. Definition at line 1091 of file gate.cpp.
References log_warning, and net.
| 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.
| [in] | pin_name | - The output pin name. |
nullptr otherwise. Definition at line 1058 of file gate.cpp.
References log_warning.
Referenced by hal::gate_init().
| 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.
Definition at line 1032 of file gate.cpp.
Referenced by hal::gate_init(), hal::NetlistTraversalDecorator::get_combinational_cone(), hal::NetlistTraversalDecorator::get_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates(), hal::NetlistTraversalDecorator::get_next_matching_gates_until(), hal::NetlistTraversalDecorator::get_next_matching_gates_until_depth(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), hal::netlist_utils::remove_buffers(), and hal::NetlistModificationDecorator::replace_gate().
| 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.
| [in] | filter | - Filter function to be evaluated on each endpoint. |
| 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.
| [in] | pin_name | - The output pin name. |
nullptr otherwise. Definition at line 996 of file gate.cpp.
Referenced by hal::NetlistSimulatorController::add_waveform_group(), hal::NetlistModificationDecorator::connect_gates(), hal::gate_init(), hal::SimulationInput::NetGroup::get_nets(), hal::netlist_utils::get_nets_at_pins(), hal::GraphicsGate::GraphicsGate(), hal::GatePinsTreeModel::setGate(), hal::xilinx_toolbox::split_lut(), and hal::xilinx_toolbox::split_shift_register().
| 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.
Definition at line 970 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(), and hal::ShortestPath::net().
| 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.
| [in] | filter | - Filter function to be evaluated on each net. |
| 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.
Definition at line 241 of file gate.cpp.
Referenced by hal::ModuleContextMenu::addGateSubmenu(), hal::GroupingTableModel::colorForItem(), hal::gate_init(), hal::SelectionDetailsWidget::groupingUnassignActionFactory(), hal::GroupingManagerWidget::removeElementsFromGrouping(), hal::NetlistModificationDecorator::replace_gate(), and hal::GroupingsOfItemModel::setGate().
| ssize_t hal::Gate::get_hash | ( | ) | const |
Hash function for python binding.
Definition at line 127 of file gate.cpp.
Referenced by hal::gate_init().
| u32 hal::Gate::get_id | ( | ) | const |
Get the unique id of the gate.
Definition at line 132 of file gate.cpp.
Referenced by hal::Net::add_destination(), hal::Net::add_source(), hal::z3_utils::compare_netlists(), hal::NetlistModificationDecorator::connect_gates(), hal::Grouping::contains_gate(), hal::resynthesis::decompose_gate(), hal::resynthesis::decompose_gates_of_type(), hal::GuiApi::deselectGate(), hal::hawkeye::CipherCandidate::detect(), hal::cte::export_dot(), hal::gate_init(), hal::GateSelectEntry::GateSelectEntry(), hal::GateSelectModel::GateSelectModel(), hal::graph_algorithm::NetlistGraph::get_all_vertices_from_gate(), hal::NetlistTraversalDecorator::get_combinational_cone(), hal::NetlistTraversalDecorator::get_common_inputs(), hal::NetlistTraversalDecorator::get_complex_gate_chain(), hal::NetlistTraversalDecorator::get_gate_chain(), hal::NetlistTraversalDecorator::get_gates(), hal::netlist_utils::get_nets_at_pins(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), hal::NetlistTraversalDecorator::get_shortest_path(), hal::NetlistTraversalDecorator::get_shortest_path_distance(), hal::SelectionDetailsWidget::groupingUnassignActionFactory(), hal::event_log::handle_gate_event(), hal::event_log::handle_grouping_event(), hal::GraphContextManager::handleGateNameChanged(), hal::GraphContextManager::handleGateRemoved(), hal::GateSelectPicker::handleSelectionChanged(), hal::GraphGraphicsView::handleShortestPathToGrouping(), hal::Net::is_a_destination(), hal::Net::is_a_source(), hal::Netlist::mark_gnd_gate(), hal::Netlist::mark_vcc_gate(), operator==(), hal::netlist_utils::remove_buffers(), hal::netlist_preprocessing::remove_buffers(), hal::Net::remove_destination(), hal::Net::remove_source(), hal::netlist_utils::remove_unused_lut_endpoints(), hal::NetlistModificationDecorator::replace_gate(), hal::resynthesis::resynthesize_gate(), hal::GuiApi::selectGate(), hal::ModuleSelectExclude::selectionToString(), hal::ParameterTableModel::setData(), hal::GatePinTree::setGate(), hal::GatePinsTreeModel::setGate(), hal::DataTableWidget::setGate(), hal::GateDetailsTabWidget::setGate(), hal::GroupingsOfItemModel::setGate(), hal::GroupingsOfItemWidget::setGate(), hal::BooleanFunctionTable::setGateInformation(), hal::GraphNavigationWidget::setup(), hal::solve_fsm::solve_fsm(), hal::xilinx_toolbox::split_lut(), hal::xilinx_toolbox::split_shift_register(), hal::BooleanFunctionDecorator::substitute_power_ground_pins(), hal::Netlist::unmark_gnd_gate(), and hal::Netlist::unmark_vcc_gate().
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.
Definition at line 177 of file gate.cpp.
Referenced by hal::gate_init(), and hal::NetlistModificationDecorator::replace_gate().
| 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.
Definition at line 167 of file gate.cpp.
Referenced by hal::PhysicalGraphLayouter::add(), hal::cte::export_dot(), hal::CoordinateFromData::fromNode(), hal::gate_init(), and operator==().
| 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.
Definition at line 172 of file gate.cpp.
Referenced by hal::PhysicalGraphLayouter::add(), hal::cte::export_dot(), hal::CoordinateFromData::fromNode(), hal::gate_init(), and operator==().
| Module * hal::Gate::get_module | ( | ) | const |
Get the module which contains this gate.
Definition at line 211 of file gate.cpp.
Referenced by hal::ActionAddItemsToObject::exec(), hal::gate_init(), hal::ShortestPath::module(), hal::GraphContext::nodeForGate(), hal::gui_utility::parentModules(), hal::NetlistModificationDecorator::replace_gate(), hal::xilinx_toolbox::split_lut(), hal::xilinx_toolbox::split_shift_register(), and hal::ModuleShader::update().
| 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.
| [in] | filter | - An optional filter. |
| [in] | recursive | - Set true to include indirect parents as well, false otherwise. |
Definition at line 216 of file gate.cpp.
References hal::Module::get_parent_modules().
Referenced by hal::gate_init().
| const std::string & hal::Gate::get_name | ( | ) | const |
Get the name of the gate.
Definition at line 142 of file gate.cpp.
Referenced by hal::Net::add_destination(), hal::Net::add_source(), hal::ModuleContextMenu::addGateSubmenu(), hal::NetlistRelay::changeElementNameDialog(), hal::z3_utils::compare_netlists(), hal::NetlistModificationDecorator::connect_gates(), hal::resynthesis::decompose_gate(), hal::resynthesis::decompose_gates_of_type(), hal::ActionRenameObject::exec(), hal::cte::export_dot(), hal::gate_init(), hal::GateSelectEntry::GateSelectEntry(), hal::graph_algorithm::NetlistGraph::get_all_vertices_from_gate(), hal::NetlistTraversalDecorator::get_combinational_cone(), hal::NetlistTraversalDecorator::get_common_inputs(), hal::NetlistTraversalDecorator::get_complex_gate_chain(), hal::NetlistTraversalDecorator::get_gate_chain(), hal::NetlistTraversalDecorator::get_gates(), hal::LUTComponent::get_init_string(), hal::netlist_utils::get_nets_at_pins(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), hal::NetlistTraversalDecorator::get_shortest_path(), hal::NetlistTraversalDecorator::get_shortest_path_distance(), hal::GraphicsGate::GraphicsGate(), hal::event_log::handle_gate_event(), hal::event_log::handle_grouping_event(), hal::GateSelectPicker::handleSelectionChanged(), hal::GraphGraphicsView::handleShortestPathToGrouping(), hal::Net::is_a_destination(), hal::Net::is_a_source(), hal::Netlist::mark_gnd_gate(), hal::Netlist::mark_vcc_gate(), hal::ModuleItem::ModuleItem(), hal::NetlistSimulatorController::NetlistSimulatorController(), operator==(), hal::netlist_utils::remove_buffers(), hal::netlist_preprocessing::remove_buffers(), hal::Net::remove_destination(), hal::Net::remove_source(), hal::netlist_utils::remove_unused_lut_endpoints(), hal::NetlistModificationDecorator::replace_gate(), hal::resynthesis::resynthesize_gate(), hal::ModuleSelectExclude::selectionToString(), hal::LUTComponent::set_init_string(), hal::solve_fsm::solve_fsm(), hal::xilinx_toolbox::split_lut(), hal::xilinx_toolbox::split_shift_register(), hal::BooleanFunctionDecorator::substitute_power_ground_pins(), hal::Netlist::unmark_gnd_gate(), hal::Netlist::unmark_vcc_gate(), and hal::ModuleModel::updateGateName().
| Netlist * hal::Gate::get_netlist | ( | ) | const |
Get the netlist this gate is associated with.
Definition at line 137 of file gate.cpp.
Referenced by hal::gate_init(), hal::NetlistTraversalDecorator::get_complex_gate_chain(), hal::NetlistTraversalDecorator::get_gate_chain(), hal::NetlistTraversalDecorator::get_shortest_path(), hal::NetlistTraversalDecorator::get_shortest_path_distance(), hal::netlist_utils::replace_gate(), hal::xilinx_toolbox::split_lut(), and hal::xilinx_toolbox::split_shift_register().
Get a single direct predecessor endpoint that is connected to the specified input pin. Fails if there are no or more than one predecessors.
| [in] | pin | - The input pin. |
nullptr otherwise. Definition at line 1147 of file gate.cpp.
References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), and log_warning.
| 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.
| [in] | pin_name | - The input pin name. |
nullptr otherwise. Definition at line 1173 of file gate.cpp.
References log_warning.
Referenced by hal::gate_init().
| 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.
| [in] | filter | - An optional filter being evaluated on the gate's input pin as well as the predecessor endpoint. |
Definition at line 1121 of file gate.cpp.
Referenced by hal::gate_init(), hal::NetlistTraversalDecorator::get_common_inputs(), and hal::NetlistTraversalDecorator::get_complex_gate_chain().
Get a single direct successor endpoint that is connected to the specified output pin. Fails if there are no or more than one successors.
| [in] | pin | - The output pin. |
nullptr otherwise. Definition at line 1227 of file gate.cpp.
References direction, hal::BasePin< T >::get_direction(), hal::BasePin< T >::get_name(), and log_warning.
| 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.
| [in] | pin_name | - The output pin name. |
nullptr otherwise. Definition at line 1253 of file gate.cpp.
References log_warning.
Referenced by hal::gate_init().
| 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.
| [in] | filter | - An optional filter being evaluated on the gate's output pin as well as the successor endpoint. |
Definition at line 1201 of file gate.cpp.
Referenced by hal::gate_init(), hal::NetlistTraversalDecorator::get_complex_gate_chain(), and hal::NetlistTraversalDecorator::get_gate_chain().
| GateType * hal::Gate::get_type | ( | ) | const |
Get the type of the gate.
Definition at line 162 of file gate.cpp.
Referenced by hal::GuiExtensionLogicEvaluator::acceptGate(), hal::Net::add_destination(), hal::Net::add_source(), hal::ModuleContextMenu::addGateSubmenu(), hal::dataflow::Grouping::are_groups_allowed_to_merge(), hal::z3_utils::compare_netlists(), hal::z3_utils::compare_nets(), hal::resynthesis::decompose_gate(), hal::resynthesis::decompose_gates_of_type(), hal::hawkeye::CipherCandidate::detect(), hal::ActionSetParameterValue::exec(), hal::cte::export_dot(), hal::gate_init(), hal::GateSelectEntry::GateSelectEntry(), hal::NetlistTraversalDecorator::get_complex_gate_chain(), hal::boolean_influence::get_ff_dependency_matrix(), hal::NetlistTraversalDecorator::get_gate_chain(), hal::LUTComponent::get_init_string(), hal::SelectionDetailsIconProvider::getIcon(), hal::GatePinsTreeModel::getNumberOfDisplayedPins(), hal::GraphicsGate::GraphicsGate(), hal::event_log::handle_gate_event(), hal::GatePinTree::handleContextMenuRequested(), hal::Net::is_a_destination(), hal::Net::is_a_source(), hal::cte::is_buffer(), hal::cte::is_delay(), hal::cte::is_ff(), hal::cte::is_inverter(), hal::cte::is_latch(), hal::cte::is_mux(), hal::cte::is_oscillator(), hal::cte::is_pll(), hal::ModuleItem::ModuleItem(), hal::SelectionRelay::navigateDown(), hal::SelectionRelay::navigateUp(), operator==(), hal::PyCodeProvider::pyCodeGateAsyncSetResetBehavior(), hal::netlist_utils::remove_buffers(), hal::Net::remove_destination(), hal::Net::remove_source(), hal::NetlistModificationDecorator::replace_gate(), hal::LUTComponent::set_init_string(), hal::GatePinsTreeModel::setGate(), hal::xilinx_toolbox::split_lut(), hal::xilinx_toolbox::split_luts(), hal::xilinx_toolbox::split_shift_register(), and hal::xilinx_toolbox::split_shift_registers().
| 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.
| [in] | filter | - An optional filter being evaluated on the gate's input pin as well as the predecessor endpoint. |
Definition at line 1109 of file gate.cpp.
Referenced by hal::gate_init().
| 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.
| [in] | filter | - An optional filter being evaluated on the gate's output pin as well as the successor endpoint. |
Definition at line 1189 of file gate.cpp.
Referenced by hal::gate_init().
| bool hal::Gate::has_boolean_function | ( | const GatePin * | pin | ) | const |
Check whether the gate has a Boolean function for the given output pin, i.e., whether get_boolean_function finds one. If pin is a nullptr, the first output pin is checked. Every LUT output pin has a Boolean function, even if the LUT is not configured.
| [in] | pin | - The pin. |
true if the gate has a Boolean function for the pin, false otherwise. Definition at line 440 of file gate.cpp.
References hal::BasePin< T >::get_name().
| bool hal::Gate::has_boolean_function | ( | const std::string & | name | ) | const |
Check whether the gate has a Boolean function with the given name, i.e., whether get_boolean_function finds one. This name can for example be an output pin of the gate or any other user-defined function name. Every LUT output pin has a Boolean function, even if the LUT is not configured.
| [in] | name | - The name. |
true if the gate has a Boolean function with that name, false otherwise. Definition at line 409 of file gate.cpp.
References hal::BasePin< T >::get_type(), and name.
Referenced by hal::gate_init().
| bool hal::Gate::has_location | ( | ) | const |
Check whether the gate's location in the layout is available.
true if valid location data is available, false otherwise. Definition at line 182 of file gate.cpp.
Referenced by hal::PhysicalGraphLayouter::add(), hal::cte::export_dot(), hal::CoordinateFromData::fromNode(), and hal::gate_init().
| bool hal::Gate::is_fan_in_net | ( | const Net * | net | ) | const |
Check whether the given net is a fan-in of the gate.
| [in] | net | - The net. |
true if the net is a fan-in of the gate, false otherwise. Definition at line 872 of file gate.cpp.
References log_warning, and net.
Referenced by hal::gate_init().
| bool hal::Gate::is_fan_out_net | ( | const Net * | net | ) | const |
Check whether the given net is a fan-out of the gate.
| [in] | net | - The net. |
true if the net is a fan-out of the gate, false otherwise. Definition at line 1016 of file gate.cpp.
References log_warning, and net.
Referenced by hal::gate_init().
| bool hal::Gate::is_gnd_gate | ( | ) | const |
Checks whether this gate is a global gnd gate.
true if the gate is a global gnd gate, false otherwise. Definition at line 821 of file gate.cpp.
Referenced by hal::gate_init(), and operator==().
| bool hal::Gate::is_vcc_gate | ( | ) | const |
Checks whether this gate is a global vcc gate.
true if the gate is a global vcc gate, false otherwise. Definition at line 816 of file gate.cpp.
Referenced by hal::gate_init(), and operator==().
| bool hal::Gate::mark_gnd_gate | ( | ) |
Mark this gate as a global gnd gate.
true on success, false otherwise. Definition at line 801 of file gate.cpp.
Referenced by hal::gate_init().
| bool hal::Gate::mark_vcc_gate | ( | ) |
Mark this gate as a global vcc gate.
true on success, false otherwise. Definition at line 796 of file gate.cpp.
Referenced by hal::gate_init().
| bool hal::Gate::operator!= | ( | const Gate & | other | ) | const |
| bool hal::Gate::operator== | ( | const Gate & | other | ) | const |
Check whether two gates are equal. Does not check for connected nets or containing module.
| [in] | other | - The gate to compare against. |
true if both gates are equal, false otherwise. Definition at line 87 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 the physical location of the gate in the layout.
Only positive coordinates are valid, negative values will be regarded as no location assigned.
| [in] | location | - A pair <x-coordinate, y-coordinate>. |
Definition at line 205 of file gate.cpp.
Referenced by hal::gate_init().
| 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.
| [in] | x | - The gate's x-coordinate. |
Definition at line 187 of file gate.cpp.
References x.
Referenced by hal::gate_init().
| 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.
| [in] | y | - The gate's y-coordinate. |
Definition at line 196 of file gate.cpp.
References y.
Referenced by hal::gate_init().
| void hal::Gate::set_name | ( | const std::string & | name | ) |
Set the name of the gate.
| [in] | name | - The new name. |
Definition at line 147 of file gate.cpp.
References log_error, name, and hal::utils::trim().
Referenced by hal::ActionRenameObject::exec(), and hal::gate_init().
| bool hal::Gate::unmark_gnd_gate | ( | ) |
Unmark this gate as a global gnd gate.
true on success, false otherwise. Definition at line 811 of file gate.cpp.
Referenced by hal::gate_init().
| bool hal::Gate::unmark_vcc_gate | ( | ) |
Unmark this gate as a global vcc gate.
true on success, false otherwise. Definition at line 806 of file gate.cpp.
Referenced by hal::gate_init().
|
friend |