-
Notifications
You must be signed in to change notification settings - Fork 0
/
electronicmesh_xy_routingpolicy.h
51 lines (43 loc) · 1.27 KB
/
electronicmesh_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
/*
* electronicmesh_xy_routingpolicy.h
* PhoenixSim
*
* Created by Johnnie Chan on 6/24/11.
* Copyright 2011 Johnnie Chan. All rights reserved.
*
* Performs dimension-order routing on a grid topology
*
*/
#ifndef __ELECTRONICMESH_XY_ROUTINGPOLICY_H__
#define __ELECTRONICMESH_XY_ROUTINGPOLICY_H__
#include <string>
#include "routingpolicy.h"
#include "routingpolicyfactory.h"
namespace PhoenixSim
{
class ElectronicMesh_XY_RoutingParameters : public RoutingParameters
{
public:
int networkSizeX;
int networkSizeY;
};
class ElectronicMesh_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:
ElectronicMesh_XY_RoutingParameters routingParameters;
};
// Register with RoutingPolicyFactory
namespace
{
RoutingPolicy* CreateElectronicMeshXYPolicy()
{
return new ElectronicMesh_XY_RoutingPolicy;
}
const std::string identifier = "electronicmesh_xy";
const bool registered = RoutingPolicyFactory::Instance()->RegisterRoutingPolicy(CreateElectronicMeshXYPolicy, identifier);
}
}
#endif // __ELECTRONICMESH_XY_ROUTINGPOLICY_H__