request.hh (10568:e70523bd0d26) | request.hh (10653:e3fc6bc7f97e) |
---|---|
1/* 2 * Copyright (c) 2012-2013 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 184 unchanged lines hidden (view full) --- 193 static const PrivateFlagsType VALID_EXTRA_DATA = 0x00000080; 194 195 /** These flags are *not* cleared when a Request object is reused 196 (assigned a new address). */ 197 static const PrivateFlagsType STICKY_PRIVATE_FLAGS = 198 VALID_CONTEXT_ID | VALID_THREAD_ID; 199 200 private: | 1/* 2 * Copyright (c) 2012-2013 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 184 unchanged lines hidden (view full) --- 193 static const PrivateFlagsType VALID_EXTRA_DATA = 0x00000080; 194 195 /** These flags are *not* cleared when a Request object is reused 196 (assigned a new address). */ 197 static const PrivateFlagsType STICKY_PRIVATE_FLAGS = 198 VALID_CONTEXT_ID | VALID_THREAD_ID; 199 200 private: |
201 |
|
201 /** | 202 /** |
203 * Set up a physical (e.g. device) request in a previously 204 * allocated Request object. 205 */ 206 void 207 setPhys(Addr paddr, unsigned size, Flags flags, MasterID mid, Tick time) 208 { 209 assert(size >= 0); 210 _paddr = paddr; 211 _size = size; 212 _time = time; 213 _masterId = mid; 214 _flags.clear(~STICKY_FLAGS); 215 _flags.set(flags); 216 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 217 privateFlags.set(VALID_PADDR|VALID_SIZE); 218 depth = 0; 219 accessDelta = 0; 220 //translateDelta = 0; 221 } 222 223 /** |
|
202 * The physical address of the request. Valid only if validPaddr 203 * is set. 204 */ 205 Addr _paddr; 206 207 /** 208 * The size of the request. This field must be set when vaddr or 209 * paddr is written via setVirt() or setPhys(), so it is always 210 * valid as long as one of the address fields is valid. 211 */ | 224 * The physical address of the request. Valid only if validPaddr 225 * is set. 226 */ 227 Addr _paddr; 228 229 /** 230 * The size of the request. This field must be set when vaddr or 231 * paddr is written via setVirt() or setPhys(), so it is always 232 * valid as long as one of the address fields is valid. 233 */ |
212 int _size; | 234 unsigned _size; |
213 214 /** The requestor ID which is unique in the system for all ports 215 * that are capable of issuing a transaction 216 */ 217 MasterID _masterId; 218 219 /** Flag structure for the request. */ 220 Flags _flags; --- 28 unchanged lines hidden (view full) --- 249 int _contextId; 250 /** The thread ID (id within this CPU) */ 251 int _threadId; 252 253 /** program counter of initiating access; for tracing/debugging */ 254 Addr _pc; 255 256 public: | 235 236 /** The requestor ID which is unique in the system for all ports 237 * that are capable of issuing a transaction 238 */ 239 MasterID _masterId; 240 241 /** Flag structure for the request. */ 242 Flags _flags; --- 28 unchanged lines hidden (view full) --- 271 int _contextId; 272 /** The thread ID (id within this CPU) */ 273 int _threadId; 274 275 /** program counter of initiating access; for tracing/debugging */ 276 Addr _pc; 277 278 public: |
257 /** Minimal constructor. No fields are initialized. 258 * (Note that _flags and privateFlags are cleared by Flags 259 * default constructor.) | 279 280 /** 281 * Minimal constructor. No fields are initialized. (Note that 282 * _flags and privateFlags are cleared by Flags default 283 * constructor.) |
260 */ 261 Request() 262 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 263 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 264 _extraData(0), _contextId(0), _threadId(0), _pc(0), 265 translateDelta(0), accessDelta(0), depth(0) 266 {} 267 268 /** 269 * Constructor for physical (e.g. device) requests. Initializes 270 * just physical address, size, flags, and timestamp (to curTick()). | 284 */ 285 Request() 286 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 287 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 288 _extraData(0), _contextId(0), _threadId(0), _pc(0), 289 translateDelta(0), accessDelta(0), depth(0) 290 {} 291 292 /** 293 * Constructor for physical (e.g. device) requests. Initializes 294 * just physical address, size, flags, and timestamp (to curTick()). |
271 * These fields are adequate to perform a request. | 295 * These fields are adequate to perform a request. |
272 */ | 296 */ |
273 Request(Addr paddr, int size, Flags flags, MasterID mid) | 297 Request(Addr paddr, unsigned size, Flags flags, MasterID mid) |
274 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 275 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 276 _extraData(0), _contextId(0), _threadId(0), _pc(0), 277 translateDelta(0), accessDelta(0), depth(0) 278 { | 298 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 299 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 300 _extraData(0), _contextId(0), _threadId(0), _pc(0), 301 translateDelta(0), accessDelta(0), depth(0) 302 { |
279 setPhys(paddr, size, flags, mid); | 303 setPhys(paddr, size, flags, mid, curTick()); |
280 } 281 | 304 } 305 |
282 Request(Addr paddr, int size, Flags flags, MasterID mid, Tick time) | 306 Request(Addr paddr, unsigned size, Flags flags, MasterID mid, Tick time) |
283 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 284 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 285 _extraData(0), _contextId(0), _threadId(0), _pc(0), 286 translateDelta(0), accessDelta(0), depth(0) 287 { 288 setPhys(paddr, size, flags, mid, time); 289 } 290 | 307 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 308 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 309 _extraData(0), _contextId(0), _threadId(0), _pc(0), 310 translateDelta(0), accessDelta(0), depth(0) 311 { 312 setPhys(paddr, size, flags, mid, time); 313 } 314 |
291 Request(Addr paddr, int size, Flags flags, MasterID mid, Tick time, Addr pc) | 315 Request(Addr paddr, unsigned size, Flags flags, MasterID mid, Tick time, 316 Addr pc) |
292 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 293 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 294 _extraData(0), _contextId(0), _threadId(0), _pc(0), 295 translateDelta(0), accessDelta(0), depth(0) 296 { 297 setPhys(paddr, size, flags, mid, time); 298 privateFlags.set(VALID_PC); 299 _pc = pc; 300 } 301 | 317 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 318 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 319 _extraData(0), _contextId(0), _threadId(0), _pc(0), 320 translateDelta(0), accessDelta(0), depth(0) 321 { 322 setPhys(paddr, size, flags, mid, time); 323 privateFlags.set(VALID_PC); 324 _pc = pc; 325 } 326 |
302 Request(int asid, Addr vaddr, int size, Flags flags, MasterID mid, Addr pc, | 327 Request(int asid, Addr vaddr, unsigned size, Flags flags, MasterID mid, 328 Addr pc, |
303 int cid, ThreadID tid) 304 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 305 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 306 _extraData(0), _contextId(0), _threadId(0), _pc(0), 307 translateDelta(0), accessDelta(0), depth(0) 308 { 309 setVirt(asid, vaddr, size, flags, mid, pc); 310 setThreadContext(cid, tid); --- 8 unchanged lines hidden (view full) --- 319 setThreadContext(int context_id, ThreadID tid) 320 { 321 _contextId = context_id; 322 _threadId = tid; 323 privateFlags.set(VALID_CONTEXT_ID|VALID_THREAD_ID); 324 } 325 326 /** | 329 int cid, ThreadID tid) 330 : _paddr(0), _size(0), _masterId(invldMasterId), _time(0), 331 _taskId(ContextSwitchTaskId::Unknown), _asid(0), _vaddr(0), 332 _extraData(0), _contextId(0), _threadId(0), _pc(0), 333 translateDelta(0), accessDelta(0), depth(0) 334 { 335 setVirt(asid, vaddr, size, flags, mid, pc); 336 setThreadContext(cid, tid); --- 8 unchanged lines hidden (view full) --- 345 setThreadContext(int context_id, ThreadID tid) 346 { 347 _contextId = context_id; 348 _threadId = tid; 349 privateFlags.set(VALID_CONTEXT_ID|VALID_THREAD_ID); 350 } 351 352 /** |
327 * Set up a physical (e.g. device) request in a previously 328 * allocated Request object. 329 */ 330 void 331 setPhys(Addr paddr, int size, Flags flags, MasterID mid, Tick time) 332 { 333 assert(size >= 0); 334 _paddr = paddr; 335 _size = size; 336 _time = time; 337 _masterId = mid; 338 _flags.clear(~STICKY_FLAGS); 339 _flags.set(flags); 340 privateFlags.clear(~STICKY_PRIVATE_FLAGS); 341 privateFlags.set(VALID_PADDR|VALID_SIZE); 342 depth = 0; 343 accessDelta = 0; 344 //translateDelta = 0; 345 } 346 347 void 348 setPhys(Addr paddr, int size, Flags flags, MasterID mid) 349 { 350 setPhys(paddr, size, flags, mid, curTick()); 351 } 352 353 /** | |
354 * Set up a virtual (e.g., CPU) request in a previously 355 * allocated Request object. 356 */ 357 void | 353 * Set up a virtual (e.g., CPU) request in a previously 354 * allocated Request object. 355 */ 356 void |
358 setVirt(int asid, Addr vaddr, int size, Flags flags, MasterID mid, Addr pc) | 357 setVirt(int asid, Addr vaddr, unsigned size, Flags flags, MasterID mid, 358 Addr pc) |
359 { 360 assert(size >= 0); 361 _asid = asid; 362 _vaddr = vaddr; 363 _size = size; 364 _masterId = mid; 365 _pc = pc; 366 _time = curTick(); --- 25 unchanged lines hidden (view full) --- 392 * Generate two requests as if this request had been split into two 393 * pieces. The original request can't have been translated already. 394 */ 395 void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2) 396 { 397 assert(privateFlags.isSet(VALID_VADDR)); 398 assert(privateFlags.noneSet(VALID_PADDR)); 399 assert(split_addr > _vaddr && split_addr < _vaddr + _size); | 359 { 360 assert(size >= 0); 361 _asid = asid; 362 _vaddr = vaddr; 363 _size = size; 364 _masterId = mid; 365 _pc = pc; 366 _time = curTick(); --- 25 unchanged lines hidden (view full) --- 392 * Generate two requests as if this request had been split into two 393 * pieces. The original request can't have been translated already. 394 */ 395 void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2) 396 { 397 assert(privateFlags.isSet(VALID_VADDR)); 398 assert(privateFlags.noneSet(VALID_PADDR)); 399 assert(split_addr > _vaddr && split_addr < _vaddr + _size); |
400 req1 = new Request; 401 *req1 = *this; 402 req2 = new Request; 403 *req2 = *this; | 400 req1 = new Request(*this); 401 req2 = new Request(*this); |
404 req1->_size = split_addr - _vaddr; 405 req2->_vaddr = split_addr; 406 req2->_size = _size - req1->_size; 407 } 408 409 /** 410 * Accessor for paddr. 411 */ --- 245 unchanged lines hidden --- | 402 req1->_size = split_addr - _vaddr; 403 req2->_vaddr = split_addr; 404 req2->_size = _size - req1->_size; 405 } 406 407 /** 408 * Accessor for paddr. 409 */ --- 245 unchanged lines hidden --- |