Graph Algorithm

class hal_plugins.libgraph_algorithm.graph_algorithm
get_bdds(self: hal_plugins.libgraph_algorithm.graph_algorithm, netlist: hal_py.netlist, gates: Set[hal_py.gate], input_net_to_ids: Dict[hal_py.net, int]={}) → Tuple[Dict[hal_py.net, int], Dict[hal_py.net, hal_py.bdd]]

Returns the BDD representation for a part of netlist.

Parameters:
  • netlist (hal_py.netlist) – Netlist
  • gates (set(hal_py.gate)) – Set of gates defining the submodule for which the BDDs are determined.
  • input_net_to_ids (dict[hal_py.net, int]) – Map of submodule input net ids (variable definition X0, X1, …), if empty the function determines the variable assignment and returns it.
Returns:

A tuple of a map of submodule input net to ids (variable definition X0, X1, …) and a map of submodule output net to BDDs (function defintion f1(x0, …, x_n), f2(x0, … x_n), …).

Return type:

tuple(dict[hal_py.net, int], dict[hal_py.net, hal_py.bdd])

get_communities(self: hal_plugins.libgraph_algorithm.graph_algorithm, netlist: hal_py.netlist) → Dict[int, Set[hal_py.gate]]

Returns the map of community-IDs to communities.

Parameters:
  • netlist (hal_py.netlist) – Netlist (internelly transformed to di-graph)
  • gates (set(hal_py.gate)) – Set of gates for which the strongly connected components are determined. (default = empty means that all gates of the netlist are considered)
Returns:

A set of strongly connected components where each component is a set of gates.

Return type:

set(set(hal_py.gate))

get_dijkstra_shortest_paths(self: hal_plugins.libgraph_algorithm.graph_algorithm, gate: hal_py.gate) → Dict[hal_py.gate, Tuple[List[hal_py.gate], int]]

Returns the shortest path distances for one gate to all other gates.

Parameters:gate (hal_py.gate) – Gate (starting vertex for Dijkstra’s algorithm)
Returns:A map of path and distance to the starting gate for all pther gates in the netlist.
Return type:dict[hal_py.gate, tuple(list(hal_py.gate), int)]
get_graph_cut(self: hal_plugins.libgraph_algorithm.graph_algorithm, netlist: hal_py.netlist, current_gate: hal_py.gate, depth: int=4294967295, terminal_gate_type: Set[str]=set()) → List[Set[hal_py.gate]]

Returns a graph cut for a specific gate and depth.

Parameters:
  • netlist (hal_py.netlist) – Netlist (internally transformed to di-graph)
  • current_gate (hal_py.gate) – Gate (starting vertex for graph cut)
  • depth (int) – Graph cut depth
  • terminal_gate_type (set(str)) – Marks terminal vertex gate types of graph cut (typically memory gates such as flip-flops).
Returns:

A list of gate sets where each list entry refers to the distance to the starting gate.

Return type:

list(set(gate))

get_name(self: hal_plugins.libgraph_algorithm.graph_algorithm) → str

Get the name of the plugin.

Returns:Plugin name.
Return type:str
get_strongly_connected_components(self: hal_plugins.libgraph_algorithm.graph_algorithm, netlist: hal_py.netlist, gates: Set[hal_py.gate]) → List[Set[hal_py.gate]]

Returns the set of strpngly connected components.

Parameters:
  • netlist (hal_py.netlist) – Netlist (internelly transformed to di-graph)
  • gates (set(hal_py.gate)) – Set of gates for which the strongly connected components are determined. (default = empty means that all gates of the netlist are considered)
Returns:

A set of strongly connected components where each component is a set of gates.

Return type:

set(set(hal_py.gate))

get_version(self: hal_plugins.libgraph_algorithm.graph_algorithm) → str

Get the version of the plugin.

Returns:Plugin version.
Return type:str
name

Get the name of the plugin.

Returns:Plugin name.
Return type:str
version

Get the version of the plugin.

Returns:Plugin version.
Return type:str