Changeset 290 for trunk


Ignore:
Timestamp:
Jan 25, 2013, 4:52:34 PM (12 years ago)
Author:
cfuguet
Message:

Erasing in the vci_mem_cache_v4 CLEANUP FSM the transition
between the states CLEANUP_DIR_WRITE and CLEANUP_UPT_LOCK.

If the CLEANUP FSM is in the state DIR_WRITE, is because there
is a valid entry in the Memory Cache directory for the line
concerned by the cleanup operation. Another condition to go to
the DIR_WRITE state is that the concerned line must be in counter
mode or in linked list mode with only one copy enregistered.

Therefore, once the FSM is in the DIR_WRITE state, the FSM can
do one of two things:

  • The line is in counter mode and then the only thing to do is to decrement the copies counter.
  • The line is not in counter mode and then the copies counter must be decremented and the copy enregistered in the directory must be erased.

If the cleanup operation goes into the second category, the srcid and the
type of cache (instruction or data) carried by the cleanup operation must
be equal to the srcid and type of cache stored in the Memory Cache directory.

If this is not the case, it is an error (An assert has been also introduced
in the code to detect this kind of problem).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp

    r289 r290  
    37013701        bool match         = match_srcid && match_inst;
    37023702
     3703        if (not r_cleanup_is_cnt.read() and not match) {
     3704            std::cout
     3705              << "VCI_MEM_CACHE ERROR : Cleanup request on a valid"
     3706              << "entry using linked list mode with no corresponding"
     3707              << "directory or heap entry"
     3708              << std::endl;
     3709
     3710            exit(1);
     3711        }
     3712
    37033713        // update the cache directory (for the copies)
    37043714        DirectoryEntry entry;
    3705         entry.valid   = true;
    3706         entry.is_cnt  = r_cleanup_is_cnt.read();
    3707         entry.dirty   = r_cleanup_dirty.read();
    3708         entry.tag     = r_cleanup_tag.read();
    3709         entry.lock    = r_cleanup_lock.read();
    3710         entry.ptr     = r_cleanup_ptr.read();
    3711 
    3712         if ( r_cleanup_is_cnt.read() )      // counter mode
    3713         {
    3714           entry.count  = r_cleanup_count.read() -1;
    3715           entry.owner.srcid   = 0;
     3715        entry.valid       = true;
     3716        entry.is_cnt      = r_cleanup_is_cnt.read();
     3717        entry.dirty       = r_cleanup_dirty.read();
     3718        entry.tag         = r_cleanup_tag.read();
     3719        entry.lock        = r_cleanup_lock.read();
     3720        entry.ptr         = r_cleanup_ptr.read();
     3721        entry.count       = r_cleanup_count.read() - 1;
     3722        entry.owner.srcid = 0;
     3723        entry.owner.inst  = 0;
    37163724#if L1_MULTI_CACHE
    3717           entry.owner.cache_id= 0;
    3718 #endif
    3719           entry.owner.inst    = 0;
    3720           // response to the cache
    3721           r_cleanup_fsm = CLEANUP_RSP;
    3722         }
    3723         else                          // linked_list mode
    3724         {
    3725           if ( match )  // hit
    3726           {
    3727             entry.count         = 0; // no more copy
    3728             entry.owner.srcid   = 0;
    3729 #if L1_MULTI_CACHE
    3730             entry.owner.cache_id=0;
    3731 #endif
    3732             entry.owner.inst    = 0;
    3733             r_cleanup_fsm       = CLEANUP_RSP;
    3734           }
    3735           else         // miss
    3736           {
    3737             entry.count          = r_cleanup_count.read();
    3738             entry.owner.srcid    = r_cleanup_copy.read();
    3739 #if L1_MULTI_CACHE
    3740             entry.owner.cache_id = r_cleanup_copy_cache.read();
    3741 #endif
    3742             entry.owner.inst     = r_cleanup_copy_inst.read();
    3743             r_cleanup_fsm        = CLEANUP_UPT_LOCK;
    3744           }
    3745         }
     3725        entry.owner.cache_id = 0;
     3726#endif
     3727
    37463728        m_cache_directory.write(set, way, entry);
     3729
     3730        r_cleanup_fsm = CLEANUP_RSP;
    37473731
    37483732#if DEBUG_MEMC_CLEANUP
Note: See TracChangeset for help on using the changeset viewer.