Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/BranchOne_SuperPolicy' into Bran…
Browse files Browse the repository at this point in the history
…chOne_SuperPolicy
  • Loading branch information
EshedHere committed Feb 24, 2024
1 parent 1c2dc68 commit 3ef2925
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public interface Policy {

/** Records that the entry was accessed. */
void record(AccessEvent event);
void evict(AccessEvent event);

/** Indicates that the recording has completed. */
default void finished() {}
Expand Down Expand Up @@ -72,6 +73,10 @@ interface KeyOnlyPolicy extends Policy {
@Override default void record(AccessEvent event) {
record(event.key());
}
@Override default void evict(AccessEvent event){
evict(event.key());
}
void record(long key);
void evict(long key);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ public void record(long key) {
if(lookUptable.get(key) != null) {
pipeLineStats.recordOperation();
pipeLineStats.recordHit();
int blockIndex = lookUptable.get(key);
if (pipelinePolicies.get(blockIndex) instanceof KeyOnlyPolicy) {
// Handle the event as a key-only event
((KeyOnlyPolicy) pipelinePolicies.get(blockIndex)).evict(key);
} else {
// Handle the event for a generic policy
AccessEvent event = new AccessEvent(key/* Additional details here */);
pipelinePolicies.get(blockIndex).evict(event);
}

//PROPAGATION

Expand Down Expand Up @@ -149,13 +158,12 @@ public void record(long key) {
}
}

}

@Override
public void evict(long key) {





}
}


@Override
Expand All @@ -172,6 +180,8 @@ public void finished() {
superPolicy.twoQueuePolicy.finished();
}



}


Binary file not shown.
2 changes: 1 addition & 1 deletion simulator/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ caffeine.simulator {
files {
# The paths to the trace files or the file names if in the format's package. To use a mix of
# formats, specify the entry in the form "{format}:{path}", e.g. "lirs:loop.trace.gz".
paths = [ multi1.trace.gz ]
paths = [ esp.trace.gz ]

# arc: format from the authors of the ARC algorithm
# adapt-size: format from the authors of the AdaptSize algorithm
Expand Down

0 comments on commit 3ef2925

Please sign in to comment.