]> git.ipfire.org Git - thirdparty/qemu.git/commit
plugins/cache: implement unified L2 cache emulation
authorMahmoud Mandour <ma.mandourr@gmail.com>
Tue, 26 Oct 2021 10:22:20 +0000 (11:22 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Thu, 4 Nov 2021 10:32:01 +0000 (10:32 +0000)
commit14f3110a99d4edf683c6b503ca02dba09a124aff
treeca99071c78b384d6ba5335d449041ce7078dcfef
parentad039c506edaf11fc39fca218c751b26521da21c
plugins/cache: implement unified L2 cache emulation

This adds an implementation of a simple L2 configuration, in which a
unified L2 cache (stores both blocks of instructions and data) is
maintained for each core separately, with no inter-core interaction
taken in account. The L2 cache is used as a backup for L1 and is only
accessed if the wanted block does not exist in L1.

In terms of multi-threaded user-space emulation, the same approximation
of L1 is done, a static number of caches is maintained, and each and
every memory access initiated by a thread will have to go through one of
the available caches.

An atomic increment is used to maintain the number of L2 misses per
instruction.

The default cache parameters of L2 caches is:

    2MB cache size
    16-way associativity
    64-byte blocks

Signed-off-by: Mahmoud Mandour <ma.mandourr@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210810134844.166490-3-ma.mandourr@gmail.com>
Message-Id: <20211026102234.3961636-15-alex.bennee@linaro.org>
contrib/plugins/cache.c