types.hh (10537:47fe87b0cf97) | types.hh (10905:a6ca6831e775) |
---|---|
1/* 2 * Copyright (c) 2010 Gabe Black 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; --- 27 unchanged lines hidden (view full) --- 36#include "base/trace.hh" 37#include "base/types.hh" 38#include "sim/serialize.hh" 39 40namespace GenericISA 41{ 42 43// The guaranteed interface. | 1/* 2 * Copyright (c) 2010 Gabe Black 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; --- 27 unchanged lines hidden (view full) --- 36#include "base/trace.hh" 37#include "base/types.hh" 38#include "sim/serialize.hh" 39 40namespace GenericISA 41{ 42 43// The guaranteed interface. |
44class PCStateBase | 44class PCStateBase : public Serializable |
45{ 46 protected: 47 Addr _pc; 48 Addr _npc; 49 50 PCStateBase() : _pc(0), _npc(0) {} 51 PCStateBase(Addr val) : _pc(0), _npc(0) { set(val); } 52 --- 47 unchanged lines hidden (view full) --- 100 101 bool 102 operator != (const PCStateBase &opc) const 103 { 104 return !(*this == opc); 105 } 106 107 void | 45{ 46 protected: 47 Addr _pc; 48 Addr _npc; 49 50 PCStateBase() : _pc(0), _npc(0) {} 51 PCStateBase(Addr val) : _pc(0), _npc(0) { set(val); } 52 --- 47 unchanged lines hidden (view full) --- 100 101 bool 102 operator != (const PCStateBase &opc) const 103 { 104 return !(*this == opc); 105 } 106 107 void |
108 serialize(std::ostream &os) | 108 serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE |
109 { 110 SERIALIZE_SCALAR(_pc); 111 SERIALIZE_SCALAR(_npc); 112 } 113 114 void | 109 { 110 SERIALIZE_SCALAR(_pc); 111 SERIALIZE_SCALAR(_npc); 112 } 113 114 void |
115 unserialize(Checkpoint *cp, const std::string §ion) | 115 unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE |
116 { 117 UNSERIALIZE_SCALAR(_pc); 118 UNSERIALIZE_SCALAR(_npc); 119 } 120}; 121 122 123/* --- 119 unchanged lines hidden (view full) --- 243 244 bool 245 operator != (const UPCState<MachInst> &opc) const 246 { 247 return !(*this == opc); 248 } 249 250 void | 116 { 117 UNSERIALIZE_SCALAR(_pc); 118 UNSERIALIZE_SCALAR(_npc); 119 } 120}; 121 122 123/* --- 119 unchanged lines hidden (view full) --- 243 244 bool 245 operator != (const UPCState<MachInst> &opc) const 246 { 247 return !(*this == opc); 248 } 249 250 void |
251 serialize(std::ostream &os) | 251 serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE |
252 { | 252 { |
253 Base::serialize(os); | 253 Base::serialize(cp); |
254 SERIALIZE_SCALAR(_upc); 255 SERIALIZE_SCALAR(_nupc); 256 } 257 258 void | 254 SERIALIZE_SCALAR(_upc); 255 SERIALIZE_SCALAR(_nupc); 256 } 257 258 void |
259 unserialize(Checkpoint *cp, const std::string §ion) | 259 unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE |
260 { | 260 { |
261 Base::unserialize(cp, section); | 261 Base::unserialize(cp); |
262 UNSERIALIZE_SCALAR(_upc); 263 UNSERIALIZE_SCALAR(_nupc); 264 } 265}; 266 267template <class MachInst> 268std::ostream & 269operator<<(std::ostream & os, const UPCState<MachInst> &pc) --- 54 unchanged lines hidden (view full) --- 324 325 bool 326 operator != (const DelaySlotPCState<MachInst> &opc) const 327 { 328 return !(*this == opc); 329 } 330 331 void | 262 UNSERIALIZE_SCALAR(_upc); 263 UNSERIALIZE_SCALAR(_nupc); 264 } 265}; 266 267template <class MachInst> 268std::ostream & 269operator<<(std::ostream & os, const UPCState<MachInst> &pc) --- 54 unchanged lines hidden (view full) --- 324 325 bool 326 operator != (const DelaySlotPCState<MachInst> &opc) const 327 { 328 return !(*this == opc); 329 } 330 331 void |
332 serialize(std::ostream &os) | 332 serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE |
333 { | 333 { |
334 Base::serialize(os); | 334 Base::serialize(cp); |
335 SERIALIZE_SCALAR(_nnpc); 336 } 337 338 void | 335 SERIALIZE_SCALAR(_nnpc); 336 } 337 338 void |
339 unserialize(Checkpoint *cp, const std::string §ion) | 339 unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE |
340 { | 340 { |
341 Base::unserialize(cp, section); | 341 Base::unserialize(cp); |
342 UNSERIALIZE_SCALAR(_nnpc); 343 } 344}; 345 346template <class MachInst> 347std::ostream & 348operator<<(std::ostream & os, const DelaySlotPCState<MachInst> &pc) 349{ --- 71 unchanged lines hidden (view full) --- 421 422 bool 423 operator != (const DelaySlotUPCState<MachInst> &opc) const 424 { 425 return !(*this == opc); 426 } 427 428 void | 342 UNSERIALIZE_SCALAR(_nnpc); 343 } 344}; 345 346template <class MachInst> 347std::ostream & 348operator<<(std::ostream & os, const DelaySlotPCState<MachInst> &pc) 349{ --- 71 unchanged lines hidden (view full) --- 421 422 bool 423 operator != (const DelaySlotUPCState<MachInst> &opc) const 424 { 425 return !(*this == opc); 426 } 427 428 void |
429 serialize(std::ostream &os) | 429 serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE |
430 { | 430 { |
431 Base::serialize(os); | 431 Base::serialize(cp); |
432 SERIALIZE_SCALAR(_upc); 433 SERIALIZE_SCALAR(_nupc); 434 } 435 436 void | 432 SERIALIZE_SCALAR(_upc); 433 SERIALIZE_SCALAR(_nupc); 434 } 435 436 void |
437 unserialize(Checkpoint *cp, const std::string §ion) | 437 unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE |
438 { | 438 { |
439 Base::unserialize(cp, section); | 439 Base::unserialize(cp); |
440 UNSERIALIZE_SCALAR(_upc); 441 UNSERIALIZE_SCALAR(_nupc); 442 } 443}; 444 445template <class MachInst> 446std::ostream & 447operator<<(std::ostream & os, const DelaySlotUPCState<MachInst> &pc) 448{ 449 ccprintf(os, "(%#x=>%#x=>%#x).(%d=>%d)", 450 pc.pc(), pc.npc(), pc.nnpc(), pc.upc(), pc.nupc()); 451 return os; 452} 453 454} 455 456#endif | 440 UNSERIALIZE_SCALAR(_upc); 441 UNSERIALIZE_SCALAR(_nupc); 442 } 443}; 444 445template <class MachInst> 446std::ostream & 447operator<<(std::ostream & os, const DelaySlotUPCState<MachInst> &pc) 448{ 449 ccprintf(os, "(%#x=>%#x=>%#x).(%d=>%d)", 450 pc.pc(), pc.npc(), pc.nnpc(), pc.upc(), pc.nupc()); 451 return os; 452} 453 454} 455 456#endif |