10967 - SHiP Cache   

Description

Simulating the SHiP (Signature-bsed Hit Prediction) policy.

Input

The first five lines are as follows:

  1. The number of sets of the cache.
  2. The number of ways of the cache.
  3. "2", which indicates the SHiP policy.
  4. The number of saturating counters used by the SHiP policy.
  5. The number of operations to simulate.

Each following line represents an operation, comprising 4 or 5 fields.

  1. The serial number of the operation
  2. Program counter of the operation
  3. Accessed set number by the operation
  4. Wheter the operation is a hit (1) or miss(0)
  5. Which way is hit (this field only presents if the operation is a hit)

 

 

 

Output

The first five lines are the smae as the input.

For each operation, please print out the results using five lines.

The first line includes

  1. The serial number, program counter, accessed set number as listed in the input
  2. If the operation is a hit, then print out "Hit" and the hit way number
  3. If the operation is a miss, then print out "Replace and the way number that is replaced.

The following three lines show the per-way RRPV, signature, and outcome values of the accessed set.

The last line displays the SHCT table.

Please use parentheses to indicate that a filed is written (not necessary changed).

Sample Input  Download

Sample Output  Download

Tags




Discuss