code: def critical_path(self, print_cp=True, cp_limit=100):
          
          critical_paths = []  # storage of all completed critical paths
          wire_src_map, dst_map = self.block.net_connections()
  
          def critical_path_pass(old_critical_path, first_wire):
              if isinstance(first_wire, (Input, Const, Register)):
                  critical_paths.append((first_wire, old_critical_path))
                  return
  
              if len(critical_paths) >= cp_limit:
                  raise self._TooManyCPsError()
  
              source = wire_src_map[first_wire]
              critical_path = [source]
              critical_path.extend(old_critical_path)
              arg_max_time = max(self.timing_map[arg_wire] for arg_wire in source.args)
              for arg_wire in source.args:
                  # if the time for both items are the max, both will be on a critical path
                  if self.timing_map[arg_wire] == arg_max_time:
                      critical_path_pass(critical_path, arg_wire)
  
          max_time = self.max_length()
          try:
              for wire_pair in self.timing_map.items():
                  if wire_pair[1] == max_time:
                      critical_path_pass([], wire_pair[0])
          except self._TooManyCPsError:
              print("Critical path count limit reached")
  
          if print_cp:
              self.print_critical_paths(critical_paths)
          return critical_paths
docs: Takes a timing map and returns the critical paths of the system.
  
          :param print_cp: Whether to print the critical path to the terminal
              after calculation
          :return: a list containing tuples with the 'first' wire as the
              first value and the critical paths (which themselves are lists
              of nets) as the second