Merge zizzer.eecs.umich.edu:/z/m5/Bitkeeper/newmem

into  zizzer.eecs.umich.edu:/.automount/zooks/y/ksewell/research/m5-sim/newmem-o3

--HG--
extra : convert_revision : f97469b7d19c82deb3d068f80546d729757c25e3
This commit is contained in:
Korey Sewell 2006-07-07 15:58:22 -04:00
commit 743737c28b
8 changed files with 44 additions and 25 deletions

View file

@ -75,6 +75,8 @@ else:
cpu = AtomicSimpleCPU() cpu = AtomicSimpleCPU()
cpu.workload = process cpu.workload = process
cpu.mem = magicbus cpu.mem = magicbus
cpu.icache_port=magicbus.port
cpu.dcache_port=magicbus.port
system = System(physmem = mem, cpu = cpu) system = System(physmem = mem, cpu = cpu)
mem.port = magicbus.port mem.port = magicbus.port

View file

@ -63,7 +63,7 @@ BaseCPU::BaseCPU(Params *p)
params(p), number_of_threads(p->numberOfThreads), system(p->system) params(p), number_of_threads(p->numberOfThreads), system(p->system)
#else #else
BaseCPU::BaseCPU(Params *p) BaseCPU::BaseCPU(Params *p)
: SimObject(p->name), clock(p->clock), params(p), : MemObject(p->name), clock(p->clock), params(p),
number_of_threads(p->numberOfThreads), system(p->system) number_of_threads(p->numberOfThreads), system(p->system)
#endif #endif
{ {

View file

@ -37,15 +37,16 @@
#include "base/statistics.hh" #include "base/statistics.hh"
#include "config/full_system.hh" #include "config/full_system.hh"
#include "sim/eventq.hh" #include "sim/eventq.hh"
#include "sim/sim_object.hh" #include "mem/mem_object.hh"
#include "arch/isa_traits.hh" #include "arch/isa_traits.hh"
class BranchPred; class BranchPred;
class CheckerCPU; class CheckerCPU;
class ThreadContext; class ThreadContext;
class System; class System;
class Port;
class BaseCPU : public SimObject class BaseCPU : public MemObject
{ {
protected: protected:
// CPU's clock period in terms of the number of ticks of curTime. // CPU's clock period in terms of the number of ticks of curTime.

View file

@ -55,18 +55,28 @@ AtomicSimpleCPU::TickEvent::description()
return "AtomicSimpleCPU tick event"; return "AtomicSimpleCPU tick event";
} }
Port *
AtomicSimpleCPU::getPort(const std::string &if_name, int idx)
{
if (if_name == "dcache_port")
return &dcachePort;
else if (if_name == "icache_port")
return &icachePort;
else
panic("No Such Port\n");
}
void void
AtomicSimpleCPU::init() AtomicSimpleCPU::init()
{ {
//Create Memory Ports (conect them up) //Create Memory Ports (conect them up)
Port *mem_dport = mem->getPort(""); // Port *mem_dport = mem->getPort("");
dcachePort.setPeer(mem_dport); // dcachePort.setPeer(mem_dport);
mem_dport->setPeer(&dcachePort); // mem_dport->setPeer(&dcachePort);
Port *mem_iport = mem->getPort(""); // Port *mem_iport = mem->getPort("");
icachePort.setPeer(mem_iport); // icachePort.setPeer(mem_iport);
mem_iport->setPeer(&icachePort); // mem_iport->setPeer(&icachePort);
BaseCPU::init(); BaseCPU::init();
#if FULL_SYSTEM #if FULL_SYSTEM

View file

@ -122,6 +122,8 @@ class AtomicSimpleCPU : public BaseSimpleCPU
public: public:
virtual Port *getPort(const std::string &if_name, int idx = -1);
virtual void serialize(std::ostream &os); virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section); virtual void unserialize(Checkpoint *cp, const std::string &section);

View file

@ -37,19 +37,20 @@
using namespace std; using namespace std;
using namespace TheISA; using namespace TheISA;
Port *
TimingSimpleCPU::getPort(const std::string &if_name, int idx)
{
if (if_name == "dcache_port")
return &dcachePort;
else if (if_name == "icache_port")
return &icachePort;
else
panic("No Such Port\n");
}
void void
TimingSimpleCPU::init() TimingSimpleCPU::init()
{ {
//Create Memory Ports (conect them up)
Port *mem_dport = mem->getPort("");
dcachePort.setPeer(mem_dport);
mem_dport->setPeer(&dcachePort);
Port *mem_iport = mem->getPort("");
icachePort.setPeer(mem_iport);
mem_iport->setPeer(&icachePort);
BaseCPU::init(); BaseCPU::init();
#if FULL_SYSTEM #if FULL_SYSTEM
for (int i = 0; i < threadContexts.size(); ++i) { for (int i = 0; i < threadContexts.size(); ++i) {
@ -451,12 +452,7 @@ TimingSimpleCPU::completeIfetch(Packet *pkt)
bool bool
TimingSimpleCPU::IcachePort::recvTiming(Packet *pkt) TimingSimpleCPU::IcachePort::recvTiming(Packet *pkt)
{ {
if (cpu->_status == DcacheWaitResponse) cpu->completeIfetch(pkt);
cpu->completeDataAccess(pkt);
else if (cpu->_status == IcacheWaitResponse)
cpu->completeIfetch(pkt);
else
assert("OOPS" && 0);
return true; return true;
} }

View file

@ -130,6 +130,8 @@ class TimingSimpleCPU : public BaseSimpleCPU
public: public:
virtual Port *getPort(const std::string &if_name, int idx = -1);
virtual void serialize(std::ostream &os); virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section); virtual void unserialize(Checkpoint *cp, const std::string &section);

View file

@ -144,7 +144,13 @@ BaseCache::getPort(const std::string &if_name, int idx)
cpuSidePort = new CachePort(name() + "-cpu_side_port", this, true); cpuSidePort = new CachePort(name() + "-cpu_side_port", this, true);
return cpuSidePort; return cpuSidePort;
} }
if (if_name == "functional") else if (if_name == "functional")
{
if(cpuSidePort == NULL)
cpuSidePort = new CachePort(name() + "-cpu_side_port", this, true);
return cpuSidePort;
}
else if (if_name == "cpu_side")
{ {
if(cpuSidePort == NULL) if(cpuSidePort == NULL)
cpuSidePort = new CachePort(name() + "-cpu_side_port", this, true); cpuSidePort = new CachePort(name() + "-cpu_side_port", this, true);