-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixed_routingpolicy.h
More file actions
45 lines (38 loc) · 1.02 KB
/
fixed_routingpolicy.h
File metadata and controls
45 lines (38 loc) · 1.02 KB
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
/*
* fixed_routingpolicy.h
* PhoenixSim
*
* Created by Johnnie Chan on 6/23/11.
* Copyright 2011 Johnnie Chan. All rights reserved.
*
*/
#ifndef __FIXED_ROUTINGPOLICY_H__
#define __FIXED_ROUTINGPOLICY_H__
#include <string>
#include "routingpolicy.h"
#include "routingpolicyfactory.h"
namespace PhoenixSim
{
class Fixed_RoutingParameters : public RoutingParameters
{
public:
};
class Fixed_RoutingPolicy : public RoutingPolicy
{
public:
void SetRouterId(int p_routerId);
void SetRoutingParameters(RoutingParameters *p_parameters);
std::pair<int, int> Route(ElectronicMessage* currentMessage, int inputPort, int inputVirtualChannel, const std::vector<int> &routerCredits);
};
// Register with RoutingPolicyFactory
namespace
{
RoutingPolicy* CreateFixedPolicy()
{
return new Fixed_RoutingPolicy;
}
const std::string identifier = "fixed";
const bool registered = RoutingPolicyFactory::Instance()->RegisterRoutingPolicy(CreateFixedPolicy, identifier);
}
}
#endif // __FIXED_ROUTINGPOLICY_H__