From abc76f20cb98c90e8dab416dd16dfd4a954013ba Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 23 Jul 2007 21:51:38 -0700 Subject: Major changes to how SimObjects are created and initialized. Almost all creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed --- src/dev/io_device.cc | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/dev/io_device.cc') diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index be5756ab7..657739e2c 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -32,7 +32,6 @@ #include "base/chunk_generator.hh" #include "base/trace.hh" #include "dev/io_device.hh" -#include "sim/builder.hh" #include "sim/system.hh" @@ -55,6 +54,10 @@ PioPort::getDeviceAddressRanges(AddrRangeList &resp, bool &snoop) } +PioDevice::PioDevice(const Params *p) + : MemObject(p), platform(p->platform), sys(p->system), pioPort(NULL) +{} + PioDevice::~PioDevice() { if (pioPort) @@ -82,6 +85,11 @@ PioDevice::drain(Event *de) return count; } +BasicPioDevice::BasicPioDevice(const Params *p) + : PioDevice(p), pioAddr(p->pio_addr), pioSize(0), + pioDelay(p->pio_latency) +{} + void BasicPioDevice::addressRanges(AddrRangeList &range_list) { @@ -149,7 +157,7 @@ DmaPort::recvTiming(PacketPtr pkt) return true; } -DmaDevice::DmaDevice(Params *p) +DmaDevice::DmaDevice(const Params *p) : PioDevice(p), dmaPort(NULL), minBackoffDelay(p->min_backoff_delay), maxBackoffDelay(p->max_backoff_delay) { } @@ -262,8 +270,8 @@ DmaPort::sendDma() assert(transmitList.size()); PacketPtr pkt = transmitList.front(); - System::MemoryMode state = sys->getMemoryMode(); - if (state == System::Timing) { + Enums::MemoryMode state = sys->getMemoryMode(); + if (state == Enums::timing) { if (backoffEvent.scheduled() || inRetry) { DPRINTF(DMA, "Can't send immediately, waiting for retry or backoff timer\n"); return; @@ -290,7 +298,7 @@ DmaPort::sendDma() backoffTime+curTick); backoffEvent.schedule(backoffTime+curTick); } - } else if (state == System::Atomic) { + } else if (state == Enums::atomic) { transmitList.pop_front(); Tick lat; @@ -330,5 +338,3 @@ DmaDevice::~DmaDevice() if (dmaPort) delete dmaPort; } - - -- cgit v1.2.3