MESI_Two_Level-L2cache.sm (14184:11ac1337c5e2) MESI_Two_Level-L2cache.sm (14300:22183ae13998)
1/*
2 * Copyright (c) 1999-2013 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 364 unchanged lines hidden (view full) ---

373 } else {
374 if (L2cache.cacheAvail(in_msg.addr)) {
375 // L2 does't have the line, but we have space for it in the L2
376 trigger(L1Cache_request_type_to_event(in_msg.Type, in_msg.addr,
377 in_msg.Requestor, cache_entry),
378 in_msg.addr, cache_entry, tbe);
379 } else {
380 // No room in the L2, so we need to make room before handling the request
1/*
2 * Copyright (c) 1999-2013 Mark D. Hill and David A. Wood
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 364 unchanged lines hidden (view full) ---

373 } else {
374 if (L2cache.cacheAvail(in_msg.addr)) {
375 // L2 does't have the line, but we have space for it in the L2
376 trigger(L1Cache_request_type_to_event(in_msg.Type, in_msg.addr,
377 in_msg.Requestor, cache_entry),
378 in_msg.addr, cache_entry, tbe);
379 } else {
380 // No room in the L2, so we need to make room before handling the request
381 Entry L2cache_entry := getCacheEntry(L2cache.cacheProbe(in_msg.addr));
381 Addr victim := L2cache.cacheProbe(in_msg.addr);
382 Entry L2cache_entry := getCacheEntry(victim);
382 if (isDirty(L2cache_entry)) {
383 if (isDirty(L2cache_entry)) {
383 trigger(Event:L2_Replacement, L2cache.cacheProbe(in_msg.addr),
384 L2cache_entry, TBEs[L2cache.cacheProbe(in_msg.addr)]);
384 trigger(Event:L2_Replacement, victim, L2cache_entry, TBEs[victim]);
385 } else {
385 } else {
386 trigger(Event:L2_Replacement_clean, L2cache.cacheProbe(in_msg.addr),
387 L2cache_entry, TBEs[L2cache.cacheProbe(in_msg.addr)]);
386 trigger(Event:L2_Replacement_clean,
387 victim, L2cache_entry, TBEs[victim]);
388 }
389 }
390 }
391 }
392 }
393 }
394
395

--- 706 unchanged lines hidden ---
388 }
389 }
390 }
391 }
392 }
393 }
394
395

--- 706 unchanged lines hidden ---