Hi All,

As part of my research project using gem5, I want to use CLFLUSH and WBINVD
with the two-level MESI protocol.
I have an idea on how to add this support, and I would like to ask for the
community's opinion on whether I am in the right direction or should I do
things differently.
Additionally, I would appreciate any other suggestions (like what is the
best way to test the solution or anything else).

CLFLUSH: this is a flush for a single address (single cache block).
The L1 (data) support can be:
1. Perform the existing L1_replacment event on the specific cache block.
only:
    1.1 Move the block to a parallel flush-state that stalls any requests
from the core to the cache block  (the state is parallel to what the
L1_replacment would transition the block).
2. Forward the flush request to the L2. (I am assuming no ack is required
for the flush request from the L2)
3. pop the flush request from the input queue from the core (the
mandatory queue).

The L2 support is similar to the L1:
1. Perform the existing L2_replacment event on the specific cache block.
only:
  1.1 Move the block to a parallel flush-state that stalls any requests
from the L1s to the cache block  (the state is parallel to what the
L2_replacment would transition the block).
2. pop the flush request from the input queue from L1s.

comment: since the MESI two levels have an inclusive L2, evicting the block
from L2 will evict it from all L1 (part of the L2_replacment event).

WBINVD: this is a flush for the entire cache hierarchy. To support this, I
think to add to the CacheMemory object a capability to retrieve a block
from the existing blocks, using this functionality to perform the following:

In L1 (data):
1. Repeat until the cache is empty:
    1.1 retrieve an existing block
    1.2 perform the existing L1_replacment event on the block (as with
CLFLUSH).
2. Wait until all blocks are invalidated.
3. pop the flush request from the input queue from the core (the cache
blocks all requests from the core until now)
4. forward the wbinvd request to L2.

In L2:
1. Repeat until the cache is empty:
    1.1 retrieve an existing block
    1.2 perform the existing L2_replacment event on the block (as with
CLFLUSH).
2. Wait until all blocks are invalidated.
3. pop the flush request from the input queue from the L1s

Thank you in advance,
Ben
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to