request.hh (3804:fa7a01dddc7a) request.hh (3806:65ae5388c059)
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
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;
52/** The request is a Load locked/store conditional. */
54/** The request is a Load locked/store conditional. */
53const unsigned LOCKED = 0x001;
55const uint32_t LOCKED = 0x00100;
54/** The virtual address is also the physical address. */
56/** The virtual address is also the physical address. */
55const unsigned PHYSICAL = 0x002;
57const uint32_t PHYSICAL = 0x00200;
56/** The request is an ALPHA VPTE pal access (hw_ld). */
58/** The request is an ALPHA VPTE pal access (hw_ld). */
57const unsigned VPTE = 0x004;
59const uint32_t VPTE = 0x00400;
58/** Use the alternate mode bits in ALPHA. */
60/** Use the alternate mode bits in ALPHA. */
59const unsigned ALTMODE = 0x008;
61const uint32_t ALTMODE = 0x00800;
60/** The request is to an uncacheable address. */
62/** The request is to an uncacheable address. */
61const unsigned UNCACHEABLE = 0x010;
63const uint32_t UNCACHEABLE = 0x01000;
62/** The request should not cause a page fault. */
64/** The request should not cause a page fault. */
63const unsigned NO_FAULT = 0x020;
65const uint32_t NO_FAULT = 0x02000;
64/** The request should be prefetched into the exclusive state. */
66/** The request should be prefetched into the exclusive state. */
65const unsigned PF_EXCLUSIVE = 0x100;
67const uint32_t PF_EXCLUSIVE = 0x10000;
66/** The request should be marked as LRU. */
68/** The request should be marked as LRU. */
67const unsigned EVICT_NEXT = 0x200;
69const uint32_t EVICT_NEXT = 0x20000;
68/** The request should ignore unaligned access faults */
70/** The request should ignore unaligned access faults */
69const unsigned NO_ALIGN_FAULT = 0x400;
71const uint32_t NO_ALIGN_FAULT = 0x40000;
70/** The request was an instruction read. */
72/** The request was an instruction read. */
71const unsigned INST_READ = 0x800;
73const uint32_t INST_READ = 0x80000;
72
73class Request
74{
75 private:
76 /**
77 * The physical address of the request. Valid only if validPaddr
78 * is set. */
79 Addr paddr;

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

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

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

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

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

216
217 /** Accessor function for vaddr.*/
218 Addr getVaddr() { assert(validAsidVaddr); return vaddr; }
219
220 /** Accessor function for asid.*/
221 int getAsid() { assert(validAsidVaddr); return asid; }
222
223 /** Accessor function for asi.*/
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
225 /** Accessor function for asi.*/
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; }
227
228 /** Accessor function for asi.*/
232
233 /** Accessor function for asi.*/
229 bool getMmapedReg() { assert(validPaddr); return mmapedReg; }
234 bool isMmapedIpr() { assert(validPaddr); return mmapedIpr; }
235
230 /** Accessor function for asi.*/
236 /** Accessor function for asi.*/
231 void setMmapedReg(bool r) { assert(validPaddr); mmapedReg = r; }
237 void setMmapedIpr(bool r) { assert(validPaddr); mmapedIpr = r; }
232
233 /** Accessor function to check if sc result is valid. */
234 bool scResultValid() { return validScResult; }
235 /** Accessor function for store conditional return value.*/
236 uint64_t getScResult() { assert(validScResult); return scResult; }
237 /** Accessor function for store conditional return value.*/
238 void setScResult(uint64_t _scResult)
239 { scResult = _scResult; validScResult = true; }

--- 20 unchanged lines hidden ---
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 ---