### QWidget Setup and Initialization Source: https://emsec.github.io/hal/doc/classhal_1_1_r_a_m_wizard_page-members This section includes methods for setting up and initializing widgets, such as the setupUi method which is often used in conjunction with UI design tools. ```APIDOC QWidget::setupUi(QWidget *widget) Sets up the user interface for a given widget. This is typically generated by UI design tools. ``` -------------------------------- ### QThread Start Example Source: https://emsec.github.io/hal/doc/classhal_1_1_junction_thread-members Demonstrates how to create and start a QThread in C++. ```C++ #include #include class WorkerThread : public QThread { Q_OBJECT protected: void run() override { qDebug() << "Worker thread started."; // Thread execution logic here qDebug() << "Worker thread finished."; } }; int main(int argc, char *argv[]) { WorkerThread worker; worker.start(); worker.wait(); // Wait for the thread to finish return 0; } ``` -------------------------------- ### Get Next Combinational Gates Source: https://emsec.github.io/hal/doc/python__bindings_2bindings_2netlist__traversal__decorator_8cpp_source Retrieves successor or predecessor combinational gates starting from a given gate. Traversal continues as long as combinational gates are found, stopping at non-combinational ones. Forbidden pins can be specified to control traversal, for example, to avoid logic before flip-flop control inputs. Returns a set of gates or None if an error occurs. ```Python def get_next_combinational_gates(gate: hal_py.Gate, successors: bool, forbidden_pins: set[hal_py.PinType]) -> Optional[set[hal_py.Gate]]: """ Starting from the given gate, traverse the netlist and return all combinational successor/predecessor gates. Continue traversal as long as further combinational gates are found and stop at gates that are not combinational. All combinational gates found during traversal are added to the result. Forbidden pins can be provided to, e.g., avoid the inclusion of logic in front of flip-flop control inputs. :param hal_py.Gate gate: Start gate. :param bool successors: Set True to get successors, set False to get predecessors. :param set[hal_py.PinType] forbidden_pins: Netlist traversal stops at these pins. :returns: The next combinational gates on success, None otherwise. :rtype: set[hal_py.Gate] or None """ pass ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_python_qss_adapter Provides the setupUi method for initializing the user interface of a QWidget. ```APIDOC QWidget::setupUi Sets up the user interface for the given widget. Parameters: widget: A pointer to the QWidget to set up. ``` -------------------------------- ### QWidget Size Hint Example Source: https://emsec.github.io/hal/doc/classhal_1_1_main_settings_widget Demonstrates how to get the size hint for a QWidget. ```cpp QSize hint = widget->sizeHint(); // Use the hint to set the widget's size or for layout calculations. ``` -------------------------------- ### QWidget::setupUi Method Source: https://emsec.github.io/hal/doc/classhal_1_1_toolbar-members Describes the `setupUi` method used for setting up a widget's user interface. ```APIDOC QWidget::setupUi(QWidget *widget) This method is typically generated by Qt Designer and is used to set up the user interface elements of a given widget. It should not be called directly unless you are manually managing UI setup. ``` -------------------------------- ### QWidget Size Hint Example Source: https://emsec.github.io/hal/doc/classhal_1_1_logger_qss_adapter Demonstrates how to get the size hint for a QWidget. ```cpp QSize hint = widget->sizeHint(); // Use the hint to set the widget's size or for layout calculations. ``` -------------------------------- ### QWidget Setup UI Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_spinbox The setupUi method is used to set up the user interface for a given QWidget. ```APIDOC void QWidget::setupUi(QWidget* widget) Sets up the user interface for the given widget. ``` -------------------------------- ### QWidget Size Hint Example Source: https://emsec.github.io/hal/doc/classhal_1_1_general_info_wizard_page Demonstrates how to get the size hint for a QWidget. ```cpp QSize hint = widget->sizeHint(); // Use the hint to set the widget's size or for layout calculations. ``` -------------------------------- ### InitWizardPage Methods Source: https://emsec.github.io/hal/doc/init__wizardpage_8h_source Provides an overview of the key methods within the InitWizardPage class, including its constructor, page initialization, completion check, and data setting. ```cpp InitWizardPage(QWidget* parent = nullptr); void initializePage() override; bool isComplete() const override; void setData(GateType* gate); ``` -------------------------------- ### QWidget Initialization Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_dropdown-members This entry documents the `setupUi` method, which is commonly used in Qt applications to set up the user interface for a widget. ```APIDOC QWidget::setupUi(QWidget *widget) Sets up the user interface for the given widget. Parameters: widget: A pointer to the QWidget to set up. ``` -------------------------------- ### QWidget Size Hint Example Source: https://emsec.github.io/hal/doc/classhal_1_1_gate_library_tab_truth_table Demonstrates how to get the size hint for a QWidget. ```cpp QSize hint = widget->sizeHint(); // Use the hint to set the widget's size or for layout calculations. ``` -------------------------------- ### QWidget Size Hint Example Source: https://emsec.github.io/hal/doc/classhal_1_1_gate_library_tab_general Demonstrates how to get the size hint for a QWidget. ```cpp QSize hint = widget->sizeHint(); // Use the hint to set the widget's size or for layout calculations. ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_module_dialog Provides the setupUi method for initializing the user interface of a QWidget. ```APIDOC QWidget::setupUi Sets up the user interface for the given widget. Parameters: widget: A pointer to the QWidget to set up. ``` -------------------------------- ### QWidget Size Hint Example Source: https://emsec.github.io/hal/doc/classhal_1_1_details_frame_widget Demonstrates how to get the size hint for a QWidget. ```cpp QSize hint = widget->sizeHint(); // Use the hint to set the widget's size or for layout calculations. ``` -------------------------------- ### QWidget Setup UI Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_dropdown The setupUi method is used to set up the user interface for a given QWidget. ```APIDOC void QWidget::setupUi(QWidget* widget) Sets up the user interface for the given widget. ``` -------------------------------- ### QWidget Setup Method Source: https://emsec.github.io/hal/doc/classhal_1_1_gatelibrary_component_frame-members This entry describes the `setupUi` method for QWidget, which is used to set up the user interface of a widget. ```APIDOC QWidget Method: setupUi(QWidget *widget) Sets up the user interface for the given widget. This is typically generated by a UI designer tool. ``` -------------------------------- ### QWidget Size Hint Example Source: https://emsec.github.io/hal/doc/classhal_1_1_content_frame Demonstrates how to get the size hint for a QWidget. ```cpp QSize hint = widget->sizeHint(); // Use the hint to set the widget's size or for layout calculations. ``` -------------------------------- ### Get Gate Chain Source: https://emsec.github.io/hal/doc/netlist_2netlist__utils_8cpp_source Retrieves a chain of gates starting from a given gate, following successors that match a specific type and optionally satisfy a filter. It handles null start gates, filters, loops, and multiple successors by logging debug messages. The function traverses the netlist forwards and backwards from the start gate. ```cpp hal::result> get_gate_chain(hal::Gate* start_gate, const std::vector& input_pins, const std::vector& output_pins, const std::function& filter) { if (start_gate == nullptr) { return hal::ERR("could not detect gate chain at start gate: start gate is a 'nullptr'"); } // check filter on start gate if (filter && !filter(start_gate)) { return hal::ERR("could not detect gate chain at start gate '" + start_gate->get_name() + "' with ID " + std::to_string(start_gate->get_id()) + ": filter evaluates to 'false' for start gate"); } std::deque gate_chain = {start_gate}; std::unordered_set visited_gates = {start_gate}; const hal::GateType* target_type = start_gate->get_type(); bool found_next_gate; // move forward const hal::Gate* current_gate = start_gate; do { found_next_gate = false; // check all eligible successors of current gate std::vector successors = current_gate->get_successors([input_pins, output_pins, target_type, filter](const hal::GatePin* ep_pin, hal::Endpoint* ep) { if (ep->get_gate()->get_type() == target_type) { if (output_pins.empty() || std::find(output_pins.begin(), output_pins.end(), ep_pin) != output_pins.end()) { if (input_pins.empty() || std::find(input_pins.begin(), input_pins.end(), ep->get_pin()) != input_pins.end()) { if (!filter || filter(ep->get_gate())) { return true; } } } } return false; }); if (successors.size() > 1) { hal::log_debug("netlist_utils", "detected more than one valid successor gate for gate '{}' with ID {} in netlist with ID {}.", current_gate->get_name(), current_gate->get_id(), current_gate->get_netlist()->get_id()); break; } else if (!successors.empty()) { hal::Gate* suc_gate = successors.at(0)->get_gate(); if (visited_gates.find(suc_gate) != visited_gates.end()) { hal::log_debug("netlist_utils", "detected a loop at gate with ID {}.", suc_gate->get_id()); break; } gate_chain.push_back(suc_gate); visited_gates.insert(suc_gate); current_gate = suc_gate; found_next_gate = true; } } while (found_next_gate); // move backwards current_gate = start_gate; do { found_next_gate = false; // check all eligable predecessors of current gate std::vector predecessors = current_gate->get_predecessors([input_pins, output_pins, target_type, filter](const hal::GatePin* ep_pin, hal::Endpoint* ep) { if (ep->get_gate()->get_type() == target_type) { if (output_pins.empty() || std::find(output_pins.begin(), output_pins.end(), ep_pin) != output_pins.end()) { if (input_pins.empty() || std::find(input_pins.begin(), input_pins.end(), ep->get_pin()) != input_pins.end()) { if (!filter || filter(ep->get_gate())) { return true; } } } } return false; }); // ... (rest of the backward traversal logic would follow here) } while (found_next_gate); // Convert deque to vector for return std::vector result_chain(gate_chain.begin(), gate_chain.end()); return result_chain; } ``` -------------------------------- ### HAL Graph Navigation Widget Setup Source: https://emsec.github.io/hal/doc/namespacehal Describes the `setup` method for the `GraphNavigationWidget`, which is used to initialize and configure the widget for navigating the graph. ```APIDOC GraphNavigationWidget: setup() Initializes and sets up the graph navigation widget. ``` -------------------------------- ### HAL Get Functions - PinGroup Source: https://emsec.github.io/hal/doc/functions_func_g Retrieves information related to PinGroups, including start index and type. ```APIDOC get_start_index() : hal::PinGroup< T > Returns the start index of the pin group. get_type() : hal::PinGroup< T > Returns the type of the pin group. ``` -------------------------------- ### QWidget Setup UI Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_text The setupUi method is used to set up the user interface for a given QWidget. ```APIDOC void QWidget::setupUi(QWidget* widget) Sets up the user interface for the given widget. ``` -------------------------------- ### QWidget Layout and Setup Source: https://emsec.github.io/hal/doc/classhal_1_1_new_project_dialog Methods related to widget layout and setup. setupUi is typically used to initialize the UI of a widget, and sizeIncrement manages the size increment for resizing. ```APIDOC setupUi(widget: QWidget *widget) Sets up the user interface for the given widget. sizeIncrement() const -> QSize Returns the size increment of the widget. setSizeIncrement(size: const QSize &) Sets the size increment of the widget. setSizeIncrement(w: int, h: int) Sets the width and height of the size increment. ``` -------------------------------- ### Getting Module Item Column Count (C++) Source: https://emsec.github.io/hal/doc/module__item_8cpp_source Example of a function that returns the column count for a ModuleItem in C++. ```cpp int ModuleItem::getColumnCount() const { return 3; } ``` -------------------------------- ### QWidget Layout and Setup Source: https://emsec.github.io/hal/doc/classhal_1_1_gui_plugin_view Methods related to widget layout and setup. setupUi is typically used to initialize the UI of a widget, and sizeIncrement manages the size increment for resizing. ```APIDOC setupUi(widget: QWidget *widget) Sets up the user interface for the given widget. sizeIncrement() const -> QSize Returns the size increment of the widget. setSizeIncrement(size: const QSize &) Sets the size increment of the widget. setSizeIncrement(w: int, h: int) Sets the width and height of the size increment. ``` -------------------------------- ### HAL Get Functions - PinGroup Source: https://emsec.github.io/hal/doc/functions_g Retrieves the start index of a PinGroup. This function is associated with the hal::PinGroup class. ```APIDOC get_start_index() - Returns the start index of the PinGroup. - Associated Class: hal::PinGroup< T > ``` -------------------------------- ### QWidget setupUi Method Source: https://emsec.github.io/hal/doc/classhal_1_1_project_dir_dialog-members This entry documents the `setupUi` method for QWidget, which is used to set up the user interface for a given widget. ```APIDOC QWidget::setupUi(QWidget *widget) Sets up the user interface for the given widget. ``` -------------------------------- ### Get Neighborhood by Vertices Source: https://emsec.github.io/hal/doc/neighborhood_8cpp_source Computes the neighborhood of a graph starting from a given set of vertices. It validates the graph and start vertices, initializes an igraph vector, and populates it with the provided vertex IDs. Returns a Result containing a vector of vectors of unsigned integers representing the neighborhood. ```cpp #include "graph_algorithm/algorithms/neighborhood.h" namespace hal { namespace graph_algorithm { Result>> get_neighborhood(NetlistGraph* graph, const std::vector& start_vertices, u32 order, NetlistGraph::Direction direction, u32 min_dist) { if (!graph) { return ERR("graph is a nullptr"); } if (start_vertices.empty()) { return ERR("no start vertices provided"); } igraph_vector_int_t i_gates; if (auto res = igraph_vector_int_init(&i_gates, start_vertices.size()); res != IGRAPH_SUCCESS) { return ERR(igraph_strerror(res)); } for (u32 i = 0; i < start_vertices.size(); i++) { // ... (code to populate i_gates) } // ... (rest of the function logic using get_neighborhood_igraph) return Result>>(); // Placeholder } } // namespace graph_algorithm } // namespace hal ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_gate_library_frame_r_a_m_port Method for setting up the user interface of a QWidget. ```APIDOC setupUi(QWidget *widget) Sets up the user interface for the given widget. This is typically used in conjunction with UI design tools. Parameters: QWidget *widget: The widget whose UI needs to be set up. ``` -------------------------------- ### Get Shortest Path Source: https://emsec.github.io/hal/doc/netlist__utils_8h_source Finds the shortest path between a starting gate and an ending module in the netlist. Supports forward direction traversal. ```cpp std::vector get_shortest_path(Gate* start_gate, Module* end_module, bool forward_direction); ``` -------------------------------- ### Get Root Tree Item Source: https://emsec.github.io/hal/doc/functions_g Retrieves the root item of a tree model. This is the starting point for traversing hierarchical data structures. ```APIDOC getRootItem() - Returns: hal::BaseTreeModel ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_import_netlist_dialog Provides a method to set up the user interface for a given QWidget. ```APIDOC QWidget::setupUi(QWidget *widget) - Sets up the user interface for the given widget. This is typically used in conjunction with UI design tools. ``` -------------------------------- ### Get Root Tree Item Source: https://emsec.github.io/hal/doc/functions_func_g Retrieves the root item of a tree model. This is the starting point for traversing hierarchical data structures. ```APIDOC getRootItem() - Returns: hal::BaseTreeModel ``` -------------------------------- ### QWidget Setup UI Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_slider The setupUi method is used to set up the user interface for a given QWidget. ```APIDOC void QWidget::setupUi(QWidget* widget) Sets up the user interface for the given widget. ``` -------------------------------- ### Get Gate Chain Source: https://emsec.github.io/hal/doc/netlist__utils_8h_source Retrieves a chain of gates starting from a given gate, optionally filtering by input/output pins and a custom gate filter. ```cpp Result> get_gate_chain(Gate* start_gate, const std::vector& input_pins = {}, const std::vector& output_pins = {}, const std::function& filter = nullptr); ``` -------------------------------- ### QWidget setupUi Source: https://emsec.github.io/hal/doc/classhal_1_1_python_code_editor-members Method to set up the UI for a QWidget. ```APIDOC QWidget::setupUi(QWidget *widget) - Sets up the UI for the given widget. ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_gatelibrary_frame_general Method for setting up the user interface of a QWidget. ```APIDOC setupUi(QWidget *widget) Sets up the user interface for the given widget. This is typically used in conjunction with UI design tools. Parameters: QWidget *widget: The widget whose UI needs to be set up. ``` -------------------------------- ### Get Path Source: https://emsec.github.io/hal/doc/netlist__utils_8h_source Retrieves a path of gates starting from a given gate, stopping at gates with specified properties. This function utilizes a cache for performance. ```cpp [CORE_API] std::vector get_path(const Gate* gate, bool get_successors, std::set stop_properties, std::unordered_map>& cache); ``` -------------------------------- ### Get Gate Path Source: https://emsec.github.io/hal/doc/netlist__utils_8h Retrieves a path of gates starting from a given net. It can optionally follow successors and stop at gates with specific properties. ```C++ std::vector< Gate * > | [hal::netlist_utils::get_path](https://emsec.github.io/hal/doc/namespacehal_1_1netlist__utils.html#a1d92e0a85d024f090e2070c009633ec9) (const Net *[net](https://emsec.github.io/hal/doc/netlist_2persistent_2netlist__serializer_8cpp.html#a504c73ff1a68c50e5435dece66bc2772), bool get_successors, std::set< GateTypeProperty > stop_properties) ``` -------------------------------- ### QWidget Initialization Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_checkbox-members This entry documents the `setupUi` method, which is commonly used in Qt applications to set up the user interface for a widget. ```APIDOC QWidget::setupUi(QWidget *widget) Sets up the user interface for the given widget. Parameters: widget: A pointer to the QWidget to set up. ``` -------------------------------- ### Get Gate Chain Source: https://emsec.github.io/hal/doc/netlist__utils_8h Extracts a chain of gates starting from a specified gate, based on input and output pins and an optional filtering function. ```C++ Result< std::vector< Gate * > > | [hal::netlist_utils::get_gate_chain](https://emsec.github.io/hal/doc/namespacehal_1_1netlist__utils.html#a28db21d0d146410d3400019856258847) (Gate *start_gate, const std::vector< const GatePin * > &input_pins, const std::vector< const GatePin * > &output_pins, const std::function< bool(const Gate *)> &filter) ``` -------------------------------- ### QWidget Setup and Window Access Source: https://emsec.github.io/hal/doc/classhal_1_1_comment_widget Includes methods for setting up the UI of a widget and accessing its top-level window. ```APIDOC QWidget: setupUi(QWidget *widget) Sets up the user interface for the given widget. window() -> QWidget * Returns a pointer to the widget's top-level window. ``` -------------------------------- ### QWidget Initialization and Configuration Source: https://emsec.github.io/hal/doc/main__settings__widget_8cpp_source Documentation for QWidget constructor and methods for setting layout, size policy, and window properties. ```APIDOC QWidget(QWidget *parent, Qt::WindowFlags f) - Constructor for QWidget. - Parameters: - parent: Pointer to the parent widget. - f: Window flags that determine the widget's appearance and behavior. bool close() - Closes the widget. Returns true if the widget was successfully closed, false otherwise. void setMaximumHeight(int maxh) - Sets the maximum height of the widget. - Parameters: - maxh: The maximum height in pixels. void setLayout(QLayout *layout) - Sets the layout for the widget. - Parameters: - layout: A pointer to the QLayout to manage the widget's children. void setSizePolicy(QSizePolicy) - Sets the size policy of the widget, which determines how it grows and shrinks. - Parameters: - QSizePolicy: The size policy to apply. void setToolTip(const QString &) - Sets the tool tip text that appears when the mouse cursor hovers over the widget. - Parameters: - The tool tip text. void setWindowModality(Qt::WindowModality windowModality) - Sets the window modality for the widget. - Parameters: - windowModality: The modality (e.g., Qt::ApplicationModal, Qt::WindowModal). ``` -------------------------------- ### Get Neighborhood by Gates Source: https://emsec.github.io/hal/doc/neighborhood_8cpp_source Computes the neighborhood of a graph starting from a given set of gates. It handles null graph pointers and empty start gate lists, converting gates to igraph vertices for processing. Returns a Result containing a vector of vectors of unsigned integers representing the neighborhood. ```cpp #include "graph_algorithm/algorithms/neighborhood.h" namespace hal { namespace graph_algorithm { Result>> get_neighborhood(NetlistGraph* graph, const std::vector& start_gates, u32 order, NetlistGraph::Direction direction, u32 min_dist) { if (!graph) { return ERR("graph is a nullptr"); } if (start_gates.empty()) { return ERR("no start gates provided"); } igraph_vector_int_t i_gates; if (auto res = graph->get_vertices_from_gates_igraph(start_gates); res.is_ok()) { i_gates = std::move(res.get()); } else { return ERR(res.get_error()); } auto res = get_neighborhood_igraph(graph, &i_gates, order, direction, min_dist); igraph_vector_int_destroy(&i_gates); if (res.is_error()) { return ERR(res.get_error()); } return res; } } // namespace graph_algorithm } // namespace hal ``` -------------------------------- ### QElapsedTimer Methods Source: https://emsec.github.io/hal/doc/python__thread_8cpp_source Provides methods for timing operations using QElapsedTimer. Includes functions to get the elapsed time, restart the timer, and start the timer. ```APIDOC QElapsedTimer::elapsed qint64 elapsed() const const QElapsedTimer::restart qint64 restart() QElapsedTimer::start void start() ``` -------------------------------- ### QWidget Setup UI Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_checkbox The setupUi method is used to set up the user interface for a given QWidget. ```APIDOC void QWidget::setupUi(QWidget* widget) Sets up the user interface for the given widget. ``` -------------------------------- ### Get Path from Net Source: https://emsec.github.io/hal/doc/netlist_2netlist__utils_8cpp_source A public interface to find connected gates starting from a given net. It initializes a cache and calls the internal `get_path_internal` function. ```C++ std::vector get_path(const Net* net, bool get_successors, std::set stop_properties, std::unordered_map>& cache) { std::unordered_set seen; return get_path_internal(net, get_successors, stop_properties, seen, cache); } ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_selection_details_widget Method for setting up the user interface of a QWidget. ```APIDOC setupUi(QWidget *widget) Sets up the user interface for the given widget. This is typically used in conjunction with UI design tools. Parameters: QWidget *widget: The widget whose UI needs to be set up. ``` -------------------------------- ### QWidget Layout and Setup Source: https://emsec.github.io/hal/doc/classhal_1_1_module_widget Methods related to widget layout and setup. setupUi is typically used to initialize the UI of a widget, and sizeIncrement manages the size increment for resizing. ```APIDOC setupUi(widget: QWidget *widget) Sets up the user interface for the given widget. sizeIncrement() const -> QSize Returns the size increment of the widget. setSizeIncrement(size: const QSize &) Sets the size increment of the widget. setSizeIncrement(w: int, h: int) Sets the width and height of the size increment. ``` -------------------------------- ### Get Shortest Path to Module Source: https://emsec.github.io/hal/doc/netlist_2netlist__utils_8cpp_source Finds the shortest path from a starting gate to any gate within a specified module. It supports searching in a forward direction. ```C++ std::vector get_shortest_path(Gate* start_gate, Module* end_module, bool forward_direction) { std::unordered_set end_gates; for (Gate* g : end_module->get_gates(nullptr, true)) { end_gates.insert(g); } ShortestPathInternal spi(start_gate, end_gates, forward_direction); return spi.get_path(); } ``` -------------------------------- ### QSet Methods Source: https://emsec.github.io/hal/doc/module__widget_8cpp_source Documentation for QSet methods, including begin, insert, and size. ```APIDOC QSet::iterator QSet::begin() Returns an iterator to the beginning of the set. ``` ```APIDOC QSet::iterator QSet::insert(const T &value) Inserts a value into the set. Parameters: value: The value to insert. ``` ```APIDOC int QSet::size() const Returns the number of elements in the set. ``` -------------------------------- ### Get Path from Gate Source: https://emsec.github.io/hal/doc/netlist_2netlist__utils_8cpp Retrieves a path of gates starting from a given gate. This function can optionally follow successors and stop at gates with specific properties. ```cpp std::vector< Gate * > hal::netlist_utils::get_path(const Gate *gate, bool get_successors, std::set< GateTypeProperty > stop_properties) ``` -------------------------------- ### QWidget Setup Methods Source: https://emsec.github.io/hal/doc/classhal_1_1_graph_navigation_table_widget-members Methods related to the setup of QWidget and QAbstractScrollArea. ```APIDOC setupUi(QWidget *widget) - Sets up the UI for a given widget. setupViewport(QWidget *viewport) - Sets up the viewport for a scrollable area. ``` -------------------------------- ### Get Path from Net Source: https://emsec.github.io/hal/doc/netlist_2netlist__utils_8cpp Retrieves a path of gates starting from a given net. This function can optionally follow successors and stop at gates with specific properties. ```cpp std::vector< Gate * > hal::netlist_utils::get_path(const Net *net, bool get_successors, std::set< GateTypeProperty > stop_properties) ``` -------------------------------- ### HAL Wizard Pages Source: https://emsec.github.io/hal/doc/namespaces Documentation for various wizard pages used in the HAL project. These pages likely guide users through configuration or setup processes. ```APIDOC GeneralInfoWizardPage: Description: Wizard page for general information. InitWizardPage: Description: Wizard page for initialization. LatchWizardPage: Description: Wizard page for latch configuration. LUTWizardPage: Description: Wizard page for Look-Up Table (LUT) configuration. PinsWizardPage: Description: Wizard page for pin configuration. RAMPortWizardPage: Description: Wizard page for RAM port configuration. RAMWizardPage: Description: Wizard page for RAM configuration. StateWizardPage: Description: Wizard page for state management. ``` -------------------------------- ### Qt Widgets: Tab Order and Setup Source: https://emsec.github.io/hal/doc/classhal_1_1_main_settings_widget-members Covers static methods for managing tab order and setting up UI elements. ```APIDOC QWidget::setTabOrder(QWidget *first, QWidget *second) - Establishes tab order between two widgets. - Parameters: - first: The widget that precedes the second in the tab order. - second: The widget that follows the first in the tab order. QWidget::setupUi(QWidget *widget) - Sets up the UI for the given widget. This is typically generated by a UI designer. - Parameters: - widget: Pointer to the QWidget to set up. ``` -------------------------------- ### Get Complex Gate Chain Source: https://emsec.github.io/hal/doc/netlist_2netlist__utils_8cpp_source Identifies and returns a chain of gates starting from a given gate, following a sequence of gate types. The function allows specifying input and output pins for each gate type in the chain and an optional filter function to further refine the selection. It handles cases like null start gates, insufficient chain types, incorrect start gate types, filter failures, loops, and multiple predecessors. ```C++ Result> get_complex_gate_chain(Gate* start_gate, const std::vector& chain_types, const std::map>& input_pins, const std::map>& output_pins, const std::function& filter) { if (start_gate == nullptr) { return ERR("could not detect gate chain at start gate: start gate is a 'nullptr'"); } if (chain_types.size() < 2) { return ERR("could not detect gate chain at start gate: 'chain_types' comprises less than two target gate types"); } if (start_gate->get_type() != chain_types.at(0)) { return ERR("could not detect gate chain at start gate '" + start_gate->get_name() + "' with ID " + std::to_string(start_gate->get_id()) + ": start gate is not of type '" + chain_types.front()->get_name() + "'"); } if (filter && !filter(start_gate)) { return ERR("could not detect gate chain at start gate '" + start_gate->get_name() + "' with ID " + std::to_string(start_gate->get_id()) + ": filter evaluates to 'false' for start gate"); } std::deque gate_chain = {start_gate}; std::unordered_set visited_gates; u32 last_index = 0; bool found_next_gate = true; do { Gate* current_gate = gate_chain.back(); std::vector predecessors = current_gate->get_predecessors(); if (predecessors.size() > 1) { log_debug("netlist_utils", "detected more than one valid predecessor gate for gate '{}' with ID {} in netlist with ID {}.", current_gate->get_name(), current_gate->get_id(), current_gate->get_netlist()->get_id()); break; } else if (!predecessors.empty()) { Gate* pred_gate = predecessors.at(0)->get_gate(); if (visited_gates.find(pred_gate) != visited_gates.end()) { log_debug("netlist_utils", "detected a loop at gate with ID {}.", pred_gate->get_id()); break; } gate_chain.push_front(pred_gate); visited_gates.insert(pred_gate); current_gate = pred_gate; found_next_gate = true; log_debug("netlist_utils", "found predecessor gate with ID {}.", pred_gate->get_id()); } } while (found_next_gate); return OK(std::vector(gate_chain.begin(), gate_chain.end())); } ``` -------------------------------- ### QWidget Setup and Coordinate Mapping Source: https://emsec.github.io/hal/doc/classhal_1_1_plugin_parameter_dialog Contains API documentation for the `setupUi` method, used for setting up the user interface of a widget, and `mapToGlobal`, which converts a widget's local coordinates to global screen coordinates. ```APIDOC QWidget: setupUi(QWidget *widget) Sets up the user interface for the given widget. mapToGlobal(const QPoint &pos) -> QPoint Converts a point from the widget's local coordinate system to the global coordinate system. ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_python_editor Method for setting up the user interface of a QWidget. ```APIDOC setupUi(QWidget *widget) Sets up the user interface for the given widget. This is typically used in conjunction with UI design tools. Parameters: QWidget *widget: The widget whose UI needs to be set up. ``` -------------------------------- ### Get Path from Gate Source: https://emsec.github.io/hal/doc/netlist__utils_8h_source Retrieves a path of gates starting from a given gate. It can search for successors and stop at gates with specific properties. Overloaded for Net input. ```cpp std::vector get_path(const Gate* gate, bool get_successors, std::set stop_properties); std::vector get_path(const Net* net, bool get_successors, std::set stop_properties); std::vector get_path(const Net* net, bool get_successors, std::set stop_properties, std::unordered_map>& cache); ``` -------------------------------- ### GraphContext API Source: https://emsec.github.io/hal/doc/action__add__items__to__object_8cpp_source Provides methods for managing graph context, including starting and ending changes, adding elements, retrieving the layouter, and getting the context ID. ```APIDOC hal::GraphContext: Logical container for modules, gates, and nets. beginChange(): void Starts a change transaction for the graph context. Definition: graph_context.cpp:75 add(const QSet< u32 > &modules, const QSet< u32 > &gates, PlacementHint placement=PlacementHint()): void Adds modules and gates to the graph context with optional placement hints. Definition: graph_context.cpp:90 getLayouter() const: GraphLayouter * Returns a pointer to the graph layouter associated with this context. Definition: graph_context.h:322 endChange(): void Ends a change transaction for the graph context. Definition: graph_context.cpp:80 id() const: u32 Returns the unique identifier of the graph context. Definition: graph_context.cpp:452 ``` -------------------------------- ### QWidget Setup and Size Increment Source: https://emsec.github.io/hal/doc/classhal_1_1_expanding_list_widget Includes methods for setting up a widget and managing its size increment. ```APIDOC void setupUi(QWidget *widget) - Sets up the UI for the given widget. QSize sizeIncrement() const - Returns the size increment of the widget. void setSizeIncrement(const QSize &) - Sets the size increment of the widget. ``` -------------------------------- ### QWidget Layout and Setup Source: https://emsec.github.io/hal/doc/classhal_1_1_get_in_touch_item Methods related to widget layout and setup. setupUi is typically used to initialize the UI of a widget, and sizeIncrement manages the size increment for resizing. ```APIDOC setupUi(widget: QWidget *widget) Sets up the user interface for the given widget. sizeIncrement() const -> QSize Returns the size increment of the widget. setSizeIncrement(size: const QSize &) Sets the size increment of the widget. setSizeIncrement(w: int, h: int) Sets the width and height of the size increment. ``` -------------------------------- ### Get Shortest Path Source: https://emsec.github.io/hal/doc/python__bindings_2bindings_2netlist__utils_8cpp_source Finds the shortest path between a start gate and any gate within a specified module. The function returns a list of gates forming the path, ordered from start to end. If multiple paths of the same shortest length exist, only the first one found is returned. An empty list is returned if no path is found. ```python py_netlist_utils.def("get_shortest_path", py::overload_cast(&[netlist_utils::get_shortest_path](https://emsec.github.io/hal/doc/namespacehal_1_1netlist__utils.html#ad4d03ec3fea021d21e9247e70d03aecc)), py::arg("start_gate"), py::arg("end_module"), py::arg("forward_direction"), R"( Find the shortest path (i.e., theresult set with the lowest number of gates) that connects the start gate with any gate for the given module. The gate where the search started from will be the first in the result vector, the end gate will be the last. If there is no such path an empty vector is returned. If there is more than one path with the same length only the first one is returned. :param hal_py.Gate start_gate: The start gate for the path :param hal_py.Module end_module: The module which contains the end gate for the path :param bool forward_direction: Search successor module to gate if true, else search predecessor module. :returns: A list of gates that form a chain on success, an empty list on error. :rtype: list[hal_py.Gate] )") ``` -------------------------------- ### QWidget Setup and Coordinate Mapping Source: https://emsec.github.io/hal/doc/classhal_1_1_toolbar Contains API documentation for the `setupUi` method, used for setting up the user interface of a widget, and `mapToGlobal`, which converts a widget's local coordinates to global screen coordinates. ```APIDOC QWidget: setupUi(QWidget *widget) Sets up the user interface for the given widget. mapToGlobal(const QPoint &pos) -> QPoint Converts a point from the widget's local coordinate system to the global coordinate system. ``` -------------------------------- ### Get Bit (get_bit) Source: https://emsec.github.io/hal/doc/utils_8h_source Retrieves the value of a specific bit at a given index within a 64-bit unsigned integer. The index is 0-based, starting from the least significant bit. ```c++ CORE_API inline u64 get_bit(const u64 value, const u64 index) { return (value >> index) & 1; } ``` -------------------------------- ### QWidget Layout and Setup Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget Methods related to widget layout and setup. setupUi is typically used to initialize the UI of a widget, and sizeIncrement manages the size increment for resizing. ```APIDOC setupUi(widget: QWidget *widget) Sets up the user interface for the given widget. sizeIncrement() const -> QSize Returns the size increment of the widget. setSizeIncrement(size: const QSize &) Sets the size increment of the widget. setSizeIncrement(w: int, h: int) Sets the width and height of the size increment. ``` -------------------------------- ### Get Path in Netlist Source: https://emsec.github.io/hal/doc/netlist_2netlist__utils_8cpp_source Retrieves a path of gates starting from a given net, either successors or predecessors, stopping at gates with specified properties. It utilizes a cache for performance. ```C++ std::vector get_path(const Net* net, bool get_successors, std::set stop_properties) { std::unordered_map> cache; return get_path(net, get_successors, stop_properties, cache); } ``` -------------------------------- ### ContentDragRelay Methods Source: https://emsec.github.io/hal/doc/dock__bar_8cpp_source Provides methods to relay drag events, specifically for the start and end of drag operations. It also includes a static method to get the singleton instance. ```APIDOC hal::ContentDragRelay Methods: static ContentDragRelay * instance() Returns the singleton instance of ContentDragRelay. void relayDragEnd() Relays the end of a drag operation. void relayDragStart() Relays the start of a drag operation. ``` -------------------------------- ### QWidget Setup UI Source: https://emsec.github.io/hal/doc/classhal_1_1_search_options_dialog Provides a method to set up the user interface for a given QWidget. ```APIDOC QWidget::setupUi(QWidget *widget) - Sets up the user interface for the given widget. This is typically used in conjunction with UI design tools. ``` -------------------------------- ### Get Boolean Influences of Subcircuit (Deterministic) Source: https://emsec.github.io/hal/doc/boolean__influence_8cpp Determines the boolean influences for all nets within a subcircuit deterministically. It requires a vector of gates defining the subcircuit and a starting net. ```cpp Result< std::map< Net *, double > > hal::boolean_influence::get_boolean_influences_of_subcircuit_deterministic(const std::vector< Gate * > &gates, const Net *start_net) ``` -------------------------------- ### QWidget setupUi Method Source: https://emsec.github.io/hal/doc/classhal_1_1_selection_details_widget-members This documentation describes the `setupUi` method for QWidget. This method is typically used to set up the user interface of a widget, often in conjunction with UI design tools. ```APIDOC QWidget::setupUi(QWidget *widget) - Sets up the user interface for the given widget. - Parameters: - widget: A pointer to the QWidget whose UI needs to be set up. ``` -------------------------------- ### QWidget Layout and Setup Source: https://emsec.github.io/hal/doc/classhal_1_1_external_content_widget Methods related to widget layout and setup. setupUi is typically used to initialize the UI of a widget, and sizeIncrement manages the size increment for resizing. ```APIDOC setupUi(widget: QWidget *widget) Sets up the user interface for the given widget. sizeIncrement() const -> QSize Returns the size increment of the widget. setSizeIncrement(size: const QSize &) Sets the size increment of the widget. setSizeIncrement(w: int, h: int) Sets the width and height of the size increment. ``` -------------------------------- ### Qt Widget inputMethodHints Property Source: https://emsec.github.io/hal/doc/classhal_1_1_graphics_qss_adapter-members Gets or sets the input method hints for the widget. These hints guide the behavior of input method editors, such as suggesting word completions. ```C++ inputMethodHints() const ``` -------------------------------- ### QWidget Layout Setting Example Source: https://emsec.github.io/hal/doc/classhal_1_1_logger_qss_adapter Illustrates how to set a layout for a QWidget. ```cpp QVBoxLayout *layout = new QVBoxLayout(widget); // Add widgets to the layout widget->setLayout(layout); ``` -------------------------------- ### QRegularExpression Match Functions Source: https://emsec.github.io/hal/doc/python__syntax__highlighter_8cpp_source Provides functions for matching regular expressions against strings. Includes methods to get match details like start, end, and length of captured groups. ```APIDOC QRegularExpression::match match(const QString &subject, int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions) const Matches the regular expression against the subject string. Parameters: subject: The string to search within. offset: The offset in the subject string at which to begin the search. matchType: The type of matching to perform (e.g., Normal, Partial). matchOptions: Options to control the matching behavior. Returns: A QRegularExpressionMatch object containing the results of the match. QRegularExpressionMatch::capturedEnd capturedEnd(int nth) const Returns the end position of the nth captured substring. Parameters: nth: The index of the captured substring. Returns: The end position of the captured substring. QRegularExpressionMatch::capturedLength capturedLength(int nth) const Returns the length of the nth captured substring. Parameters: nth: The index of the captured substring. Returns: The length of the captured substring. QRegularExpressionMatch::capturedStart capturedStart(int nth) const Returns the start position of the nth captured substring. Parameters: nth: The index of the captured substring. Returns: The start position of the captured substring. QRegularExpressionMatch::hasMatch hasMatch() const Returns true if the match is valid; otherwise, returns false. Returns: True if a match was found, false otherwise. QRegularExpressionMatchIterator::hasNext hasNext() const Returns true if there is another match; otherwise, returns false. Returns: True if another match exists, false otherwise. QRegularExpressionMatchIterator::next next() Returns the next match in the iteration. Returns: A QRegularExpressionMatch object for the next match. ``` -------------------------------- ### QWidget setupUi Method Source: https://emsec.github.io/hal/doc/classhal_1_1_settings_widget_spinbox-members Method used for setting up the UI of a QWidget. ```APIDOC setupUi(QWidget *widget) Sets up the user interface for the given widget. Parameters: widget: The QWidget to set up. ``` -------------------------------- ### Get Module Code Source: https://emsec.github.io/hal/doc/py__code__provider_8cpp_source Returns the base Python code prefix for a given module ID. This is likely used as a starting point for constructing more complex module-related Python code. ```C++ QString PyCodeProvider::pyCodeModule(u32 moduleId) { return moduleCodePrefix.arg(moduleId); } ```