• Tidak ada hasil yang ditemukan

FS-TGS and its dynamic mapping with RT

5.5 Proposed Architecture: FS-DAM

5.5.2 FS-TGS and its dynamic mapping with RT

The additional tag-array in FS-DAM, termed as FS-TGS, is same as SA-TGS of CMP-SVR. For a same cache configuration both FS-TGS and SA-TGS have equal tgsSets and tgsWays. Given an M-way set associative cache having S number of cacheSets,Rnumber of reservedcacheWays percacheSet and fellow-group size as F, the structure of the FS-TGS is given by the Equations5.8,5.9 and 5.10. Note that the equations are similar to the Equations 5.1,5.2 and 5.3.

Number of entries in FS-TGS(E0) =RS (5.8)

Associativity of FS-TGS(A0) =RF (5.9) Number of tgsSets in FS-TGS(S00) =S/F (5.10)

The difference between FS-TGS (of FS-DAM) and SA-TGS (of CMP-SVR) is in the mechanism to maintain the one-to-one relationship between the FS-TGS locations and the corresponding RT locations. The grouping in CMP-SVR is done based on the set indexes. Therefore, the one-to-one mapping between the RT and the SA-TGS entries can be calculated by the Equations 5.4, 5.5, 5.6, and 5.7. In FS-DAM the grouping is done based on the set-loads; irrespective of the set index, a set can be in any fellow-group based on its current load. Hence the equations used for CMP-SVR cannot be directly used for FS-DAM. Some additional information has to be maintained for such dynamic groupings [21,67].

The fellow-groups in FS-DAM are represented as follows:

G={g0, g1, . . . , gS00},

Where gi is the ith fellow-group of sets. Note that there are S00 number of fellow- groups. Every fellow-groupgi has F number of cacheSets, called fellow-sets.

gi ={f0, f1, . . . , fF−1},0≤i < S00

In each fellow-group gi, a fellow set is denoted by fj(0≤j < F). Each fellow-set represents a unique cacheSet between 0 toS. For example g2 ={2,23,34} means the fellow-groupg2 has three fellow-sets: 2nd, 23rd and 34th sets of the cache. The subscript j in each fellow-set is called the fellow-set number which represents its order in the fellow-group. In the above example, entry “2” indicates 2nd set from cache and 0th index in the group.

In FS-DAM the ith fellow-group (starting from 0) is mapped to the ith tgsSet of FS-TGS. All the reserve cacheWays of gi are mapped with the tgsWays of ith tgsSet (tsi). The mappings are done in index order, i.e., the reserve ways of first fellow-set (f0) ingi are mapped first into the tgsWays oftsi. The first reserve way of f0 maps with the 0th tgsWay of tsi. The next reserve way of f0 maps to the nexttgsWay of tsi. Once all the reserve ways of f0 are mapped, the reserve ways off1 start to map in the successive ways oftsi. In this manner all the reserve ways of gi map with the tgsWays of tsi in FS-TGS. The associativity of FS-TGS, A0, and the number of total reserve ways in gi must always be the same. Hence it can be observed that the mapping between the fellow-groups and their corresponding tgsSet in FS-TGS is static. Given a FS-TGS location (ts, tw) wherets is thetgsSet number and tw is the tgsWay number, we have:

fellow-group number =ts

fellow-set number within the above fellow-group =tw/R

But since the fellow-groups are made (re-grouped) dynamically the cacheSets are not statically mapped to the fellow-groups. Hence the above formula can only give the fellow-group number and the fellow-set number but cannot give the actual cacheSet number (ft0w/R). To store thecacheSet number for a particular fellow-set number an additional table is used called the SetMapper. The SetMapper has S00 rows and F columns; each row represents a fellow-group and each column represents a fellow-set. An entry, SetMapper[l][k] = m, (0 ≤ l < S00,0 ≤ k <

F,0 ≤ m < S), means kth fellow-set of lth fellow-group is the mth cacheSet.

Algorithm2 shows the complete FS-TGS to cache mappings.

ALGORITHM 2: FS-TGS and cache mapping TgsToCache(tgsr, tgsw) begin

Input: FS-TGS location (tgsr, tgsw) Output: Cache memory location (in

RT).

/* tgsr is the tgsSet index and tgsw is the tgsWay index. */

/* R: reserve ways per

cacheSet, M: associativity

of the cache. */

cachewayID=(M−R) + (tgsw%R) cachesetID=SetMapper[tgsr][tgsw/R]

return (cachesetID, cachewayID) end

CacheToTgs(ch set) begin

/* The function is called for indirect-search. */

Input: Cache-set index (ch set) Output: corresponding tgsSet in

FS-TGS.

/* To search a block in the home-group’s RT, the corresponding tgsSet in

FS-TGS is searched. */

return SetPointer[ch set];

end

A similar mapping from cache to FS-TGS is also required to search a block in its RT section. Each fellow-group has a separate RT section and a set can use the RT section of its fellow-group. To search a block in RT the corresponding tgsSet in FS-TGS has to be searched. As mentioned above, each RT section has a separate tgsSet in FS-TGS. An additional array called SetPointer is used to map each cacheSet with the corresponding tgsSet in FS-TGS. Each cacheSet has an entry in SetPointer. An entry SetPointer[p] =t means cacheSet pmaps to tgsSet t. Figure 5.4, shows an example of FS-DAM.

FS-TGS same as SA-TGS needs to store few additional bits to distinguish the block addresses having same tag but maps to different home-set.

Figure 5.4: An example of FS-DAM. Total cacheSets (S) = 8, Total cacheWays (M) = 8, Reserve cacheWays per Cacheset (R) = 2, Fellow-group size (F) = 2, Total tgsSets in FS-TGS (S00) =S/F= 4

and Total tgsWays per tgsSet (A0) =RF= 4.