Get a deep copy of an entire netlist including all of its gates, nets, modules, and groupings.
Member hal::netlist_utils::get_next_gates (const Gate *gate, bool get_successors, int depth=0, const std::function< bool(const Gate *)> &filter=nullptr)
Find predecessors or successors of a gate. If depth is set to 1 only direct predecessors/successors will be returned. Higher number of depth causes as many steps of recursive calls. If depth is set to 0 there is no limitation and the loop continues until no more predecessors/succesors are found. If a filter function is given only gates matching the filter will be added to the result vector. The result will not include the provided gate itself.
Member hal::netlist_utils::get_next_gates (const Net *net, bool get_successors, int depth=0, const std::function< bool(const Gate *)> &filter=nullptr)
Find predecessors or successors of a net. If depth is set to 1 only direct predecessors/successors will be returned. Higher number of depth causes as many steps of recursive calls. If depth is set to 0 there is no limitation and the loop continues until no more predecessors/succesors are found. If a filter function is given, the recursion stops whenever the filter function evaluates to false. Only gates matching the filter will be added to the result vector.
Find all sequential predecessors or successors of a gate. Traverses combinational logic of all input or output nets until sequential gates 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.
Find all sequential predecessors or successors of a gate. Traverses combinational logic of all input or output nets until sequential gates are found. The result may include the provided gate itself.
Find all sequential predecessors or successors of a net. Traverses combinational logic of all input or output nets until sequential gates are found. The use of the cache is recommended in case of extensive usage of this function. 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.
Get the combined Boolean function of a subgraph of combinational gates starting at the source of the given net. The variables of the resulting Boolean function are made up of the IDs of the nets that influence the output ('net_[ID]'). Utilizes a cache for speedup on consecutive calls.
Get the combined Boolean function of a subgraph of combinational gates starting at the source of the given net. The variables of the resulting Boolean function are made up of the IDs of the nets that influence the output ('net_[ID]').
Remove all buffer gates from the netlist and connect their fan-in to their fan-out nets. If enabled, analyzes every gate's inputs and removes fixed '0' or '1' inputs from the Boolean function.
Replace the given gate with a gate of the specified gate type. A map from old to new pins must be provided in order to correctly connect the gates inputs and outputs. A pin can be omitted if no connection at that pin is desired.
DEPRECATED
Load the initial value specified within the netlist file into the current state of all sequential elements. This is especially relevant for FPGA netlists, since these may provide initial values to load on startup.