From 64ccfecf9579abbe553ed1825dcaead9a3daa34f Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Mon, 28 Nov 2011 04:34:18 -0500 Subject: SPARC: Fixing a minor copy-paste bug using the wrong variable There was a bug in the mm_disk implementation where a copy paste error resulted in the d32 variable not being initialised (as it incorrectly was used instead of d16), and gcc 4.5 complaining. --HG-- extra : rebase_source : 9515e87b188b9eac189da8034cb13c3bf7d9e20b --- src/dev/sparc/mm_disk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dev') 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): -- cgit v1.2.3 From fa753c14549a768f0b8475e4e183acbdc394c248 Mon Sep 17 00:00:00 2001 From: Mitchell Hayenga Date: Thu, 1 Dec 2011 00:15:22 -0800 Subject: Device: Make changes necessary to support a coherent page walker cache. Adds the flag 'recvSnoops' which enables pagewalkers using DmaPorts, to properly configure snoops. --HG-- extra : rebase_source : 64207bef62c3268ddff2236ee4adae873812325f --- src/dev/io_device.cc | 12 ++++++++++-- src/dev/io_device.hh | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 7 deletions(-) (limited to 'src/dev') diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index 5e2395bf9..5c13b5091 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 812c276d6..36787c13e 100644 --- a/src/dev/io_device.hh +++ b/src/dev/io_device.hh @@ -130,20 +130,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(); @@ -152,7 +177,8 @@ class DmaPort : public Port EventWrapper 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); -- cgit v1.2.3 From 5bde1d359f0a0ce1d5ed46c3a9bb0ba33882f7b6 Mon Sep 17 00:00:00 2001 From: Chris Emmons Date: Thu, 1 Dec 2011 00:15:25 -0800 Subject: Output: Add hierarchical output support and cleanup existing codebase. --HG-- extra : rebase_source : 3301137733cdf5fdb471d56ef7990e7a3a865442 --- src/dev/terminal.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/dev') 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); } -- cgit v1.2.3