Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2007 MIPS Technologies, Inc. |
| 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; |
| 9 | * redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution; |
| 12 | * neither the name of the copyright holders nor the names of its |
| 13 | * contributors may be used to endorse or promote products derived from |
| 14 | * this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | * |
| 28 | * Authors: Korey Sewell |
| 29 | * |
| 30 | */ |
| 31 | |
| 32 | #ifndef __CPU_INORDER_CACHE_UNIT_HH__ |
| 33 | #define __CPU_INORDER_CACHE_UNIT_HH__ |
| 34 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 35 | #include <list> |
| 36 | #include <string> |
Nathan Binkert | 39a0556 | 2011-04-15 10:44:06 -0700 | [diff] [blame^] | 37 | #include <vector> |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 38 | |
Korey Sewell | 3603dd2 | 2009-05-12 15:01:15 -0400 | [diff] [blame] | 39 | #include "arch/predecoder.hh" |
Nathan Binkert | d9f39c8 | 2009-09-23 08:34:21 -0700 | [diff] [blame] | 40 | #include "arch/tlb.hh" |
| 41 | #include "config/the_isa.hh" |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 42 | #include "cpu/inorder/inorder_dyn_inst.hh" |
Nathan Binkert | d9f39c8 | 2009-09-23 08:34:21 -0700 | [diff] [blame] | 43 | #include "cpu/inorder/pipeline_traits.hh" |
| 44 | #include "cpu/inorder/resource.hh" |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 45 | #include "mem/packet.hh" |
| 46 | #include "mem/packet_access.hh" |
| 47 | #include "mem/port.hh" |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 48 | #include "params/InOrderCPU.hh" |
Nathan Binkert | d9f39c8 | 2009-09-23 08:34:21 -0700 | [diff] [blame] | 49 | #include "sim/sim_object.hh" |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 50 | |
| 51 | class CacheRequest; |
| 52 | typedef CacheRequest* CacheReqPtr; |
| 53 | |
| 54 | class CacheReqPacket; |
| 55 | typedef CacheReqPacket* CacheReqPktPtr; |
| 56 | |
Korey Sewell | cf4a00c | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 57 | class CacheUnit : public Resource |
| 58 | { |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 59 | public: |
| 60 | typedef ThePipeline::DynInstPtr DynInstPtr; |
| 61 | |
| 62 | public: |
| 63 | CacheUnit(std::string res_name, int res_id, int res_width, |
| 64 | int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 65 | |
| 66 | enum Command { |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 67 | InitiateReadData, |
| 68 | CompleteReadData, |
| 69 | InitiateWriteData, |
| 70 | CompleteWriteData, |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 71 | InitSecondSplitRead, |
| 72 | InitSecondSplitWrite, |
Korey Sewell | be6724f | 2010-01-31 18:30:43 -0500 | [diff] [blame] | 73 | CompleteSecondSplitRead, |
| 74 | CompleteSecondSplitWrite |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | public: |
| 78 | /** CachePort class for the Cache Unit. Handles doing the |
| 79 | * communication with the cache/memory. |
| 80 | */ |
| 81 | class CachePort : public Port |
| 82 | { |
| 83 | protected: |
| 84 | /** Pointer to cache port unit */ |
| 85 | CacheUnit *cachePortUnit; |
| 86 | |
| 87 | public: |
| 88 | /** Default constructor. */ |
| 89 | CachePort(CacheUnit *_cachePortUnit) |
Korey Sewell | cf4a00c | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 90 | : Port(_cachePortUnit->name() + "-cache-port", |
| 91 | (MemObject*)_cachePortUnit->cpu), |
| 92 | cachePortUnit(_cachePortUnit) |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 93 | { } |
| 94 | |
| 95 | bool snoopRangeSent; |
| 96 | |
| 97 | protected: |
| 98 | /** Atomic version of receive. Panics. */ |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 99 | Tick recvAtomic(PacketPtr pkt); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 100 | |
| 101 | /** Functional version of receive. Panics. */ |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 102 | void recvFunctional(PacketPtr pkt); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 103 | |
| 104 | /** Receives status change. Other than range changing, panics. */ |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 105 | void recvStatusChange(Status status); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 106 | |
| 107 | /** Returns the address ranges of this device. */ |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 108 | void getDeviceAddressRanges(AddrRangeList &resp, |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 109 | AddrRangeList &snoop) |
| 110 | { resp.clear(); snoop.clear(); } |
| 111 | |
| 112 | /** Timing version of receive. Handles setting fetch to the |
| 113 | * proper status to start fetching. */ |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 114 | bool recvTiming(PacketPtr pkt); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 115 | |
| 116 | /** Handles doing a retry of a failed fetch. */ |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 117 | void recvRetry(); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 118 | }; |
| 119 | |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 120 | void init(); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 121 | |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 122 | ResourceRequest* getRequest(DynInstPtr _inst, int stage_num, |
Korey Sewell | ab3d37d | 2011-02-04 00:08:20 -0500 | [diff] [blame] | 123 | int res_idx, int slot_num, |
| 124 | unsigned cmd); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 125 | |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 126 | ResReqPtr findRequest(DynInstPtr inst); |
Korey Sewell | 56ce8ac | 2011-02-04 00:08:21 -0500 | [diff] [blame] | 127 | ResReqPtr findRequest(DynInstPtr inst, int idx); |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 128 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 129 | void requestAgain(DynInstPtr inst, bool &try_request); |
| 130 | |
Korey Sewell | ab3d37d | 2011-02-04 00:08:20 -0500 | [diff] [blame] | 131 | virtual int getSlot(DynInstPtr inst); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 132 | |
Korey Sewell | ab3d37d | 2011-02-04 00:08:20 -0500 | [diff] [blame] | 133 | /** Executes one of the commands from the "Command" enum */ |
| 134 | virtual void execute(int slot_num); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 135 | |
Korey Sewell | ab3d37d | 2011-02-04 00:08:20 -0500 | [diff] [blame] | 136 | virtual void squash(DynInstPtr inst, int stage_num, |
Nathan Binkert | 47877cf | 2009-05-26 09:23:13 -0700 | [diff] [blame] | 137 | InstSeqNum squash_seq_num, ThreadID tid); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 138 | |
Korey Sewell | eac5eac | 2010-01-31 18:26:13 -0500 | [diff] [blame] | 139 | void squashDueToMemStall(DynInstPtr inst, int stage_num, |
| 140 | InstSeqNum squash_seq_num, ThreadID tid); |
| 141 | |
Korey Sewell | 68d962f | 2011-02-04 00:08:22 -0500 | [diff] [blame] | 142 | virtual void squashCacheRequest(CacheReqPtr req_ptr); |
| 143 | |
Korey Sewell | ab3d37d | 2011-02-04 00:08:20 -0500 | [diff] [blame] | 144 | /** After memory request is completedd in the cache, then do final |
| 145 | processing to complete the request in the CPU. |
| 146 | */ |
Korey Sewell | 68d962f | 2011-02-04 00:08:22 -0500 | [diff] [blame] | 147 | virtual void processCacheCompletion(PacketPtr pkt); |
| 148 | |
| 149 | /** Create request that will interface w/TLB and Memory objects */ |
| 150 | virtual void setupMemRequest(DynInstPtr inst, CacheReqPtr cache_req, |
| 151 | int acc_size, int flags); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 152 | |
| 153 | void recvRetry(); |
| 154 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 155 | /** Returns a specific port. */ |
| 156 | Port *getPort(const std::string &if_name, int idx); |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 157 | |
Gabe Black | aa8c6e9 | 2010-08-13 06:16:02 -0700 | [diff] [blame] | 158 | Fault read(DynInstPtr inst, Addr addr, |
| 159 | uint8_t *data, unsigned size, unsigned flags); |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 160 | |
Gabe Black | aa8c6e9 | 2010-08-13 06:16:02 -0700 | [diff] [blame] | 161 | Fault write(DynInstPtr inst, uint8_t *data, unsigned size, |
| 162 | Addr addr, unsigned flags, uint64_t *res); |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 163 | |
Korey Sewell | e396a34 | 2011-02-04 00:09:20 -0500 | [diff] [blame] | 164 | void doTLBAccess(DynInstPtr inst, CacheReqPtr cache_req, int acc_size, |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 165 | int flags, TheISA::TLB::Mode tlb_mode); |
| 166 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 167 | /** Read/Write on behalf of an instruction. |
| 168 | * curResSlot needs to be a valid value in instruction. |
| 169 | */ |
Korey Sewell | e396a34 | 2011-02-04 00:09:20 -0500 | [diff] [blame] | 170 | void doCacheAccess(DynInstPtr inst, uint64_t *write_result=NULL, |
Korey Sewell | f95430d | 2010-06-24 15:34:12 -0400 | [diff] [blame] | 171 | CacheReqPtr split_req=NULL); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 172 | |
| 173 | uint64_t getMemData(Packet *packet); |
| 174 | |
Korey Sewell | 9357e35 | 2010-01-31 18:30:48 -0500 | [diff] [blame] | 175 | void setAddrDependency(DynInstPtr inst); |
Korey Sewell | 68d962f | 2011-02-04 00:08:22 -0500 | [diff] [blame] | 176 | virtual void removeAddrDependency(DynInstPtr inst); |
Korey Sewell | 9357e35 | 2010-01-31 18:30:48 -0500 | [diff] [blame] | 177 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 178 | protected: |
| 179 | /** Cache interface. */ |
| 180 | CachePort *cachePort; |
| 181 | |
Korey Sewell | 82c5a75 | 2010-01-31 18:29:18 -0500 | [diff] [blame] | 182 | bool cachePortBlocked; |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 183 | |
Korey Sewell | 611a864 | 2010-01-31 18:27:12 -0500 | [diff] [blame] | 184 | std::vector<Addr> addrList[ThePipeline::MaxThreads]; |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 185 | |
Korey Sewell | 611a864 | 2010-01-31 18:27:12 -0500 | [diff] [blame] | 186 | std::map<Addr, InstSeqNum> addrMap[ThePipeline::MaxThreads]; |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 187 | |
| 188 | public: |
| 189 | int cacheBlkSize; |
| 190 | |
| 191 | int cacheBlkMask; |
| 192 | |
| 193 | /** Align a PC to the start of the Cache block. */ |
| 194 | Addr cacheBlockAlign(Addr addr) |
| 195 | { |
| 196 | return (addr & ~(cacheBlkMask)); |
| 197 | } |
| 198 | |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 199 | bool tlbBlocked[ThePipeline::MaxThreads]; |
| 200 | |
| 201 | TheISA::TLB* tlb(); |
| 202 | |
| 203 | TheISA::TLB *_tlb; |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 204 | }; |
| 205 | |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 206 | class CacheUnitEvent : public ResourceEvent { |
| 207 | public: |
| 208 | const std::string name() const |
| 209 | { |
| 210 | return "CacheUnitEvent"; |
| 211 | } |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 212 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 213 | |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 214 | /** Constructs a resource event. */ |
| 215 | CacheUnitEvent(); |
| 216 | virtual ~CacheUnitEvent() {} |
| 217 | |
| 218 | /** Processes a resource event. */ |
Korey Sewell | 71b67d4 | 2010-06-24 15:34:19 -0400 | [diff] [blame] | 219 | void process(); |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 220 | }; |
| 221 | |
Korey Sewell | d642267 | 2011-02-18 14:28:30 -0500 | [diff] [blame] | 222 | //@todo: Move into CacheUnit Class for private access to "valid" field |
Korey Sewell | cf4a00c | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 223 | class CacheRequest : public ResourceRequest |
| 224 | { |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 225 | public: |
Korey Sewell | d642267 | 2011-02-18 14:28:30 -0500 | [diff] [blame] | 226 | CacheRequest(CacheUnit *cres) |
| 227 | : ResourceRequest(cres), memReq(NULL), reqData(NULL), |
Korey Sewell | e0a0210 | 2011-02-23 16:30:45 -0500 | [diff] [blame] | 228 | dataPkt(NULL), memAccComplete(false), |
Korey Sewell | d642267 | 2011-02-18 14:28:30 -0500 | [diff] [blame] | 229 | memAccPending(false), tlbStall(false), splitAccess(false), |
| 230 | splitAccessNum(-1), split2ndAccess(false), |
| 231 | fetchBufferFill(false) |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 232 | { } |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 233 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 234 | virtual ~CacheRequest() |
| 235 | { |
Korey Sewell | e0a0210 | 2011-02-23 16:30:45 -0500 | [diff] [blame] | 236 | if (reqData && !splitAccess) |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 237 | delete [] reqData; |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 238 | } |
| 239 | |
Korey Sewell | d642267 | 2011-02-18 14:28:30 -0500 | [diff] [blame] | 240 | void setRequest(DynInstPtr _inst, int stage_num, int res_idx, int slot_num, |
| 241 | unsigned _cmd, MemCmd::Command pkt_cmd, int idx) |
| 242 | { |
| 243 | pktCmd = pkt_cmd; |
| 244 | instIdx = idx; |
| 245 | |
| 246 | ResourceRequest::setRequest(_inst, stage_num, res_idx, slot_num, _cmd); |
| 247 | } |
| 248 | |
| 249 | void clearRequest() |
| 250 | { |
Korey Sewell | e0a0210 | 2011-02-23 16:30:45 -0500 | [diff] [blame] | 251 | if (reqData && !splitAccess) |
Korey Sewell | 8b4b4a1 | 2011-02-18 14:29:17 -0500 | [diff] [blame] | 252 | delete [] reqData; |
Korey Sewell | 8b4b4a1 | 2011-02-18 14:29:17 -0500 | [diff] [blame] | 253 | |
Korey Sewell | d642267 | 2011-02-18 14:28:30 -0500 | [diff] [blame] | 254 | memReq = NULL; |
| 255 | reqData = NULL; |
| 256 | dataPkt = NULL; |
Korey Sewell | d642267 | 2011-02-18 14:28:30 -0500 | [diff] [blame] | 257 | memAccComplete = false; |
| 258 | memAccPending = false; |
| 259 | tlbStall = false; |
| 260 | splitAccess = false; |
| 261 | splitAccessNum = -1; |
| 262 | split2ndAccess = false; |
| 263 | instIdx = 0; |
| 264 | fetchBufferFill = false; |
| 265 | |
| 266 | ResourceRequest::clearRequest(); |
| 267 | } |
| 268 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 269 | virtual PacketDataPtr getData() |
Gabe Black | 672d6a4 | 2010-12-20 16:24:40 -0500 | [diff] [blame] | 270 | { return reqData; } |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 271 | |
Korey Sewell | cf4a00c | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 272 | void |
| 273 | setMemAccCompleted(bool completed = true) |
| 274 | { |
| 275 | memAccComplete = completed; |
| 276 | } |
| 277 | |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 278 | bool is2ndSplit() |
| 279 | { |
| 280 | return split2ndAccess; |
| 281 | } |
| 282 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 283 | bool isMemAccComplete() { return memAccComplete; } |
| 284 | |
| 285 | void setMemAccPending(bool pending = true) { memAccPending = pending; } |
| 286 | bool isMemAccPending() { return memAccPending; } |
| 287 | |
| 288 | //Make this data private/protected! |
| 289 | MemCmd::Command pktCmd; |
| 290 | RequestPtr memReq; |
| 291 | PacketDataPtr reqData; |
Korey Sewell | e0a0210 | 2011-02-23 16:30:45 -0500 | [diff] [blame] | 292 | CacheReqPacket *dataPkt; |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 293 | |
| 294 | bool memAccComplete; |
| 295 | bool memAccPending; |
Korey Sewell | db2b721 | 2009-05-12 15:01:16 -0400 | [diff] [blame] | 296 | bool tlbStall; |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 297 | |
| 298 | bool splitAccess; |
| 299 | int splitAccessNum; |
| 300 | bool split2ndAccess; |
| 301 | int instIdx; |
Korey Sewell | 68d962f | 2011-02-04 00:08:22 -0500 | [diff] [blame] | 302 | |
| 303 | /** Should we expect block from cache access or fetch buffer? */ |
| 304 | bool fetchBufferFill; |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 305 | }; |
| 306 | |
Korey Sewell | cf4a00c | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 307 | class CacheReqPacket : public Packet |
| 308 | { |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 309 | public: |
| 310 | CacheReqPacket(CacheRequest *_req, |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 311 | Command _cmd, short _dest, int _idx = 0) |
| 312 | : Packet(_req->memReq, _cmd, _dest), cacheReq(_req), instIdx(_idx) |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 313 | { |
| 314 | |
| 315 | } |
| 316 | |
| 317 | CacheRequest *cacheReq; |
Korey Sewell | 6939482 | 2010-01-31 18:30:35 -0500 | [diff] [blame] | 318 | int instIdx; |
| 319 | |
Korey Sewell | 973d8b8 | 2009-02-10 15:49:29 -0800 | [diff] [blame] | 320 | }; |
| 321 | |
| 322 | #endif //__CPU_CACHE_UNIT_HH__ |