#include <ideal_interconnect.hh>
Inheritance diagram for IdealInterconnect:
Public Member Functions | |
IdealInterconnect (const std::string &_name, int _width, int _clock, int _transDelay, int _arbDelay, int _cpu_count, HierParams *_hier) | |
~IdealInterconnect () | |
void | request (Tick time, int fromID) |
void | send (MemReqPtr &req, Tick time, int fromID) |
void | arbitrate (Tick cycle) |
void | deliver (MemReqPtr &req, Tick cycle, int toID, int fromID) |
void | setBlocked (int fromInterface) |
void | clearBlocked (int fromInterface) |
int | getChannelCount () |
std::vector< int > | getChannelSample () |
void | writeChannelDecriptor (std::ofstream &stream) |
Definition at line 22 of file ideal_interconnect.hh.
IdealInterconnect::IdealInterconnect | ( | const std::string & | _name, | |
int | _width, | |||
int | _clock, | |||
int | _transDelay, | |||
int | _arbDelay, | |||
int | _cpu_count, | |||
HierParams * | _hier | |||
) | [inline] |
This constructor initialises a few member variables and passes on parameters to the Interconnect constructor. The cache implementation requires that the interconnect has a finite width. Consequently, a width equal to the cache block size should be provided.
_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 60 of file ideal_interconnect.hh.
References Interconnect::arbitrationDelay, and Interconnect::transferDelay.
IdealInterconnect::~IdealInterconnect | ( | ) | [inline] |
Empty destructor.
Definition at line 88 of file ideal_interconnect.hh.
void IdealInterconnect::arbitrate | ( | Tick | cycle | ) | [virtual] |
The ideal interconnect arbitration method grants access to all requests that can be granted access every time it runs. A request can be granted if it has experienced the specified arbitration delay.
cycle | The clock cycle the method was called. |
Implements Interconnect.
Definition at line 138 of file ideal_interconnect.cc.
References Interconnect::allInterfaces, Interconnect::arbitratedRequests, Interconnect::arbitrationDelay, Interconnect::blocked, Interconnect::totalArbitrationCycles, and Interconnect::totalArbQueueCycles.
void IdealInterconnect::clearBlocked | ( | int | fromInterface | ) | [virtual] |
This method is called when a L2 cache unblocks. Depending on the requests and deliveries waiting, a new arbitration event and delivery event are sheduled.
fromInterface | The interface that unblocks |
Implements Interconnect.
Definition at line 299 of file ideal_interconnect.cc.
References Interconnect::arbitrationDelay, Interconnect::arbitrationEvents, Interconnect::blocked, Interconnect::blockedAt, Interconnect::deliverEvents, Interconnect::numClearBlocked, and Interconnect::transferDelay.
void IdealInterconnect::deliver | ( | MemReqPtr & | req, | |
Tick | cycle, | |||
int | toID, | |||
int | fromID | |||
) | [virtual] |
This method tries to deliver as many requests as possible to its destination. Only, requests that have experienced the defined delay can be delivered. However, if an L2 bank blocks, all requests that are old enough might not be delivered. Since the delivery queue is kept sorted, the oldest requests are delivered first.
Since this class uses a delivery queue, all parameters except cycle are discarded.
req | Not used, must be NULL. | |
cycle | The clock cycle the method is called. | |
toID | Not used, must be -1. | |
fromID | Not used, must be -1. |
Implements Interconnect.
Definition at line 201 of file ideal_interconnect.cc.
References Interconnect::allInterfaces, Interconnect::blocked, Interconnect::perCpuTotalTransferCycles, Interconnect::perCpuTotalTransQueueCycles, Interconnect::sentRequests, Interconnect::totalTransferCycles, Interconnect::totalTransQueueCycles, and Interconnect::transferDelay.
int IdealInterconnect::getChannelCount | ( | ) | [inline, virtual] |
Since there are an unlimited number of channels in the ideal interconnect, this method returns -1.
Implements Interconnect.
Definition at line 165 of file ideal_interconnect.hh.
std::vector<int> IdealInterconnect::getChannelSample | ( | ) | [inline, virtual] |
It makes no sense to get a channel sample in an ideal interconnect, so if this method is called it prints a fatal error message.
Implements Interconnect.
Definition at line 175 of file ideal_interconnect.hh.
void IdealInterconnect::request | ( | Tick | time, | |
int | fromID | |||
) | [virtual] |
This method puts the requests in a queue according to the clock cycle the request was recieved. Consequently, the queue is kept sorted in ascending order. This simplifies arbitration.
time | The clock cycle the method was called | |
fromID | The interface ID of the requesting interface |
Implements Interconnect.
Definition at line 8 of file ideal_interconnect.cc.
References Interconnect::arbitrationDelay, Interconnect::blocked, and Interconnect::requests.
void IdealInterconnect::send | ( | MemReqPtr & | req, | |
Tick | time, | |||
int | fromID | |||
) | [virtual] |
The send method is called when an interface is granted access and finds the destination interface from the values in the request. Then, it adds the request to a delivery queue and schedules a delivery event if needed.
req | The memory request to send. | |
time | The clock cycle the method was called at. | |
fromID | The interface ID of the sender interface. |
Implements Interconnect.
Definition at line 53 of file ideal_interconnect.cc.
References Interconnect::allInterfaces, Interconnect::blocked, Interconnect::deliverEvents, Interconnect::getInterconnectID(), Interconnect::transferDelay, and Interconnect::width.
void IdealInterconnect::setBlocked | ( | int | fromInterface | ) | [virtual] |
When this method is called, all arbitration events and delivery events are descheduled.
fromInterface | The interface that is blocked |
Implements Interconnect.
Definition at line 269 of file ideal_interconnect.cc.
References Interconnect::arbitrationEvents, Interconnect::blocked, Interconnect::blockedAt, Interconnect::deliverEvents, Interconnect::numSetBlocked, and Interconnect::waitingFor.
void IdealInterconnect::writeChannelDecriptor | ( | std::ofstream & | stream | ) | [inline, virtual] |
The ideal interconnect has an unlimited number of channels. Consequently, this method reports a fatal error if it is called.
stream | The stream that is never used |
Implements Interconnect.
Definition at line 187 of file ideal_interconnect.hh.