diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2012-01-07 02:15:35 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2012-01-07 02:15:35 -0800 |
commit | ec936364b7238cddea7734ea79c6e04b52a683c6 (patch) | |
tree | 788fc19c3ba599d6f39d3990769888a0650be5ff /src/dev | |
parent | 36a822f08e88483b41af214ace4fd3dccf3aa8cb (diff) | |
parent | 9b52717a92ed9592bd98a41683509f538262a5c7 (diff) | |
download | gem5-ec936364b7238cddea7734ea79c6e04b52a683c6.tar.xz |
Merge with the main repository again.
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/io_device.cc | 12 | ||||
-rw-r--r-- | src/dev/io_device.hh | 36 | ||||
-rw-r--r-- | src/dev/sparc/mm_disk.cc | 2 | ||||
-rw-r--r-- | src/dev/terminal.cc | 3 |
4 files changed, 45 insertions, 8 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index 62e4a9c37..942b835f0 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -115,11 +115,13 @@ BasicPioDevice::addressRanges(AddrRangeList &range_list) } -DmaPort::DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff) +DmaPort::DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff, + bool recv_snoops) : Port(dev->name() + "-dmaport", dev), device(dev), sys(s), pendingCount(0), actionInProgress(0), drainEvent(NULL), backoffTime(0), minBackoffDelay(min_backoff), - maxBackoffDelay(max_backoff), inRetry(false), backoffEvent(this) + maxBackoffDelay(max_backoff), inRetry(false), recvSnoops(recv_snoops), + snoopRangeSent(false), backoffEvent(this) { } bool @@ -141,6 +143,12 @@ DmaPort::recvTiming(PacketPtr pkt) pkt->reinitNacked(); queueDma(pkt, true); } else if (pkt->senderState) { + if (recvSnoops) { + if (pkt->isRequest()) { + return true; + } + } + DmaReqState *state; backoffTime >>= 2; diff --git a/src/dev/io_device.hh b/src/dev/io_device.hh index a92402bfe..083ab43cb 100644 --- a/src/dev/io_device.hh +++ b/src/dev/io_device.hh @@ -129,20 +129,45 @@ class DmaPort : public Port * it is that it's sending. */ bool inRetry; + /** Port accesses a cache which requires snooping */ + bool recvSnoops; + + /** Records snoop response so we only reply once to a status change */ + bool snoopRangeSent; + virtual bool recvTiming(PacketPtr pkt); virtual Tick recvAtomic(PacketPtr pkt) - { panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN } + { + if (recvSnoops) return 0; + + panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN + } virtual void recvFunctional(PacketPtr pkt) - { panic("dma port shouldn't be used for pio access."); } + { + if (recvSnoops) return; + + panic("dma port shouldn't be used for pio access."); + } virtual void recvStatusChange(Status status) - { ; } + { + if (recvSnoops) { + if (status == RangeChange) { + if (!snoopRangeSent) { + snoopRangeSent = true; + sendStatusChange(Port::RangeChange); + } + return; + } + panic("Unexpected recvStatusChange\n"); + } + } virtual void recvRetry() ; virtual void getDeviceAddressRanges(AddrRangeList &resp, bool &snoop) - { resp.clear(); snoop = false; } + { resp.clear(); snoop = recvSnoops; } void queueDma(PacketPtr pkt, bool front = false); void sendDma(); @@ -151,7 +176,8 @@ class DmaPort : public Port EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent; public: - DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff); + DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff, + bool recv_snoops = false); void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag = 0); diff --git a/src/dev/sparc/mm_disk.cc b/src/dev/sparc/mm_disk.cc index b86905387..1921f6d96 100644 --- a/src/dev/sparc/mm_disk.cc +++ b/src/dev/sparc/mm_disk.cc @@ -83,7 +83,7 @@ MmDisk::read(PacketPtr pkt) break; case sizeof(uint16_t): memcpy(&d16, diskData + (accessAddr % SectorSize), 2); - pkt->set(htobe(d32)); + pkt->set(htobe(d16)); DPRINTF(IdeDisk, "reading word %#x value= %#x\n", accessAddr, d16); break; case sizeof(uint32_t): diff --git a/src/dev/terminal.cc b/src/dev/terminal.cc index bae4c9194..74d5ddde7 100644 --- a/src/dev/terminal.cc +++ b/src/dev/terminal.cc @@ -102,6 +102,9 @@ Terminal::Terminal(const Params *p) { if (p->output) { outfile = simout.find(p->name); + if (!outfile) + outfile = simout.create(p->name); + outfile->setf(ios::unitbuf); } |