code: def net_graph(block=None, split_state=False):
      
      # FIXME: make it not try to add unused wires (issue #204)
      block = working_block(block)
      from .wire import Register
      # self.sanity_check()
      graph = {}
  
      # add all of the nodes
      for net in block.logic:
          graph[net] = {}
  
      wire_src_dict, wire_dst_dict = block.net_connections()
      dest_set = set(wire_src_dict.keys())
      arg_set = set(wire_dst_dict.keys())
      dangle_set = dest_set.symmetric_difference(arg_set)
      for w in dangle_set:
          graph[w] = {}
      if split_state:
          for w in block.wirevector_subset(Register):
              graph[w] = {}
  
      # add all of the edges
      for w in (dest_set & arg_set):
          try:
              _from = wire_src_dict[w]
          except Exception:
              _from = w
          if split_state and isinstance(w, Register):
              _from = w
  
          try:
              _to_list = wire_dst_dict[w]
          except Exception:
              _to_list = [w]
  
          for _to in _to_list:
              graph[_from][_to] = w
  
      return graph
docs: Return a graph representation of the current block.
  
      Graph has the following form:
          { node1: { nodeA: edge1A, nodeB: edge1B},
            node2: { nodeB: edge2B, nodeC: edge2C},
            ...
          }
  
      aka: edge = graph[source][dest]
  
      Each node can be either a logic net or a WireVector (e.g. an Input, and Output, a
      Const or even an undriven WireVector (which acts as a source or sink in the network)
      Each edge is a WireVector or derived type (Input, Output, Register, etc.)
      Note that inputs, consts, and outputs will be both "node" and "edge".
      WireVectors that are not connected to any nets are not returned as part
      of the graph.