models/cache/mcp-cache/hash_table.cpp
hash_set::hash_set (hash_table *table, int asoc, unsigned set_idx) :
    index(set_idx), assoc(asoc)
{
    this->my_table = table;

    set_entries.clear();
    for (int i = 0; i < assoc; i++)
    {
        set_entries.push_front(new hash_entry (this, set_idx * assoc + i));
    }
}
//! hash_set: Constructor
//!
//! This is a set of cache lines, the number
//! of which is determined by the cache's associativity. Contains a pointer
//! back to the parent table, the associativity factor, and a list of pointers
//! to the hash_entries it owns.
//!
//! @param \c table  The hash table that holds this set.
//! @param \c asoc  The associativity (number of entries in the set).
//! @param \c set_idx  The hash set's index within the table; 0-based.
Constructor
This is a set of cache lines, the number
of which is determined by the cache's associativity. Contains a pointer
back to the parent table, the associativity factor, and a list of pointers
to the hash_entries it owns.
Constructor This is a set of cache lines the number of which is determined by the cache ' s associativity . Contains a pointer back to the parent table the associativity factor and a list of pointers to the hash_entries it owns .
hash_set::hash_set (hash_table *table, int asoc, unsigned set_idx) :
    index(set_idx), assoc(asoc)
{
    this->my_table = table;
    set_entries.clear();
    for (int i = 0; i < assoc; i++)
    {
        set_entries.push_front(new hash_entry (this, set_idx * assoc + i));
    }
}
hash_set :: hash_set ( hash_table * table , int asoc , unsigned set_idx ) : index ( set_idx ) , assoc ( asoc ) { this -> my_table = table ; set_entries . clear ( ) ; for ( int i = 0 ; i < assoc ; i ++ ) { set_entries . push_front ( new hash_entry ( this , set_idx * assoc + i ) ) ; } }
hash_set: Constructor
This is a set of cache lines, the number
of which is determined by the cache's associativity.
hash_set : Constructor This is a set of cache lines the number of which is determined by the cache ' s associativity .