diff options
Diffstat (limited to 'cpu')
-rw-r--r-- | cpu/simple/cpu.cc | 20 | ||||
-rw-r--r-- | cpu/simple/cpu.hh | 1 |
2 files changed, 11 insertions, 10 deletions
diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc index d188074d4..8a9e41d53 100644 --- a/cpu/simple/cpu.cc +++ b/cpu/simple/cpu.cc @@ -86,6 +86,15 @@ SimpleCPU::TickEvent::TickEvent(SimpleCPU *c, int w) void SimpleCPU::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(); #if FULL_SYSTEM for (int i = 0; i < execContexts.size(); ++i) { @@ -146,20 +155,11 @@ SimpleCPU::CpuPort::recvRetry() } SimpleCPU::SimpleCPU(Params *p) - : BaseCPU(p), icachePort(this), + : BaseCPU(p), mem(p->mem), icachePort(this), dcachePort(this), tickEvent(this, p->width), cpuXC(NULL) { _status = Idle; - //Create Memory Ports (conect them up) - Port *mem_dport = p->mem->getPort(); - dcachePort.setPeer(mem_dport); - mem_dport->setPeer(&dcachePort); - - Port *mem_iport = p->mem->getPort(); - icachePort.setPeer(mem_iport); - mem_iport->setPeer(&icachePort); - #if FULL_SYSTEM cpuXC = new CPUExecContext(this, 0, p->system, p->itb, p->dtb, p->mem); #else diff --git a/cpu/simple/cpu.hh b/cpu/simple/cpu.hh index dc07027f9..43287a33b 100644 --- a/cpu/simple/cpu.hh +++ b/cpu/simple/cpu.hh @@ -105,6 +105,7 @@ class SimpleCPU : public BaseCPU virtual Packet *recvRetry(); }; + MemObject *mem; CpuPort icachePort; CpuPort dcachePort; |