1/* 2 * Copyright (c) 2004-2006 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; --- 19 unchanged lines hidden (view full) --- 28 * Authors: Kevin Lim 29 * Korey Sewell 30 */ 31 32#include "config/full_system.hh" 33#include "config/use_checker.hh" 34 35#if FULL_SYSTEM |
36#include "cpu/quiesce_event.hh" |
37#include "sim/system.hh" 38#else 39#include "sim/process.hh" 40#endif 41 42#include "cpu/activity.hh" 43#include "cpu/simple_thread.hh" 44#include "cpu/thread_context.hh" --- 744 unchanged lines hidden (view full) --- 789 thread[i]->getTC()->copyArchRegs(temp.getTC()); 790 } 791} 792 793template <class Impl> 794unsigned int 795FullO3CPU<Impl>::drain(Event *drain_event) 796{ |
797 DPRINTF(O3CPU, "Switching out\n"); 798 BaseCPU::switchOut(_sampler); |
799 drainCount = 0; 800 fetch.drain(); 801 decode.drain(); 802 rename.drain(); 803 iew.drain(); 804 commit.drain(); 805 806 // Wake the CPU and record activity so everything can drain out if --- 54 unchanged lines hidden (view full) --- 861} 862 863template <class Impl> 864void 865FullO3CPU<Impl>::switchOut() 866{ 867 fetch.switchOut(); 868 rename.switchOut(); |
869 iew.switchOut(); |
870 commit.switchOut(); 871 instList.clear(); 872 while (!removeList.empty()) { 873 removeList.pop(); 874 } 875 876 _status = SwitchedOut; 877#if USE_CHECKER --- 52 unchanged lines hidden (view full) --- 930 tickEvent.schedule(curTick); 931 } 932 } 933 if (!tickEvent.scheduled()) 934 tickEvent.schedule(curTick); 935} 936 937template <class Impl> |
938void 939FullO3CPU<Impl>::serialize(std::ostream &os) 940{ 941 BaseCPU::serialize(os); 942 nameOut(os, csprintf("%s.tickEvent", name())); 943 tickEvent.serialize(os); 944 945 // Use SimpleThread's ability to checkpoint to make it easier to 946 // write out the registers. Also make this static so it doesn't 947 // get instantiated multiple times (causes a panic in statistics). 948 static CPUExecContext temp; 949 950 for (int i = 0; i < thread.size(); i++) { 951 nameOut(os, csprintf("%s.xc.%i", name(), i)); 952 temp.copyXC(thread[i]->getXCProxy()); 953 temp.serialize(os); 954 } 955} 956 957template <class Impl> 958void 959FullO3CPU<Impl>::unserialize(Checkpoint *cp, const std::string §ion) 960{ 961 BaseCPU::unserialize(cp, section); 962 tickEvent.unserialize(cp, csprintf("%s.tickEvent", section)); 963 964 // Use SimpleThread's ability to checkpoint to make it easier to 965 // read in the registers. Also make this static so it doesn't 966 // get instantiated multiple times (causes a panic in statistics). 967 static CPUExecContext temp; 968 969 for (int i = 0; i < thread.size(); i++) { 970 temp.copyXC(thread[i]->getXCProxy()); 971 temp.unserialize(cp, csprintf("%s.xc.%i", section, i)); 972 thread[i]->getXCProxy()->copyArchRegs(temp.getProxy()); 973 } 974} 975 976template <class Impl> |
977uint64_t 978FullO3CPU<Impl>::readIntReg(int reg_idx) 979{ 980 return regFile.readIntReg(reg_idx); 981} 982 983template <class Impl> 984FloatReg --- 453 unchanged lines hidden --- |