request.hh (6221:58a3c04e6344) | request.hh (6223:3623155c0e95) |
---|---|
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; --- 138 unchanged lines hidden (view full) --- 147 /** Private flags for field validity checking. */ 148 PrivateFlags privateFlags; 149 150 /** 151 * The time this request was started. Used to calculate 152 * latencies. This field is set to curTick any time paddr or vaddr 153 * is written. 154 */ | 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; --- 138 unchanged lines hidden (view full) --- 147 /** Private flags for field validity checking. */ 148 PrivateFlags privateFlags; 149 150 /** 151 * The time this request was started. Used to calculate 152 * latencies. This field is set to curTick any time paddr or vaddr 153 * is written. 154 */ |
155 Tick time; | 155 Tick _time; |
156 157 /** The address space ID. */ 158 int asid; 159 160 /** The virtual address of the request. */ 161 Addr vaddr; 162 163 /** --- 19 unchanged lines hidden (view full) --- 183 * just physical address, size, flags, and timestamp (to curTick). 184 * These fields are adequate to perform a request. 185 */ 186 Request(Addr paddr, int size, Flags flags) 187 { 188 setPhys(paddr, size, flags); 189 } 190 | 156 157 /** The address space ID. */ 158 int asid; 159 160 /** The virtual address of the request. */ 161 Addr vaddr; 162 163 /** --- 19 unchanged lines hidden (view full) --- 183 * just physical address, size, flags, and timestamp (to curTick). 184 * These fields are adequate to perform a request. 185 */ 186 Request(Addr paddr, int size, Flags flags) 187 { 188 setPhys(paddr, size, flags); 189 } 190 |
191 Request(Addr paddr, int size, Flags flags, Tick time) 192 { 193 setPhys(paddr, size, flags, time); 194 } 195 |
|
191 Request(int asid, Addr vaddr, int size, Flags flags, Addr pc, 192 int cid, ThreadID tid) 193 { 194 setVirt(asid, vaddr, size, flags, pc); 195 setThreadContext(cid, tid); 196 } 197 198 ~Request() {} // for FastAlloc --- 9 unchanged lines hidden (view full) --- 208 privateFlags.set(VALID_CONTEXT_ID|VALID_THREAD_ID); 209 } 210 211 /** 212 * Set up a physical (e.g. device) request in a previously 213 * allocated Request object. 214 */ 215 void | 196 Request(int asid, Addr vaddr, int size, Flags flags, Addr pc, 197 int cid, ThreadID tid) 198 { 199 setVirt(asid, vaddr, size, flags, pc); 200 setThreadContext(cid, tid); 201 } 202 203 ~Request() {} // for FastAlloc --- 9 unchanged lines hidden (view full) --- 213 privateFlags.set(VALID_CONTEXT_ID|VALID_THREAD_ID); 214 } 215 216 /** 217 * Set up a physical (e.g. device) request in a previously 218 * allocated Request object. 219 */ 220 void |
216 setPhys(Addr _paddr, int _size, Flags _flags) | 221 setPhys(Addr _paddr, int _size, Flags _flags, Tick time) |
217 { 218 assert(_size >= 0); 219 paddr = _paddr; 220 size = _size; | 222 { 223 assert(_size >= 0); 224 paddr = _paddr; 225 size = _size; |
221 time = curTick; | 226 _time = time; |
222 223 flags.clear(~STICKY_FLAGS); 224 flags.set(_flags); 225 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 226 privateFlags.set(VALID_PADDR|VALID_SIZE); 227 } 228 | 227 228 flags.clear(~STICKY_FLAGS); 229 flags.set(_flags); 230 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 231 privateFlags.set(VALID_PADDR|VALID_SIZE); 232 } 233 |
234 void 235 setPhys(Addr _paddr, int _size, Flags _flags) 236 { 237 setPhys(_paddr, _size, _flags, curTick); 238 } 239 |
|
229 /** 230 * Set up a virtual (e.g., CPU) request in a previously 231 * allocated Request object. 232 */ 233 void 234 setVirt(int _asid, Addr _vaddr, int _size, Flags _flags, Addr _pc) 235 { 236 assert(_size >= 0); 237 asid = _asid; 238 vaddr = _vaddr; 239 size = _size; 240 flags = _flags; 241 pc = _pc; | 240 /** 241 * Set up a virtual (e.g., CPU) request in a previously 242 * allocated Request object. 243 */ 244 void 245 setVirt(int _asid, Addr _vaddr, int _size, Flags _flags, Addr _pc) 246 { 247 assert(_size >= 0); 248 asid = _asid; 249 vaddr = _vaddr; 250 size = _size; 251 flags = _flags; 252 pc = _pc; |
242 time = curTick; | 253 _time = curTick; |
243 244 flags.clear(~STICKY_FLAGS); 245 flags.set(_flags); 246 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 247 privateFlags.set(VALID_VADDR|VALID_SIZE|VALID_PC); 248 } 249 250 /** --- 57 unchanged lines hidden (view full) --- 308 getSize() 309 { 310 assert(privateFlags.isSet(VALID_SIZE)); 311 return size; 312 } 313 314 /** Accessor for time. */ 315 Tick | 254 255 flags.clear(~STICKY_FLAGS); 256 flags.set(_flags); 257 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 258 privateFlags.set(VALID_VADDR|VALID_SIZE|VALID_PC); 259 } 260 261 /** --- 57 unchanged lines hidden (view full) --- 319 getSize() 320 { 321 assert(privateFlags.isSet(VALID_SIZE)); 322 return size; 323 } 324 325 /** Accessor for time. */ 326 Tick |
316 getTime() | 327 time() const |
317 { 318 assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR)); | 328 { 329 assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR)); |
319 return time; | 330 return _time; |
320 } 321 | 331 } 332 |
333 void 334 time(Tick time) 335 { 336 assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR)); 337 _time = time; 338 } 339 |
|
322 /** Accessor for flags. */ 323 Flags 324 getFlags() 325 { 326 assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR)); 327 return flags; 328 } 329 --- 134 unchanged lines hidden --- | 340 /** Accessor for flags. */ 341 Flags 342 getFlags() 343 { 344 assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR)); 345 return flags; 346 } 347 --- 134 unchanged lines hidden --- |