![]() |
HAL
|
Functions | |
Result< BooleanFunction > | get_subgraph_function (const Net *net, const std::vector< const Gate * > &subgraph_gates, std::map< std::pair< u32, const GatePin * >, BooleanFunction > &cache) |
Result< BooleanFunction > | get_subgraph_function (const Net *net, const std::vector< const Gate * > &subgraph_gates) |
std::unique_ptr< Netlist > | copy_netlist (const Netlist *nl) |
std::pair< std::map< u32, Gate * >, std::vector< std::vector< int > > > | get_ff_dependency_matrix (const Netlist *nl) |
std::unique_ptr< Netlist > | get_partial_netlist (const Netlist *nl, const std::vector< const Gate * > &subgraph_gates) |
std::vector< Gate * > | get_next_gates (const Gate *gate, bool get_successors, int depth, const std::function< bool(const Gate *)> &filter) |
std::vector< Gate * > | get_next_gates (const Net *net, bool get_successors, int depth, const std::function< bool(const Gate *)> &filter) |
std::vector< Gate * > | get_shortest_path (Gate *start_gate, Gate *end_gate, bool search_both_directions) |
std::vector< Gate * > | get_next_sequential_gates (const Gate *gate, bool get_successors, std::unordered_map< u32, std::vector< Gate * >> &cache) |
std::vector< Gate * > | get_next_sequential_gates (const Net *net, bool get_successors, std::unordered_map< u32, std::vector< Gate * >> &cache) |
std::vector< Gate * > | get_next_sequential_gates (const Gate *gate, bool get_successors) |
std::vector< Gate * > | get_next_sequential_gates (const Net *net, bool get_successors) |
std::vector< Gate * > | get_path (const Gate *gate, bool get_successors, std::set< GateTypeProperty > stop_properties, std::unordered_map< u32, std::vector< Gate * >> &cache) |
std::vector< Gate * > | get_path (const Net *net, bool get_successors, std::set< GateTypeProperty > stop_properties, std::unordered_map< u32, std::vector< Gate * >> &cache) |
std::vector< Gate * > | get_path (const Gate *gate, bool get_successors, std::set< GateTypeProperty > stop_properties) |
std::vector< Gate * > | get_path (const Net *net, bool get_successors, std::set< GateTypeProperty > stop_properties) |
std::vector< Net * > | get_nets_at_pins (Gate *gate, std::vector< GatePin * > pins) |
Result< u32 > | remove_buffers (Netlist *netlist, bool analyze_inputs) |
Result< u32 > | remove_unused_lut_endpoints (Netlist *netlist) |
std::vector< Net * > | get_common_inputs (const std::vector< Gate * > &gates, u32 threshold) |
Result< std::monostate > | replace_gate (Gate *gate, GateType *target_type, std::map< GatePin *, GatePin * > pin_map) |
Result< std::vector< Gate * > > | get_gate_chain (Gate *start_gate, const std::vector< const GatePin * > &input_pins, const std::vector< const GatePin * > &output_pins, const std::function< bool(const Gate *)> &filter) |
Result< std::vector< Gate * > > | get_complex_gate_chain (Gate *start_gate, const std::vector< GateType * > &chain_types, const std::map< GateType *, std::vector< const GatePin * >> &input_pins, const std::map< GateType *, std::vector< const GatePin * >> &output_pins, const std::function< bool(const Gate *)> &filter) |
[in] | nl | - The netlist to copy. |
Definition at line 95 of file netlist_utils.cpp.
References hal::Netlist::copy(), and log_error.
Referenced by hal::netlist_utils_init().
CORE_API std::vector< Net * > hal::netlist_utils::get_common_inputs | ( | const std::vector< Gate * > & | gates, |
u32 | threshold = 0 |
||
) |
Returns all nets that are considered to be common inputs to the provided gates. A threshold value can be provided to specify the number of gates a net must be connected to in order to be classified as a common input. If the theshold value is set to 0, a net must be input to all gates to be considered a common input.
[in] | gates | - The gates. |
[in] | threshold | - The threshold value, defaults to 0. |
Definition at line 724 of file netlist_utils.cpp.
References test_plugin::g, and test::n.
Referenced by hal::netlist_utils_init().
CORE_API Result< std::vector< Gate * > > hal::netlist_utils::get_complex_gate_chain | ( | Gate * | start_gate, |
const std::vector< GateType * > & | chain_types, | ||
const std::map< GateType *, std::vector< const GatePin * >> & | input_pins, | ||
const std::map< GateType *, std::vector< const GatePin * >> & | output_pins, | ||
const std::function< bool(const Gate *)> & | filter = nullptr |
||
) |
Find a sequence of gates (of the specified sequence of gate types) that are connected via the specified input and output pins. The start gate may be any gate within a such a sequence, it is not required to be the first or the last gate. However, the start gate must be of the first gate type within the repeating sequence. If input and/or output pins are specified for a gate type, the gates must be connected through one of the input pins and/or one of the output pins. The optional filter is evaluated on every gate such that the result only contains gates matching the specified condition.
[in] | start_gate | - The gate at which to start the chain detection. |
[in] | chain_types | - The sequence of gate types that is expected to make up the gate chain. |
[in] | input_pins | - The input pins (of every gate type of the sequence) through which the gates must be connected. |
[in] | output_pins | - The output pins (of every gate type of the sequence) through which the gates must be connected. |
[in] | filter | - An optional filter function to be evaluated on each gate. |
Definition at line 904 of file netlist_utils.cpp.
References ERR, hal::Endpoint::get_gate(), hal::Gate::get_id(), hal::Netlist::get_id(), hal::Gate::get_name(), hal::Gate::get_netlist(), hal::Endpoint::get_pin(), hal::Gate::get_predecessors(), hal::Gate::get_successors(), hal::Gate::get_type(), log_debug, and OK.
Referenced by hal::netlist_utils_init().
std::pair< std::map< u32, Gate * >, std::vector< std::vector< int > > > hal::netlist_utils::get_ff_dependency_matrix | ( | const Netlist * | nl | ) |
Get the FF dependency matrix of a netlist.
[in] | nl | - The netlist to extract the dependency matrix from. |
Definition at line 108 of file netlist_utils.cpp.
References hal::ff, hal::Netlist::get_gates(), and get_next_sequential_gates().
Referenced by hal::netlist_utils_init().
CORE_API Result< std::vector< Gate * > > hal::netlist_utils::get_gate_chain | ( | Gate * | start_gate, |
const std::vector< const GatePin * > & | input_pins = {} , |
||
const std::vector< const GatePin * > & | output_pins = {} , |
||
const std::function< bool(const Gate *)> & | filter = nullptr |
||
) |
Find a sequence of identical gates that are connected via the specified input and output pins. The start gate may be any gate within a such a sequence, it is not required to be the first or the last gate. If input and/or output pins are specified, the gates must be connected through one of the input pins and/or one of the output pins. The optional filter is evaluated on every gate such that the result only contains gates matching the specified condition.
[in] | start_gate | - The gate at which to start the chain detection. |
[in] | input_pins | - The input pins through which the gates must be connected. Defaults to an empty vector. |
[in] | output_pins | - The output pins through which the gates must be connected. Defaults to an empty vector. |
[in] | filter | - An optional filter function to be evaluated on each gate. |
Definition at line 781 of file netlist_utils.cpp.
References ERR, hal::Endpoint::get_gate(), hal::Gate::get_id(), hal::Netlist::get_id(), hal::Gate::get_name(), hal::Gate::get_netlist(), hal::Gate::get_successors(), hal::Gate::get_type(), and log_debug.
Referenced by hal::netlist_utils_init().
CORE_API std::vector< Net * > hal::netlist_utils::get_nets_at_pins | ( | Gate * | gate, |
std::vector< GatePin * > | pins | ||
) |
Get the nets that are connected to a subset of pins of the specified gate.
[in] | gate | - The gate. |
[in] | pins | - The targeted pins. |
Definition at line 442 of file netlist_utils.cpp.
References direction, hal::Gate::get_fan_in_net(), hal::Gate::get_fan_out_net(), hal::Gate::get_id(), hal::Gate::get_name(), hal::inout, hal::input, log_warning, net, hal::output, and pins.
Referenced by hal::netlist_utils_init().
CORE_API std::vector< Gate * > hal::netlist_utils::get_next_gates | ( | const Gate * | gate, |
bool | get_successors, | ||
int | depth = 0 , |
||
const std::function< bool(const Gate *)> & | filter = nullptr |
||
) |
[in] | gate | - The initial gate. |
[in] | get_successors | - True to return successors, false for Predecessors. |
[in] | depth | - Depth of recursion. |
[in] | filter | - User-defined filter function. |
Definition at line 166 of file netlist_utils.cpp.
References test::n.
Referenced by hal::CommonSuccessorPredecessorGateQueue::getNext(), and hal::netlist_utils_init().
CORE_API std::vector< Gate * > hal::netlist_utils::get_next_gates | ( | const Net * | net, |
bool | get_successors, | ||
int | depth = 0 , |
||
const std::function< bool(const Gate *)> & | filter = nullptr |
||
) |
[in] | net | - The initial net. |
[in] | get_successors | - True to return successors, false for Predecessors. |
[in] | depth | - Depth of recursion. |
[in] | filter | - User-defined filter function. |
Definition at line 214 of file netlist_utils.cpp.
References test_plugin::g, test::n, and net.
CORE_API std::vector< Gate * > hal::netlist_utils::get_next_sequential_gates | ( | const Gate * | gate, |
bool | get_successors | ||
) |
[in] | gate | - The initial gate. |
[in] | get_successors | - If true, sequential successors are returned, otherwise sequential predecessors are returned. |
Definition at line 345 of file netlist_utils.cpp.
References get_next_sequential_gates().
CORE_API std::vector< Gate * > hal::netlist_utils::get_next_sequential_gates | ( | const Gate * | gate, |
bool | get_successors, | ||
std::unordered_map< u32, std::vector< Gate * >> & | cache | ||
) |
[in] | gate | - The initial gate. |
[in] | get_successors | - If true, sequential successors are returned, otherwise sequential predecessors are returned. |
[in,out] | cache | - The cache. |
Definition at line 324 of file netlist_utils.cpp.
References hal::Gate::get_fan_in_nets(), hal::Gate::get_fan_out_nets(), and test::n.
Referenced by get_ff_dependency_matrix(), get_next_sequential_gates(), and hal::netlist_utils_init().
CORE_API std::vector< Gate * > hal::netlist_utils::get_next_sequential_gates | ( | const Net * | net, |
bool | get_successors | ||
) |
[in] | net | - The initial net. |
[in] | get_successors | - If true, sequential successors are returned, otherwise sequential predecessors are returned. |
Definition at line 351 of file netlist_utils.cpp.
References get_next_sequential_gates(), and net.
CORE_API std::vector< Gate * > hal::netlist_utils::get_next_sequential_gates | ( | const Net * | net, |
bool | get_successors, | ||
std::unordered_map< u32, std::vector< Gate * >> & | cache | ||
) |
[in] | net | - The initial net. |
[in] | get_successors | - If true, sequential successors are returned, otherwise sequential predecessors are returned. |
[in,out] | cache | - The cache. |
Definition at line 339 of file netlist_utils.cpp.
References net.
CORE_API std::unique_ptr< Netlist > hal::netlist_utils::get_partial_netlist | ( | const Netlist * | nl, |
const std::vector< const Gate * > & | subgraph_gates | ||
) |
[in] | nl | - The netlist consisting of the subgraph. |
[in] | subgraph_gates | - The gates the subgraph is supposed to consist of. |
Definition at line 153 of file netlist_utils.cpp.
References hal::SubgraphNetlistDecorator::copy_subgraph_netlist(), and log_error.
CORE_API std::vector< Gate * > hal::netlist_utils::get_path | ( | const Gate * | gate, |
bool | get_successors, | ||
std::set< GateTypeProperty > | stop_properties | ||
) |
Find all gates on the predeccessor or successor path of a gate. Traverses all input or output nets until gates of the specified base types are found. The result may include the provided gate itself.
[in] | gate | - The initial gate. |
[in] | get_successors | - If true, the successor path is returned, otherwise the predecessor path is returned. |
[in] | stop_properties | - Stop recursion when reaching a gate of a type with one of the specified properties. |
Definition at line 430 of file netlist_utils.cpp.
References get_path().
CORE_API std::vector< Gate * > hal::netlist_utils::get_path | ( | const Gate * | gate, |
bool | get_successors, | ||
std::set< GateTypeProperty > | stop_properties, | ||
std::unordered_map< u32, std::vector< Gate * >> & | cache | ||
) |
Find all gates on the predecessor or successor path of a gate. Traverses all input or output nets until gates of the specified base types are found. The result may include the provided gate itself. The use of the this cached version is recommended in case of extensive usage to improve performance. The cache will be filled by this function and should initially be provided empty. Different caches for different values of get_successors shall be used.
[in] | gate | - The initial gate. |
[in] | get_successors | - If true, the successor path is returned, otherwise the predecessor path is returned. |
[in] | stop_properties | - Stop recursion when reaching a gate of a type with one of the specified properties. |
[in,out] | cache | - The cache. |
Definition at line 409 of file netlist_utils.cpp.
References hal::Gate::get_fan_in_nets(), hal::Gate::get_fan_out_nets(), and test::n.
Referenced by get_path(), and hal::netlist_utils_init().
CORE_API std::vector< Gate * > hal::netlist_utils::get_path | ( | const Net * | net, |
bool | get_successors, | ||
std::set< GateTypeProperty > | stop_properties | ||
) |
Find all gates on the predecessor or successor path of a net. Traverses all input or output nets until gates of the specified base types are found.
[in] | net | - The initial net. |
[in] | get_successors | - If true, the successor path is returned, otherwise the predecessor path is returned. |
[in] | stop_properties | - Stop recursion when reaching a gate of a type with one of the specified properties. |
Definition at line 436 of file netlist_utils.cpp.
References get_path(), and net.
CORE_API std::vector< Gate * > hal::netlist_utils::get_path | ( | const Net * | net, |
bool | get_successors, | ||
std::set< GateTypeProperty > | stop_properties, | ||
std::unordered_map< u32, std::vector< Gate * >> & | cache | ||
) |
Find all gates on the predecessor or successor path of a net. Traverses all input or output nets until gates of the specified base types are found. The use of the this cached version is recommended in case of extensive usage to improve performance. The cache will be filled by this function and should initially be provided empty. Different caches for different values of get_successors shall be used.
[in] | net | - The initial net. |
[in] | get_successors | - If true, the successor path is returned, otherwise the predecessor path is returned. |
[in] | stop_properties | - Stop recursion when reaching a gate of a type with one of the specified properties. |
[in,out] | cache | - The cache. |
Definition at line 424 of file netlist_utils.cpp.
References net.
CORE_API std::vector< Gate * > hal::netlist_utils::get_shortest_path | ( | Gate * | start_gate, |
Gate * | end_gate, | ||
bool | search_both_directions = false |
||
) |
[in] | start_gate | - The gate to start from. |
[in] | end_gate | - The gate to connect to. |
[in] | search_both_directions | - True to additionally check whether a shorter path from end to start exists, false otherwise. |
Definition at line 271 of file netlist_utils.cpp.
Referenced by hal::GraphGraphicsView::handleShortestPath(), and hal::netlist_utils_init().
CORE_API Result< BooleanFunction > hal::netlist_utils::get_subgraph_function | ( | const Net * | net, |
const std::vector< const Gate * > & | subgraph_gates | ||
) |
[in] | net | - The net for which to generate the Boolean function. |
[in] | subgraph_gates | - The gates making up the subgraph to consider. |
Definition at line 82 of file netlist_utils.cpp.
References ERR, get_subgraph_function(), and net.
CORE_API Result< BooleanFunction > hal::netlist_utils::get_subgraph_function | ( | const Net * | net, |
const std::vector< const Gate * > & | subgraph_gates, | ||
std::map< std::pair< u32, const GatePin * >, BooleanFunction > & | cache | ||
) |
[in] | net | - The net for which to generate the Boolean function. |
[in] | subgraph_gates | - The gates making up the subgraph to consider. |
[in,out] | cache | - Cache to speed up computations. The cache is filled by this function. |
Definition at line 65 of file netlist_utils.cpp.
References ERR, hal::SubgraphNetlistDecorator::get_subgraph_function(), and net.
Referenced by get_subgraph_function(), and hal::netlist_utils_init().
CORE_API Result< u32 > hal::netlist_utils::remove_buffers | ( | Netlist * | netlist, |
bool | analyze_inputs = false |
||
) |
[in] | netlist | - The target netlist. |
[in] | analyze_inputs | - Set true to dynamically analyze the inputs, false otherwise. |
Definition at line 482 of file netlist_utils.cpp.
References hal::Net::add_destination(), hal::combinational, hal::BooleanFunction::Const(), ERR, hal::Gate::get_boolean_functions(), hal::Net::get_destinations(), hal::Gate::get_fan_in_endpoints(), hal::Gate::get_fan_out_endpoints(), hal::Gate::get_id(), hal::Net::get_id(), hal::GateType::get_input_pin_names(), hal::Gate::get_name(), hal::Net::get_name(), hal::BasePin< T >::get_name(), hal::Endpoint::get_net(), hal::Endpoint::get_pin(), hal::Gate::get_type(), hal::ground, hal::GateType::has_property(), test_multiple::netlist, OK, hal::power, hal::Net::remove_destination(), hal::BooleanFunction::simplify(), hal::BooleanFunction::substitute(), and hal::BooleanFunction::to_string().
Referenced by hal::netlist_utils_init().
[in] | netlist | - The target netlist. |
Definition at line 671 of file netlist_utils.cpp.
References hal::Net::add_destination(), ERR, test_plugin::g, hal::Gate::get_boolean_functions(), hal::Gate::get_fan_in_endpoints(), hal::Gate::get_id(), hal::Gate::get_name(), test_multiple::netlist, and OK.
Referenced by hal::netlist_utils_init().
CORE_API Result< std::monostate > hal::netlist_utils::replace_gate | ( | Gate * | gate, |
GateType * | target_type, | ||
std::map< GatePin *, GatePin * > | pin_map | ||
) |
[in] | gate | - The gate to be replaced. |
[in] | target_type | - The gate type of the replacement gate. |
[in] | pin_map | - A map from old to new pins. |
Definition at line 768 of file netlist_utils.cpp.
References ERR, hal::Gate::get_netlist(), OK, and hal::NetlistModificationDecorator::replace_gate().
Referenced by hal::netlist_utils_init().