tport.hh (2914:2c524dc023d2) tport.hh (3090:3cced9156352)
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;

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

71#include "mem/port.hh"
72#include "sim/eventq.hh"
73#include <list>
74#include <string>
75
76class SimpleTimingPort : public Port
77{
78 protected:
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;

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

71#include "mem/port.hh"
72#include "sim/eventq.hh"
73#include <list>
74#include <string>
75
76class SimpleTimingPort : public Port
77{
78 protected:
79 /** A list of outgoing timing response packets that haven't been serviced
80 * yet. */
79 /** A list of outgoing timing response packets that haven't been
80 * serviced yet. */
81 std::list<Packet*> transmitList;
82 /**
81 std::list<Packet*> transmitList;
82 /**
83 * This class is used to implemented sendTiming() with a delay. When a delay
84 * is requested a new event is created. When the event time expires it
85 * attempts to send the packet. If it cannot, the packet is pushed onto the
86 * transmit list to be sent when recvRetry() is called. */
83 * This class is used to implemented sendTiming() with a delay. When
84 * a delay is requested a new event is created. When the event time
85 * expires it attempts to send the packet. If it cannot, the packet
86 * is pushed onto the transmit list to be sent when recvRetry() is
87 * called. */
87 class SendEvent : public Event
88 {
89 SimpleTimingPort *port;
90 Packet *packet;
91
88 class SendEvent : public Event
89 {
90 SimpleTimingPort *port;
91 Packet *packet;
92
93 public:
92 SendEvent(SimpleTimingPort *p, Packet *pkt, Tick t)
93 : Event(&mainEventQueue), port(p), packet(pkt)
94 { setFlags(AutoDelete); schedule(curTick + t); }
95
96 virtual void process();
97
98 virtual const char *description()
99 { return "Future scheduled sendTiming event"; }
94 SendEvent(SimpleTimingPort *p, Packet *pkt, Tick t)
95 : Event(&mainEventQueue), port(p), packet(pkt)
96 { setFlags(AutoDelete); schedule(curTick + t); }
97
98 virtual void process();
99
100 virtual const char *description()
101 { return "Future scheduled sendTiming event"; }
100
101 friend class SimpleTimingPort;
102 };
103
104
105 /** Number of timing requests that are emulating the device timing before
106 * attempting to end up on the bus.
107 */
108 int outTiming;
109

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

122 void resendNacked(Packet *pkt);
123 public:
124
125 SimpleTimingPort(std::string pname)
126 : Port(pname), outTiming(0), drainEvent(NULL)
127 {}
128
129 unsigned int drain(Event *de);
102 };
103
104
105 /** Number of timing requests that are emulating the device timing before
106 * attempting to end up on the bus.
107 */
108 int outTiming;
109

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

122 void resendNacked(Packet *pkt);
123 public:
124
125 SimpleTimingPort(std::string pname)
126 : Port(pname), outTiming(0), drainEvent(NULL)
127 {}
128
129 unsigned int drain(Event *de);
130
131 friend class SimpleTimingPort::SendEvent;
132};
133
134#endif // __MEM_TPORT_HH__
130};
131
132#endif // __MEM_TPORT_HH__