def __init__(self, name, sets, ways, cl_size,<EOL>replacement_policy="<STR_LIT>",<EOL>write_back=True,<EOL>write_allocate=True,<EOL>write_combining=False,<EOL>subblock_size=None,<EOL>load_from=None, store_to=None, victims_to=None,<EOL>swap_on_load=False):
assert load_from is None or isinstance(load_from, Cache),"<STR_LIT>"<EOL>assert store_to is None or isinstance(store_to, Cache),"<STR_LIT>"<EOL>assert victims_to is None or isinstance(victims_to, Cache),"<STR_LIT>"<EOL>assert is_power2(cl_size),"<STR_LIT>"<EOL>assert store_to is None or store_to.cl_size <= cl_size,"<STR_LIT>"<EOL>assert load_from is None or load_from.cl_size <= cl_size,"<STR_LIT>"<EOL>assert replacement_policy in self.replacement_policy_enum,"<STR_LIT>" +'<STR_LIT:U+002CU+0020>'.join(self.replacement_policy_enum)<EOL>assert (write_back, write_allocate) in [(False, False), (True, True), (True, False)],"<STR_LIT>""<STR_LIT>"<EOL>assert write_combining and write_back and not write_allocate or not write_combining,"<STR_LIT>"<EOL>assert subblock_size is None or cl_size % subblock_size == <NUM_LIT:0>,"<STR_LIT>"<EOL>self.name = name<EOL>self.replacement_policy = replacement_policy<EOL>self.replacement_policy_id = self.replacement_policy_enum[replacement_policy]<EOL>self.load_from = load_from<EOL>self.store_to = store_to<EOL>self.victims_to = victims_to<EOL>self.swap_on_load = swap_on_load<EOL>if subblock_size is None:<EOL><INDENT>subblock_size = cl_size<EOL><DEDENT>self.backend = backend.Cache(<EOL>name=name, sets=sets, ways=ways, cl_size=cl_size,<EOL>replacement_policy_id=self.replacement_policy_id,<EOL>write_back=write_back, write_allocate=write_allocate,<EOL>write_combining=write_combining, subblock_size=subblock_size,<EOL>load_from=get_backend(load_from), store_to=get_backend(store_to),<EOL>victims_to=get_backend(victims_to),<EOL>swap_on_load=swap_on_load)<EOL>
Create one cache level out of given configuration.

        :param sets: total number of sets, if 1 cache will be full-associative
        :param ways: total number of ways, if 1 cache will be direct mapped
        :param cl_size: number of bytes that can be addressed individually
        :param replacement_policy: FIFO, LRU (default), MRU or RR
        :param write_back: if true (default), write back will be done on evict.
                           Otherwise write-through is used
        :param write_allocate: if true (default), a load will be issued on a
                               write miss
        :param write_combining: if true, this cache will combine writes and
                                issue them on evicts(default is false)
        :param subblock_size: the minimum blocksize that write-combining can
                              handle
        :param load_from: the cache level to forward a load in case of a load
                          miss or write-allocate, if None, assumed to be main
                          memory
        :param store_to: the cache level to forward a store to in case of
                         eviction of dirty lines, if None, assumed to be main
                         memory
        :param victims_to: the cache level to forward any evicted lines to
                           (dirty or not)
        :param swap_on_load: if true, lines will be swaped between this and the
                             higher cache level (default is false).
                             Currently not supported.

        The total cache size is the product of sets*ways*cl_size.
        Internally all addresses are converted to cacheline indices.

        Instantization has to happen from last level cache to first level
        cache, since each subsequent level requires a reference of the other
        level.