def __init__(self, cache_address):
    """Initializes a cache address.

    Args:
      cache_address (int): cache address.
    """
    super(CacheAddress, self).__init__()
    self.block_number = None
    self.block_offset = None
    self.block_size = None
    self.filename = None
    self.value = cache_address

    if cache_address & 0x80000000:
      self.is_initialized = 'True'
    else:
      self.is_initialized = 'False'

    self.file_type = (cache_address & 0x70000000) >> 28
    if not cache_address == 0x00000000:
      if self.file_type == self.FILE_TYPE_SEPARATE:
        file_selector = cache_address & 0x0fffffff
        self.filename = 'f_{0:06x}'.format(file_selector)

      elif self.file_type in self._BLOCK_DATA_FILE_TYPES:
        file_selector = (cache_address & 0x00ff0000) >> 16
        self.filename = 'data_{0:d}'.format(file_selector)

        file_block_size = self._FILE_TYPE_BLOCK_SIZES[self.file_type]
        self.block_number = cache_address & 0x0000ffff
        self.block_size = (cache_address & 0x03000000) >> 24
        self.block_size *= file_block_size
        self.block_offset = 8192 + (self.block_number * file_block_size)
def __init__ ( self , cache_address ) : super ( CacheAddress , self ) . __init__ ( ) self . block_number = None self . block_offset = None self . block_size = None self . filename = None self . value = cache_address if cache_address & 0x80000000 : self . is_initialized = 'True' else : self . is_initialized = 'False' self . file_type = ( cache_address & 0x70000000 ) >> 28 if not cache_address == 0x00000000 : if self . file_type == self . FILE_TYPE_SEPARATE : file_selector = cache_address & 0x0fffffff self . filename = 'f_{0:06x}' . format ( file_selector ) elif self . file_type in self . _BLOCK_DATA_FILE_TYPES : file_selector = ( cache_address & 0x00ff0000 ) >> 16 self . filename = 'data_{0:d}' . format ( file_selector ) file_block_size = self . _FILE_TYPE_BLOCK_SIZES [ self . file_type ] self . block_number = cache_address & 0x0000ffff self . block_size = ( cache_address & 0x03000000 ) >> 24 self . block_size *= file_block_size self . block_offset = 8192 + ( self . block_number * file_block_size )
Initializes a cache address.

    Args:
      cache_address (int): cache address.