-
Notifications
You must be signed in to change notification settings - Fork 0
/
electronictorus_xy_routingpolicy.h
52 lines (44 loc) · 1.29 KB
/
electronictorus_xy_routingpolicy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* electronictorus_xy_routingpolicy.h
* PhoenixSim
*
* Created by Johnnie Chan on 7/1/11.
* Copyright 2011 Johnnie Chan. All rights reserved.
*
*/
#ifndef __ELECTRONICTORUS_XY_ROUTINGPOLICY_H__
#define __ELECTRONICTORUS_XY_ROUTINGPOLICY_H__
#include <string>
#include "routingpolicy.h"
#include "routingpolicyfactory.h"
namespace PhoenixSim
{
class ElectronicTorus_XY_RoutingParameters : public RoutingParameters
{
public:
int maxPacketSizeInCredits;
int numOfVirtualChannels;
int networkSizeX;
int networkSizeY;
int bufferWidth;
};
class ElectronicTorus_XY_RoutingPolicy : public RoutingPolicy
{
public:
void SetRoutingParameters(RoutingParameters *p_parameters);
std::pair<int, int> Route(ElectronicMessage* currentMessage, int inputPort, int inputVirtualChannel, const std::vector<int> &routerCredits);
private:
ElectronicTorus_XY_RoutingParameters routingParameters;
};
// Register with RoutingPolicyFactory
namespace
{
RoutingPolicy* CreateElectronicTorusXYPolicy()
{
return new ElectronicTorus_XY_RoutingPolicy;
}
const std::string identifier_t = "electronictorus_xy";
const bool registered_t = RoutingPolicyFactory::Instance()->RegisterRoutingPolicy(CreateElectronicTorusXYPolicy, identifier_t);
}
}
#endif // __ELECTRONICTORUS_XY_ROUTINGPOLICY_H__