Deleted Added
sdiff udiff text old ( 5489:94a7bb476fca ) new ( 5494:85c8d296c1cb )
full compact
1/*
2 * Copyright (c) 2002-2005 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;

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

82 memory objects. */
83 Port *peer;
84
85 /** A pointer to the MemObject that owns this port. This may not be set. */
86 MemObject *owner;
87
88 public:
89
90 /**
91 * Constructor.
92 *
93 * @param _name Port name for DPRINTF output. Should include name
94 * of memory system object to which the port belongs.
95 * @param _owner Pointer to the MemObject that owns this port.
96 */
97 Port(const std::string &_name, MemObject *_owner, Port *_peer = NULL);
98
99 /** Return port name (for DPRINTF). */
100 const std::string &name() const { return portName; }
101
102 virtual ~Port();
103
104 // mey be better to use subclasses & RTTI?
105 /** Holds the ports status. Currently just that a range recomputation needs
106 * to be done. */
107 enum Status {
108 RangeChange
109 };
110
111 /** Function to set the pointer for the peer port. */
112 virtual void setPeer(Port *port);
113
114 /** Function to get the pointer to the peer port. */
115 Port *getPeer() { return peer; }
116
117 /** Function to return the owner of this port. */
118 MemObject *getOwner() { return owner; }
119
120 /** Notify my peer port that I'm disconnecting (by calling its
121 * disconnect() method) so it can clean up. */
122 void disconnectFromPeer();
123
124 virtual bool isDefaultPort() const { return false; }
125
126 bool isConnected() { return peer && !peer->isDefaultPort(); }
127
128 protected:
129
130 /** These functions are protected because they should only be

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

240 */
241 void printAddr(Addr a);
242
243 private:
244
245 /** Internal helper function for read/writeBlob().
246 */
247 void blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd);
248
249 /** Receive notification that my peer is disconnecting and clean
250 * up (potentially deleting myself in the process). Should be
251 * called only from peer's disconnectFromPeer(). */
252 void disconnect();
253};
254
255/** A simple functional port that is only meant for one way communication to
256 * physical memory. It is only meant to be used to load data into memory before
257 * the simulation begins.
258 */
259
260class FunctionalPort : public Port

--- 39 unchanged lines hidden ---