#include <interconnect_interface.hh>
Inheritance diagram for InterconnectInterface:
Public Member Functions | |
InterconnectInterface (Interconnect *_interconnect, const std::string &name, HierParams *hier) | |
void | setBlocked () |
void | clearBlocked () |
virtual MemAccessResult | access (MemReqPtr &req)=0 |
virtual void | request (Tick time)=0 |
virtual void | respond (MemReqPtr &req, Tick time)=0 |
bool | grantAddr () |
virtual bool | grantData ()=0 |
void | snoop (MemReqPtr &req) |
void | snoopResponse (MemReqPtr &req) |
void | snoopResponseCall (MemReqPtr &req) |
Tick | sendProbe (MemReqPtr &req, bool update) |
Tick | probe (MemReqPtr &req, bool update) |
void | collectRanges (std::list< Range< Addr > > &range_list) |
void | getRange (std::list< Range< Addr > > &range_list) |
void | rangeChange () |
void | setAddrRange (std::list< Range< Addr > > &range_list) |
void | addAddrRange (const Range< Addr > &range) |
void | getSendSample (int *dataSends, int *instSends, int *coherenceSends, int *totalSends) |
void | updateProfileValues (MemReqPtr &req) |
virtual void | deliver (MemReqPtr &req)=0 |
virtual bool | isMaster ()=0 |
virtual std::pair< Addr, int > | getTargetAddr ()=0 |
virtual int | getTargetId ()=0 |
virtual std::string | getCacheName ()=0 |
Protected Attributes | |
int | interfaceID |
Interconnect * | thisInterconnect |
bool | trace_on |
int | dataSends |
int | instSends |
int | coherenceSends |
int | totalSends |
bool | doProfiling |
This class is based on the bus_interface.hh class in standard M5 but has been rewritten from scratch. Consequently, a number of methods that are not used are not implemented.
Definition at line 25 of file interconnect_interface.hh.
InterconnectInterface::InterconnectInterface | ( | Interconnect * | _interconnect, | |
const std::string & | name, | |||
HierParams * | hier | |||
) | [inline] |
This constructor creates an interconnect interface and initialises a few member variables.
_interconnect | A pointer to the interface this class interfaces to. | |
name | The name of the class from the config file | |
hier | Hierarchy parameters for BaseHier |
Definition at line 50 of file interconnect_interface.hh.
References coherenceSends, dataSends, doProfiling, instSends, thisInterconnect, totalSends, and trace_on.
virtual MemAccessResult InterconnectInterface::access | ( | MemReqPtr & | req | ) | [pure virtual] |
Access the connected memory and make it perform a given request.
req | The request to perform. |
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
void InterconnectInterface::addAddrRange | ( | const Range< Addr > & | range | ) |
Add an address range for this interface.
range | The addres range to add. |
Definition at line 50 of file interconnect_interface.cc.
References rangeChange().
void InterconnectInterface::clearBlocked | ( | ) |
Mark this interface as unblocked.
Definition at line 18 of file interconnect_interface.cc.
References Interconnect::clearBlocked(), interfaceID, and thisInterconnect.
void InterconnectInterface::collectRanges | ( | std::list< Range< Addr > > & | range_list | ) | [inline] |
This method is never called in the configuration used in this work and is not implemented.
range_list | Not used |
Definition at line 183 of file interconnect_interface.hh.
virtual void InterconnectInterface::deliver | ( | MemReqPtr & | req | ) | [pure virtual] |
This method delivers a reponse to the interconnect. In a slave interconnect, this sends the request over the interconnect. In a master interconnect, the request is delivered to the cache.
req | The request that will be delivered |
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
virtual std::string InterconnectInterface::getCacheName | ( | ) | [pure virtual] |
Convenience method that returns the name of the cache associated with a given interface.
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
void InterconnectInterface::getRange | ( | std::list< Range< Addr > > & | range_list | ) |
Adds the address ranges of this interface to the provided list.
range_list | The list of ranges. |
Definition at line 26 of file interconnect_interface.cc.
void InterconnectInterface::getSendSample | ( | int * | dataSends, | |
int * | instSends, | |||
int * | coherenceSends, | |||
int * | totalSends | |||
) |
This method returns the number of requests sent since the last time it was called. Furthermore, it divides the sends into data sends, instruction sends and coherence sends as well as providing a grand total.
dataSends | A pointer a memory location where the number of data sends can be stored | |
instSends | A pointer a memory location where the number of instruction sends can be stored | |
instSends | A pointer a memory location where the number of coherence sends can be stored | |
totalSends | A pointer a memory location where the total number of sends can be stored |
Definition at line 56 of file interconnect_interface.cc.
References coherenceSends, dataSends, doProfiling, instSends, and totalSends.
virtual std::pair<Addr, int> InterconnectInterface::getTargetAddr | ( | ) | [pure virtual] |
This method accesses the cache and finds out which interface the next request should be sent to. Then, it returns a pair of the address and the destination interface.
Note that the destination interface might be -1. In this case, the interconnect must find the destination itself by inspecting the destination address.
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
virtual int InterconnectInterface::getTargetId | ( | ) | [pure virtual] |
This method returns the ID of the destination interface of the request at the front of the request queue in a slave interface.
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
bool InterconnectInterface::grantAddr | ( | ) | [inline] |
This method must be implemented to fit into the the rest of the M5 memory system. In this implemetation it is never used and issues a fatal error message if it is called.
Definition at line 107 of file interconnect_interface.hh.
virtual bool InterconnectInterface::grantData | ( | ) | [pure virtual] |
This method is used when an interface is granted access to the bus.
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
virtual bool InterconnectInterface::isMaster | ( | ) | [pure virtual] |
The interconnects often need to distinguish between a master and a slave interface in an efficient manner. This method enables this.
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
Tick InterconnectInterface::probe | ( | MemReqPtr & | req, | |
bool | update | |||
) | [inline] |
This method is never called with the configurations used in this work. Consequently, it is not used.
req | Not used. | |
update | Not used. |
Definition at line 172 of file interconnect_interface.hh.
void InterconnectInterface::rangeChange | ( | ) |
Notify this interface of a range change in the interconnect.
Definition at line 34 of file interconnect_interface.cc.
References Interconnect::rangeChange(), and thisInterconnect.
Referenced by addAddrRange().
virtual void InterconnectInterface::request | ( | Tick | time | ) | [pure virtual] |
Request access to the interconnect.
time | The time to request the bus. |
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
virtual void InterconnectInterface::respond | ( | MemReqPtr & | req, | |
Tick | time | |||
) | [pure virtual] |
Respond to the given request at the given time.
req | The request being responded to. | |
time | The time the response is ready. |
Implemented in InterconnectMaster< MemType >, and InterconnectSlave< MemType >.
Tick InterconnectInterface::sendProbe | ( | MemReqPtr & | req, | |
bool | update | |||
) | [inline] |
This method is never called with the configurations used in this work. Consequently, it is not used.
req | Not used. | |
update | Not used. |
Definition at line 158 of file interconnect_interface.hh.
void InterconnectInterface::setAddrRange | ( | std::list< Range< Addr > > & | range_list | ) |
Set the address ranges of this interface to the list provided. This function removes any existing ranges.
range_list | List of addr ranges to add. |
void InterconnectInterface::setBlocked | ( | ) |
Mark this interface as blocked.
Definition at line 10 of file interconnect_interface.cc.
References interfaceID, Interconnect::setBlocked(), and thisInterconnect.
void InterconnectInterface::snoop | ( | MemReqPtr & | req | ) | [inline] |
The interconnects does not support snooping, so this method issues a fatal error message if it is called.
req | Not used |
Definition at line 125 of file interconnect_interface.hh.
void InterconnectInterface::snoopResponse | ( | MemReqPtr & | req | ) | [inline] |
The interconnects does not support snooping, so this method issues a fatal error message if it is called.
req | Not used |
Definition at line 135 of file interconnect_interface.hh.
void InterconnectInterface::snoopResponseCall | ( | MemReqPtr & | req | ) | [inline] |
The interconnects does not support snooping, so this method issues a fatal error message if it is called.
req | Not used |
Definition at line 145 of file interconnect_interface.hh.
void InterconnectInterface::updateProfileValues | ( | MemReqPtr & | req | ) |
This method ensures that the profile values are updated consistently from all interfaces. It is called by the subclasses.
req | The current memory request |
Definition at line 78 of file interconnect_interface.cc.
References coherenceSends, dataSends, doProfiling, instSends, and totalSends.
Referenced by InterconnectSlave< MemType >::grantData(), and InterconnectMaster< MemType >::grantData().