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; --- 33 unchanged lines hidden (view full) --- 42 43#include <list> 44#include <inttypes.h> 45 46#include "base/misc.hh" 47#include "base/range.hh" 48#include "mem/packet.hh" 49#include "mem/request.hh" |
50#include "sim/eventq.hh" |
51 52/** This typedef is used to clean up the parameter list of 53 * getDeviceAddressRanges() and getPeerAddressRanges(). It's declared 54 * outside the Port object since it's also used by some mem objects. 55 * Eventually we should move this typedef to wherever Addr is 56 * defined. 57 */ 58 59typedef std::list<Range<Addr> > AddrRangeList; 60typedef std::list<Range<Addr> >::iterator AddrRangeIter; 61 |
62class EventQueue; |
63class MemObject; 64 65/** 66 * Ports are used to interface memory objects to 67 * each other. They will always come in pairs, and we refer to the other 68 * port object as the peer. These are used to make the design more 69 * modular so that a specific interface between every type of objcet doesn't 70 * have to be created. 71 * 72 * Recv accesor functions are being called from the peer interface. 73 * Send accessor functions are being called from the device the port is 74 * associated with, and it will call the peer recv. accessor function. 75 */ |
76class Port : public EventManager |
77{ 78 protected: 79 /** Descriptive name (for DPRINTF output) */ 80 mutable std::string portName; 81 82 /** A pointer to the peer port. Ports always come in pairs, that way they 83 can use a standardized interface to communicate between different 84 memory objects. */ 85 Port *peer; 86 87 /** A pointer to the MemObject that owns this port. This may not be set. */ 88 MemObject *owner; 89 90 public: |
91 /** 92 * Constructor. 93 * 94 * @param _name Port name for DPRINTF output. Should include name 95 * of memory system object to which the port belongs. 96 * @param _owner Pointer to the MemObject that owns this port. 97 * Will not necessarily be set. 98 */ |
99 Port(const std::string &_name, MemObject *_owner); |
100 101 /** Return port name (for DPRINTF). */ 102 const std::string &name() const { return portName; } 103 104 virtual ~Port(); 105 106 // mey be better to use subclasses & RTTI? 107 /** Holds the ports status. Currently just that a range recomputation needs --- 7 unchanged lines hidden (view full) --- 115 116 /** Function to set the pointer for the peer port. */ 117 virtual void setPeer(Port *port); 118 119 /** Function to get the pointer to the peer port. */ 120 Port *getPeer() { return peer; } 121 122 /** Function to set the owner of this port. */ |
123 void setOwner(MemObject *_owner); |
124 125 /** Function to return the owner of this port. */ 126 MemObject *getOwner() { return owner; } 127 128 /** Inform the peer port to delete itself and notify it's owner about it's 129 * demise. */ 130 void removeConn(); 131 --- 171 unchanged lines hidden --- |