Interconnect Class Reference

#include <interconnect.hh>

Inheritance diagram for Interconnect:

Butterfly Crossbar IdealInterconnect SplitTransBus List of all members.

Public Member Functions

 Interconnect (const std::string &_name, int _width, int _clock, int _transDelay, int _arbDelay, int _cpu_count, HierParams *_hier)
 ~Interconnect ()
void registerProfiler (InterconnectProfile *_profiler)
void regStats ()
void resetStats ()
int registerInterface (InterconnectInterface *interface, bool isL2, int processorID)
void rangeChange ()
void incNullRequests ()
int getInterconnectID (int processorID)
void getSendSample (int *dataSends, int *instSends, int *coherenceSends, int *totalSends)
int getTarget (Addr address)
virtual void request (Tick time, int fromID)=0
virtual void send (MemReqPtr &req, Tick time, int fromID)=0
virtual void arbitrate (Tick cycle)=0
virtual void deliver (MemReqPtr &req, Tick cycle, int toID, int fromID)=0
virtual void setBlocked (int fromInterface)=0
virtual void clearBlocked (int fromInterface)=0
virtual int getChannelCount ()=0
virtual std::vector< int > getChannelSample ()=0
virtual void writeChannelDecriptor (std::ofstream &stream)=0

Public Attributes

int clock
int width
int transferDelay
int arbitrationDelay
std::vector< InterconnectArbitrationEvent * > arbitrationEvents
std::vector< InterconnectDeliverQueueEvent * > deliverEvents

Protected Member Functions

bool isSorted (std::list< InterconnectRequest * > *inList)
bool isSorted (std::list< InterconnectDelivery * > *inList)

Protected Attributes

bool blocked
int waitingFor
Tick blockedAt
int cpu_count
InterconnectProfileprofiler
std::map< int, int > processorIDToInterconnectIDMap
std::map< int, int > interconnectIDToProcessorIDMap
std::map< int, int > interconnectIDToL2IDMap
std::vector< InterconnectInterface * > masterInterfaces
std::vector< InterconnectInterface * > slaveInterfaces
std::vector< InterconnectInterface * > allInterfaces
Stats::Scalar totalArbitrationCycles
Stats::Scalar totalArbQueueCycles
Stats::Formula avgArbCyclesPerRequest
Stats::Formula avgArbQueueCyclesPerRequest
Stats::Scalar totalTransferCycles
Stats::Scalar totalTransQueueCycles
Stats::Formula avgTransCyclesPerRequest
Stats::Formula avgTransQueueCyclesPerRequest
Stats::Vector perCpuTotalTransferCycles
Stats::Vector perCpuTotalTransQueueCycles
Stats::Formula avgTotalDelayCyclesPerRequest
Stats::Scalar requests
Stats::Scalar arbitratedRequests
Stats::Scalar sentRequests
Stats::Scalar nullRequests
Stats::Scalar numClearBlocked
Stats::Scalar numSetBlocked

Classes

class  InterconnectDelivery
class  InterconnectRequest

Detailed Description

This class is the parent class of all interconnect extensions. In other words, all interconnects are sub-classes of this class.

It has three funcions:

Author:
Magnus Jahre

Definition at line 43 of file interconnect.hh.


Constructor & Destructor Documentation

Interconnect::Interconnect ( const std::string &  _name,
int  _width,
int  _clock,
int  _transDelay,
int  _arbDelay,
int  _cpu_count,
HierParams *  _hier 
) [inline]

This is the default constructor for the Interconnect class. It stores the arguments and initialises some member variables and does some input checking.

The interconnect only supports running at the same frequency as the processor core, and there must be at least one CPU in the system.

Parameters:
_name The object name from the configuration file. This is passed on to BaseHier and SimObject
_width The bit width of the transmission lines in the interconnect
_clock The number of processor cycles in one interconnect clock cycle.
_transDelay The end-to-end transfer delay through the interconnect in CPU cycles
_arbDelay The lenght of an arbitration in CPU cycles
_cpu_count The number of processors in the system
_hier Hierarchy parameters for BaseHier

Definition at line 209 of file interconnect.hh.

References arbitrationDelay, blocked, blockedAt, clock, cpu_count, transferDelay, waitingFor, and width.


Member Function Documentation

virtual void Interconnect::arbitrate ( Tick  cycle  )  [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectArbitrationEvent::process().

virtual void Interconnect::clearBlocked ( int  fromInterface  )  [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectInterface::clearBlocked().

virtual void Interconnect::deliver ( MemReqPtr &  req,
Tick  cycle,
int  toID,
int  fromID 
) [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectDeliverQueueEvent::process(), and InterconnectDeliverEvent::process().

virtual int Interconnect::getChannelCount (  )  [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectProfile::initChannelFile(), and InterconnectProfile::writeChannelEntry().

virtual std::vector<int> Interconnect::getChannelSample (  )  [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectProfile::writeChannelEntry().

int Interconnect::getInterconnectID ( int  processorID  ) 

To enable transfers between caches at the same level, a means of translating from interconnect IDs to processor IDs is needed. This information is stored in a map when the interface registers itself and is retrieved through this method.

Parameters:
processorID The processor ID to translate
Returns:
The interconnect ID of the data cache belonging to this processor

Definition at line 200 of file interconnect.cc.

References processorIDToInterconnectIDMap.

Referenced by InterconnectMaster< MemType >::getTargetAddr(), InterconnectMaster< MemType >::grantData(), InterconnectSlave< MemType >::respond(), and IdealInterconnect::send().

void Interconnect::getSendSample ( int *  dataSends,
int *  instSends,
int *  coherenceSends,
int *  totalSends 
)

This method provides statistic values to the InterconnectProfile object. The values are stored in the memory pointed to by the arguments, and the internal counters are reset.

Parameters:
dataSends Pointer to a memory area where the number of data sends can be stored
instSends Pointer to a memory area where the number of instruction sends can be stored
coherenceSends Pointer to a memory area where the number of coherence sends can be stored
totalSends Total number of sends which is the sum of the other request types
See also:
InterconnectProfile

Definition at line 213 of file interconnect.cc.

References allInterfaces.

Referenced by InterconnectProfile::writeSendEntry().

int Interconnect::getTarget ( Addr  address  ) 

Convenience method that finds the ID of the slave interface that is responsible answering requests related to a given address.

Parameters:
address The address in question
Returns:
The interface ID of the interface responsible for the address

Definition at line 238 of file interconnect.cc.

References allInterfaces.

Referenced by Crossbar::send(), and Butterfly::send().

void Interconnect::incNullRequests (  ) 

The cache might issue requests that are later squashed. The interfaces might detect this situation when they try to retrieve the current request from the cache. This situation needs to be measured as it does cause empty issue slots in the interconnect.

The InterconnectInterface calls this method when a squashed request was encountered. In increments a statistic variable that is printed when simulation is finished.

Definition at line 190 of file interconnect.cc.

References nullRequests.

Referenced by InterconnectMaster< MemType >::grantData().

bool Interconnect::isSorted ( std::list< InterconnectDelivery * > *  inList  )  [protected]

Checks that a list of InterconnectDelivery objects is sorted in ascending order according to their grant times. This is important because the arbitration methods usually assume that the request list is sorted. It is used in assertions in the subclasses.

Parameters:
inList The list to check
Returns:
True if the list is sorted
See also:
InterconnectDelivery

bool Interconnect::isSorted ( std::list< InterconnectRequest * > *  inList  )  [protected]

Checks that a list of InterconnectRequest objects is sorted in ascending order according to their request times. This is important because the arbitration methods usually assume that the request list is sorted. It is used in assertions in the subclasses.

Parameters:
inList The list to check
Returns:
True if the list is sorted
See also:
InterconnectRequest

Referenced by Crossbar::deliver(), Butterfly::deliver(), and Butterfly::request().

void Interconnect::rangeChange (  ) 

This method makes all registers interconnects reevaluate which address ranges they are responsible for.

Definition at line 182 of file interconnect.cc.

References allInterfaces.

Referenced by InterconnectInterface::rangeChange().

int Interconnect::registerInterface ( InterconnectInterface interface,
bool  isL2,
int  processorID 
)

An InterconnectInterface must register with the interconnect to be able to use it. This function is handled by this method.

Parameters:
interface A pointer to the interconnect interface that is registering itself
isL2 Is true if the interface represents an L2 cache, false otherwise
processorID The ID of the processor connected to the interface. If the cache is not connected to any particular processor, -1 should be supplied.
Returns:
The ID the interface is given

Definition at line 143 of file interconnect.cc.

References allInterfaces, interconnectIDToL2IDMap, interconnectIDToProcessorIDMap, masterInterfaces, processorIDToInterconnectIDMap, and slaveInterfaces.

void Interconnect::registerProfiler ( InterconnectProfile _profiler  )  [inline]

This method registers a InterconnectProfiler. The profiler is used to dump selected statistics to a file at regular time intervals.

Parameters:
_profiler The InterconnectProfiler to use

Definition at line 251 of file interconnect.hh.

References profiler.

Referenced by InterconnectProfile::InterconnectProfile().

void Interconnect::regStats (  ) 

This method is called from the M5 statistics package and initialises the statistics variables used in all interconnects.

Definition at line 10 of file interconnect.cc.

References arbitratedRequests, avgArbCyclesPerRequest, avgArbQueueCyclesPerRequest, avgTotalDelayCyclesPerRequest, avgTransCyclesPerRequest, avgTransQueueCyclesPerRequest, cpu_count, nullRequests, numClearBlocked, numSetBlocked, perCpuTotalTransferCycles, perCpuTotalTransQueueCycles, requests, sentRequests, totalArbitrationCycles, totalArbQueueCycles, totalTransferCycles, and totalTransQueueCycles.

virtual void Interconnect::request ( Tick  time,
int  fromID 
) [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectMaster< MemType >::request(), and InterconnectSlave< MemType >::respond().

void Interconnect::resetStats (  ) 

This method is supposed to reset the statistics values. However, it is not used any set-up used in this work and is not implemented.

Definition at line 135 of file interconnect.cc.

virtual void Interconnect::send ( MemReqPtr &  req,
Tick  time,
int  fromID 
) [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectSlave< MemType >::grantData(), and InterconnectMaster< MemType >::grantData().

virtual void Interconnect::setBlocked ( int  fromInterface  )  [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectInterface::setBlocked().

virtual void Interconnect::writeChannelDecriptor ( std::ofstream &  stream  )  [pure virtual]

This method is commented in the subclasses where it is implemented

Implemented in Butterfly, Crossbar, IdealInterconnect, and SplitTransBus.

Referenced by InterconnectProfile::initChannelFile().


The documentation for this class was generated from the following files:
Generated on Tue Jun 5 12:55:20 2007 for M5InterconnectExtensions by  doxygen 1.4.7