#include <interconnect_master.hh>
Inheritance diagram for InterconnectMaster< MemType >:
Public Member Functions | |
InterconnectMaster (const std::string &name, Interconnect *interconnect, MemType *cache, HierParams *hier) | |
MemAccessResult | access (MemReqPtr &req) |
void | request (Tick time) |
void | respond (MemReqPtr &req, Tick time) |
bool | grantData () |
void | deliver (MemReqPtr &req) |
bool | isMaster () |
std::pair< Addr, int > | getTargetAddr () |
int | getTargetId () |
std::string | getCacheName () |
This class is based on the master_interface files in the original M5 memory system but has been rewritten from scratch.
Definition at line 27 of file interconnect_master.hh.
InterconnectMaster< MemType >::InterconnectMaster | ( | const std::string & | name, | |
Interconnect * | interconnect, | |||
MemType * | cache, | |||
HierParams * | hier | |||
) |
This constructor creates a master interface and register it with the associated interconnect. In the terminiology of M5, master is synonymous with 'on the processor side of an interconnect'
name | The name of the interface from the config file | |
interconnect | A pointer to the associated interconnect | |
cache | A pointer to the associated cache | |
hier | Hierarchy parameters for BaseHier |
MemAccessResult InterconnectMaster< MemType >::access | ( | MemReqPtr & | req | ) | [virtual] |
Access the connect memory to perform the given request.
req | The request to perform. |
Implements InterconnectInterface.
Definition at line 36 of file interconnect_master_impl.hh.
void InterconnectMaster< MemType >::deliver | ( | MemReqPtr & | req | ) | [virtual] |
This method delivers the request to the associated cache.
req | The memory request to deliver |
Implements InterconnectInterface.
Definition at line 51 of file interconnect_master_impl.hh.
References InterconnectInterface::interfaceID, and InterconnectInterface::trace_on.
std::string InterconnectMaster< MemType >::getCacheName | ( | ) | [inline, virtual] |
Convenience method that returns the name of the associated cache.
Implements InterconnectInterface.
Definition at line 141 of file interconnect_master.hh.
pair< Addr, int > InterconnectMaster< MemType >::getTargetAddr | ( | ) | [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.
Implements InterconnectInterface.
Definition at line 143 of file interconnect_master_impl.hh.
References Interconnect::getInterconnectID(), and InterconnectInterface::thisInterconnect.
int InterconnectMaster< MemType >::getTargetId | ( | ) | [inline, virtual] |
This method is only valid for slave interfaces and produces a fatal error message if it is called.
Implements InterconnectInterface.
Definition at line 131 of file interconnect_master.hh.
bool InterconnectMaster< MemType >::grantData | ( | ) | [virtual] |
When the interface is granted access to the interconnect, this method is called. It retrieves the request with the highest priority from the cache and provides it to the send method in the interconnect.
Implements InterconnectInterface.
Definition at line 96 of file interconnect_master_impl.hh.
References Interconnect::getInterconnectID(), Interconnect::incNullRequests(), InterconnectInterface::interfaceID, Interconnect::send(), InterconnectInterface::thisInterconnect, InterconnectInterface::trace_on, and InterconnectInterface::updateProfileValues().
bool InterconnectMaster< MemType >::isMaster | ( | ) | [inline, virtual] |
Convenience method that identifies this interface as a master interface.
Implements InterconnectInterface.
Definition at line 106 of file interconnect_master.hh.
void InterconnectMaster< MemType >::request | ( | Tick | time | ) | [virtual] |
Request access to the interconnect at the given time.
time | The time to request the bus. |
Implements InterconnectInterface.
Definition at line 86 of file interconnect_master_impl.hh.
References InterconnectInterface::interfaceID, Interconnect::request(), InterconnectInterface::thisInterconnect, and InterconnectInterface::trace_on.
void InterconnectMaster< MemType >::respond | ( | MemReqPtr & | req, | |
Tick | time | |||
) | [inline, virtual] |
Responses are carried out through the deliver method in the master interface. Consequently, this method exits with an error message if it is called.
req | Not used. | |
time | Not used. |
Implements InterconnectInterface.
Definition at line 80 of file interconnect_master.hh.