io_device.cc (3090:3cced9156352) io_device.cc (3091:dba513d68c16)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32#include "base/chunk_generator.hh"
33#include "base/trace.hh"
34#include "dev/io_device.hh"
35#include "sim/builder.hh"
36#include "sim/system.hh"
37
38
39PioPort::PioPort(PioDevice *dev, System *s, std::string pname)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32#include "base/chunk_generator.hh"
33#include "base/trace.hh"
34#include "dev/io_device.hh"
35#include "sim/builder.hh"
36#include "sim/system.hh"
37
38
39PioPort::PioPort(PioDevice *dev, System *s, std::string pname)
40 : SimpleTimingPort(dev->name() + pname), device(dev), sys(s)
40 : SimpleTimingPort(dev->name() + pname), device(dev)
41{ }
42
43
44Tick
45PioPort::recvAtomic(Packet *pkt)
46{
41{ }
42
43
44Tick
45PioPort::recvAtomic(Packet *pkt)
46{
47 return device->recvAtomic(pkt);
47 return pkt->isRead() ? device->read(pkt) : device->write(pkt);
48}
49
50void
48}
49
50void
51PioPort::recvFunctional(Packet *pkt)
52{
53 device->recvAtomic(pkt);
54}
55
56void
57PioPort::getDeviceAddressRanges(AddrRangeList &resp, AddrRangeList &snoop)
58{
59 snoop.clear();
60 device->addressRanges(resp);
61}
62
63
51PioPort::getDeviceAddressRanges(AddrRangeList &resp, AddrRangeList &snoop)
52{
53 snoop.clear();
54 device->addressRanges(resp);
55}
56
57
64bool
65PioPort::recvTiming(Packet *pkt)
66{
67 if (pkt->result == Packet::Nacked) {
68 resendNacked(pkt);
69 } else {
70 Tick latency = device->recvAtomic(pkt);
71 // turn packet around to go back to requester
72 pkt->makeTimingResponse();
73 sendTiming(pkt, latency);
74 }
75 return true;
76}
77
78PioDevice::~PioDevice()
79{
80 if (pioPort)
81 delete pioPort;
82}
83
84void
85PioDevice::init()

--- 200 unchanged lines hidden ---
58PioDevice::~PioDevice()
59{
60 if (pioPort)
61 delete pioPort;
62}
63
64void
65PioDevice::init()

--- 200 unchanged lines hidden ---