def vcd_convert(data, signals):
    """
    `data` obtained from .get_signals() has a form of a dictionary with strange
    key names (e.g. '7#'), then, for each key, it has a dictionary with keys:
      'references' - here we will have the actual signal name
      'size' - N bytes
      'var_type' - e.g. 'wire'
      'tv' - actual data stored as list of tuples (time: int, value: str)
             each `value` is a binary number as a string
    This function converts that to a dictionary that we can reference by normal names.
    """
    conv = {}
    for sig in signals:
        # check
        for data_key in data.keys():
            if sig in data[data_key]['references']:
                conv[sig] = data[data_key]
                break
        assert sig in conv, 'Signal "%s" not found' % sig
    return conv