Deleted Added
sdiff udiff text old ( 3349:fec4a86fa212 ) new ( 3719:23ca579a363a )
full compact
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 28 unchanged lines hidden (view full) ---

37
38#ifndef __CACHE_HH__
39#define __CACHE_HH__
40
41#include "base/misc.hh" // fatal, panic, and warn
42#include "cpu/smt.hh" // SMT_MAX_THREADS
43
44#include "mem/cache/base_cache.hh"
45#include "mem/cache/prefetch/prefetcher.hh"
46
47//Forward decleration
48class MSHR;
49
50
51/**
52 * A template-policy based cache. The behavior of the cache can be altered by
53 * supplying different template policies. TagStore handles all tag and data
54 * storage @sa TagStore. Buffering handles all misses and writes/writebacks
55 * @sa MissQueue. Coherence handles all coherence policy details @sa
56 * UniCoherence, SimpleMultiCoherence.
57 */
58template <class TagStore, class Buffering, class Coherence>
59class Cache : public BaseCache
60{
61 public:
62 /** Define the type of cache block to use. */
63 typedef typename TagStore::BlkType BlkType;
64
65 bool prefetchAccess;
66 protected:
67
68 /** Tag and data Storage */
69 TagStore *tags;
70 /** Miss and Writeback handler */
71 Buffering *missQueue;
72 /** Coherence protocol. */
73 Coherence *coherence;
74
75 /** Prefetcher */
76 Prefetcher<TagStore, Buffering> *prefetcher;
77
78 /**
79 * The clock ratio of the outgoing bus.
80 * Used for calculating critical word first.
81 */
82 int busRatio;
83
84 /**

--- 15 unchanged lines hidden (view full) ---

100 Request *invalidateReq;
101
102 public:
103
104 class Params
105 {
106 public:
107 TagStore *tags;
108 Buffering *missQueue;
109 Coherence *coherence;
110 BaseCache::Params baseParams;
111 Prefetcher<TagStore, Buffering> *prefetcher;
112 bool prefetchAccess;
113 int hitLatency;
114
115 Params(TagStore *_tags, Buffering *mq, Coherence *coh,
116 BaseCache::Params params,
117 Prefetcher<TagStore, Buffering> *_prefetcher,
118 bool prefetch_access, int hit_latency)
119 : tags(_tags), missQueue(mq), coherence(coh),
120 baseParams(params),
121 prefetcher(_prefetcher), prefetchAccess(prefetch_access),
122 hitLatency(hit_latency)
123 {
124 }
125 };

--- 116 unchanged lines hidden ---