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;

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

44
45#include <cassert>
46
47class Request;
48
49typedef Request* RequestPtr;
50
51
52/** ASI information for this request if it exsits. */
53const uint32_t ASI_BITS = 0x000FF;
54/** The request is a Load locked/store conditional. */
53const unsigned LOCKED = 0x001;
55const uint32_t LOCKED = 0x00100;
56/** The virtual address is also the physical address. */
55const unsigned PHYSICAL = 0x002;
57const uint32_t PHYSICAL = 0x00200;
58/** The request is an ALPHA VPTE pal access (hw_ld). */
57const unsigned VPTE = 0x004;
59const uint32_t VPTE = 0x00400;
60/** Use the alternate mode bits in ALPHA. */
59const unsigned ALTMODE = 0x008;
61const uint32_t ALTMODE = 0x00800;
62/** The request is to an uncacheable address. */
61const unsigned UNCACHEABLE = 0x010;
63const uint32_t UNCACHEABLE = 0x01000;
64/** The request should not cause a page fault. */
63const unsigned NO_FAULT = 0x020;
65const uint32_t NO_FAULT = 0x02000;
66/** The request should be prefetched into the exclusive state. */
65const unsigned PF_EXCLUSIVE = 0x100;
67const uint32_t PF_EXCLUSIVE = 0x10000;
68/** The request should be marked as LRU. */
67const unsigned EVICT_NEXT = 0x200;
69const uint32_t EVICT_NEXT = 0x20000;
70/** The request should ignore unaligned access faults */
69const unsigned NO_ALIGN_FAULT = 0x400;
71const uint32_t NO_ALIGN_FAULT = 0x40000;
72/** The request was an instruction read. */
71const unsigned INST_READ = 0x800;
73const uint32_t INST_READ = 0x80000;
74
75class Request
76{
77 private:
78 /**
79 * The physical address of the request. Valid only if validPaddr
80 * is set. */
81 Addr paddr;

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

92 /**
93 * The time this request was started. Used to calculate
94 * latencies. This field is set to curTick any time paddr or vaddr
95 * is written. */
96 Tick time;
97
98 /** The address space ID. */
99 int asid;
98 /** The ASI is any -- SPARC ONLY */
99 int asi;
100
101 /** This request is to a memory mapped register. */
101 bool mmapedReg;
102 bool mmapedIpr;
103
104 /** The virtual address of the request. */
105 Addr vaddr;
106
107 /** The return value of store conditional. */
108 uint64_t scResult;
109
110 /** The cpu number (for statistics, typically). */

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

165 paddr = _paddr;
166 size = _size;
167 flags = _flags;
168 time = curTick;
169 validPaddr = true;
170 validAsidVaddr = false;
171 validPC = false;
172 validScResult = false;
173 mmapedIpr = false;
174 }
175
176 /**
177 * Set up a virtual (e.g., CPU) request in a previously
178 * allocated Request object. */
179 void setVirt(int _asid, Addr _vaddr, int _size, int _flags, Addr _pc)
180 {
181 asid = _asid;
182 vaddr = _vaddr;
183 size = _size;
184 flags = _flags;
185 pc = _pc;
186 time = curTick;
187 validPaddr = false;
188 validAsidVaddr = true;
189 validPC = true;
190 validScResult = false;
191 mmapedIpr = false;
192 }
193
194 /** Set just the physical address. This should only be used to
195 * record the result of a translation, and thus the vaddr must be
196 * valid before this method is called. Otherwise, use setPhys()
197 * to guarantee that the size and flags are also set.
198 */
199 void setPaddr(Addr _paddr)

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

219
220 /** Accessor function for vaddr.*/
221 Addr getVaddr() { assert(validAsidVaddr); return vaddr; }
222
223 /** Accessor function for asid.*/
224 int getAsid() { assert(validAsidVaddr); return asid; }
225
226 /** Accessor function for asi.*/
224 int getAsi() { assert(validAsidVaddr); return asi; }
227 uint8_t getAsi() { assert(validAsidVaddr); return flags & ASI_BITS; }
228
229 /** Accessor function for asi.*/
226 void setAsi(int a) { assert(validAsidVaddr); asi = a; }
230 void setAsi(uint8_t a)
231 { assert(validAsidVaddr); flags = (flags & ~ASI_BITS) | a; }
232
233 /** Accessor function for asi.*/
229 bool getMmapedReg() { assert(validPaddr); return mmapedReg; }
234 bool isMmapedIpr() { assert(validPaddr); return mmapedIpr; }
235
236 /** Accessor function for asi.*/
231 void setMmapedReg(bool r) { assert(validPaddr); mmapedReg = r; }
237 void setMmapedIpr(bool r) { assert(validPaddr); mmapedIpr = r; }
238
239 /** Accessor function to check if sc result is valid. */
240 bool scResultValid() { return validScResult; }
241 /** Accessor function for store conditional return value.*/
242 uint64_t getScResult() { assert(validScResult); return scResult; }
243 /** Accessor function for store conditional return value.*/
244 void setScResult(uint64_t _scResult)
245 { scResult = _scResult; validScResult = true; }

--- 20 unchanged lines hidden ---