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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
#ifndef BLOCKING_H
#define BLOCKING_H
typedef std::vector<const RequestBound*> ContentionSet;
typedef std::vector<ContentionSet> Resources;
typedef std::vector<Resources> ClusterResources;
typedef std::vector<ContentionSet> AllPerCluster;
typedef std::vector<ContentionSet> TaskContention;
typedef std::vector<TaskContention> ClusterContention;
struct LimitedRequestBound {
LimitedRequestBound(const RequestBound *rqb, unsigned int l) :
request_bound(rqb), limit(l) {};
LimitedRequestBound() : request_bound(NULL), limit(0) {};
const RequestBound *request_bound;
unsigned int limit;
};
typedef std::vector<LimitedRequestBound> LimitedContentionSet;
void sort_by_request_length(LimitedContentionSet &lcs);
void sort_by_request_length(Resources& resources);
void sort_by_request_length(ClusterResources& resources);
void sort_by_request_length(ContentionSet& cs);
typedef std::vector<const TaskInfo*> Cluster;
typedef std::vector<Cluster> Clusters;
void split_by_cluster(const ResourceSharingInfo& info, Clusters& clusters);
void split_by_resource(const ResourceSharingInfo& info, Resources& resources);
void split_by_resource(const Cluster& cluster, Resources& resources);
void split_by_resource(const Clusters& clusters, ClusterResources& resources);
Interference bound_blocking(const ContentionSet& cont,
unsigned long interval,
unsigned int max_total_requests,
unsigned int max_requests_per_source,
const TaskInfo* exclude_tsk,
unsigned int min_priority = 0);
Interference bound_blocking(const ContentionSet& cont,
unsigned long interval,
unsigned int max_total_requests,
unsigned int max_requests_per_source,
bool exclude_whole_cluster,
const TaskInfo* exclude_tsk);
Interference np_fifo_per_resource(
const TaskInfo& tsk, const ClusterResources& clusters,
unsigned int procs_per_cluster,
unsigned int res_id, unsigned int issued,
int dedicated_irq = NO_CPU);
void charge_arrival_blocking(const ResourceSharingInfo& info,
BlockingBounds& bounds);
struct ClusterLimit
{
unsigned int max_total_requests;
unsigned int max_requests_per_source;
ClusterLimit(unsigned int total, unsigned int src) :
max_total_requests(total), max_requests_per_source(src) {}
};
typedef std::vector<ClusterLimit> ClusterLimits;
ClusterLimits np_fifo_limits(
const TaskInfo& tsk, const ClusterResources& clusters,
unsigned int procs_per_cluster,
const unsigned int issued,
int dedicated_irq);
Interference bound_blocking_all_clusters(
const ClusterResources& clusters,
const ClusterLimits& limits,
unsigned int res_id,
unsigned long interval,
const TaskInfo* exclude_tsk);
void split_by_type(const ContentionSet& requests,
ContentionSet& reads,
ContentionSet& writes);
void split_by_type(const Resources& resources,
Resources &reads,
Resources &writes);
void split_by_type(const ClusterResources& per_cluster,
ClusterResources &reads);
void split_by_type(const ClusterResources& per_cluster,
ClusterResources &reads,
ClusterResources &writes);
struct RWCount {
unsigned int res_id;
unsigned int num_reads;
unsigned int num_writes;
unsigned int rlength;
unsigned int wlength;
RWCount(unsigned int id) : res_id(id),
num_reads(0),
num_writes(0),
rlength(0),
wlength(0)
{}
};
typedef std::vector<RWCount> RWCounts;
void merge_rw_requests(const TaskInfo &tsk, RWCounts &counts);
extern const unsigned int UNLIMITED;
#endif
|