base.hh (13954:2f400a5f2627) | base.hh (14016:265e8272c728) |
---|---|
1/* 2 * Copyright (c) 2011-2013, 2017 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 --- 273 unchanged lines hidden (view full) --- 282 283 /// Given a Thread Context pointer return the thread num 284 int findContext(ThreadContext *tc); 285 286 /// Given a thread num get tho thread context for it 287 virtual ThreadContext *getContext(int tn) { return threadContexts[tn]; } 288 289 /// Get the number of thread contexts available | 1/* 2 * Copyright (c) 2011-2013, 2017 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 --- 273 unchanged lines hidden (view full) --- 282 283 /// Given a Thread Context pointer return the thread num 284 int findContext(ThreadContext *tc); 285 286 /// Given a thread num get tho thread context for it 287 virtual ThreadContext *getContext(int tn) { return threadContexts[tn]; } 288 289 /// Get the number of thread contexts available |
290 unsigned numContexts() { return threadContexts.size(); } | 290 unsigned numContexts() { 291 return static_cast<unsigned>(threadContexts.size()); 292 } |
291 292 /// Convert ContextID to threadID 293 ThreadID contextToThread(ContextID cid) 294 { return static_cast<ThreadID>(cid - threadContexts[0]->contextId()); } 295 296 public: 297 typedef BaseCPUParams Params; 298 const Params *params() const --- 95 unchanged lines hidden (view full) --- 394 /** 395 * Serialize this object to the given output stream. 396 * 397 * @note CPU models should normally overload the serializeThread() 398 * method instead of the serialize() method as this provides a 399 * uniform data format for all CPU models and promotes better code 400 * reuse. 401 * | 293 294 /// Convert ContextID to threadID 295 ThreadID contextToThread(ContextID cid) 296 { return static_cast<ThreadID>(cid - threadContexts[0]->contextId()); } 297 298 public: 299 typedef BaseCPUParams Params; 300 const Params *params() const --- 95 unchanged lines hidden (view full) --- 396 /** 397 * Serialize this object to the given output stream. 398 * 399 * @note CPU models should normally overload the serializeThread() 400 * method instead of the serialize() method as this provides a 401 * uniform data format for all CPU models and promotes better code 402 * reuse. 403 * |
402 * @param os The stream to serialize to. | 404 * @param cp The stream to serialize to. |
403 */ 404 void serialize(CheckpointOut &cp) const override; 405 406 /** 407 * Reconstruct the state of this object from a checkpoint. 408 * 409 * @note CPU models should normally overload the 410 * unserializeThread() method instead of the unserialize() method 411 * as this provides a uniform data format for all CPU models and 412 * promotes better code reuse. 413 414 * @param cp The checkpoint use. | 405 */ 406 void serialize(CheckpointOut &cp) const override; 407 408 /** 409 * Reconstruct the state of this object from a checkpoint. 410 * 411 * @note CPU models should normally overload the 412 * unserializeThread() method instead of the unserialize() method 413 * as this provides a uniform data format for all CPU models and 414 * promotes better code reuse. 415 416 * @param cp The checkpoint use. |
415 * @param section The section name of this object. | |
416 */ 417 void unserialize(CheckpointIn &cp) override; 418 419 /** 420 * Serialize a single thread. 421 * | 417 */ 418 void unserialize(CheckpointIn &cp) override; 419 420 /** 421 * Serialize a single thread. 422 * |
422 * @param os The stream to serialize to. | 423 * @param cp The stream to serialize to. |
423 * @param tid ID of the current thread. 424 */ 425 virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const {}; 426 427 /** 428 * Unserialize one thread. 429 * 430 * @param cp The checkpoint use. | 424 * @param tid ID of the current thread. 425 */ 426 virtual void serializeThread(CheckpointOut &cp, ThreadID tid) const {}; 427 428 /** 429 * Unserialize one thread. 430 * 431 * @param cp The checkpoint use. |
431 * @param section The section name of this thread. | |
432 * @param tid ID of the current thread. 433 */ 434 virtual void unserializeThread(CheckpointIn &cp, ThreadID tid) {}; 435 436 virtual Counter totalInsts() const = 0; 437 438 virtual Counter totalOps() const = 0; 439 --- 214 unchanged lines hidden --- | 432 * @param tid ID of the current thread. 433 */ 434 virtual void unserializeThread(CheckpointIn &cp, ThreadID tid) {}; 435 436 virtual Counter totalInsts() const = 0; 437 438 virtual Counter totalOps() const = 0; 439 --- 214 unchanged lines hidden --- |