This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
cl_mu.h
165 lines (129 loc) · 5.13 KB
/
cl_mu.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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/* begin_generated_IBM_copyright_prolog */
/* */
/* This is an automatically generated copyright prolog. */
/* After initializing, DO NOT MODIFY OR MOVE */
/* ================================================================ */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* Blue Gene/Q */
/* */
/* (C) Copyright IBM Corp. 2010, 2012 */
/* */
/* US Government Users Restricted Rights - */
/* Use, duplication or disclosure restricted */
/* by GSA ADP Schedule Contract with IBM Corp. */
/* */
/* This software is available to you under the */
/* Eclipse Public License (EPL). */
/* */
/* ================================================================ */
/* */
/* end_generated_IBM_copyright_prolog */
// cl_mu.h
#ifndef __CL_MU_H
#define __CL_MU_H
#include <hwi/include/bqc/MU_Macros.h>
#include <hwi/include/bqc/classroute.h>
#ifndef __CL_MU_EXTERN_
#define __CL_MU_EXTERN_ extern
#endif
__CL_MU_EXTERN_ int inj_fifo_fds[ BGQ_MU_NUM_FIFO_SUBGROUPS_PER_NODE * BGQ_MU_NUM_INJ_FIFOS_PER_SUBGROUP ];
__CL_MU_EXTERN_ int rec_fifo_fds[ BGQ_MU_NUM_FIFO_SUBGROUPS_PER_NODE * BGQ_MU_NUM_REC_FIFOS_PER_SUBGROUP ];
__CL_MU_EXTERN_ int bat_fds[ BGQ_MU_NUM_FIFO_SUBGROUPS_PER_NODE * BGQ_MU_NUM_DATA_COUNTERS_PER_SUBGROUP ];
__CL_MU_EXTERN_ int coll_cr_fds[ BGQ_COLL_CLASS_MAX_CLASSROUTES ];
__CL_MU_EXTERN_ int gi_cr_fds[ BGQ_GI_CLASS_MAX_CLASSROUTES ];
#define __CL_MU_INLINE static inline
__CL_MU_INLINE int _get_inj_fifo_fd(uint32_t fifo_id)
{
return inj_fifo_fds[ fifo_id ];
}
__CL_MU_INLINE void _set_inj_fifo_fd(uint32_t fifo_id, int fd)
{
inj_fifo_fds[ fifo_id ] = fd;
}
__CL_MU_INLINE int get_inj_fifo_fd(uint32_t subgrid, uint32_t fifo_idx_in_subgrp)
{
return _get_inj_fifo_fd( subgrid * BGQ_MU_NUM_INJ_FIFOS_PER_SUBGROUP + fifo_idx_in_subgrp);
}
__CL_MU_INLINE void set_inj_fifo_fd(uint32_t subgrid, uint32_t fifo_idx_in_subgrp, int fd)
{
_set_inj_fifo_fd(subgrid * BGQ_MU_NUM_INJ_FIFOS_PER_SUBGROUP + fifo_idx_in_subgrp, fd);
}
__CL_MU_INLINE int have_inj_fifo_fd(uint32_t subgrid, uint32_t fifo_idx_in_subgrp)
{
return get_inj_fifo_fd(subgrid, fifo_idx_in_subgrp) != -1;
}
__CL_MU_INLINE int _get_rec_fifo_fd(uint32_t fifo_id)
{
return rec_fifo_fds[ fifo_id ];
}
__CL_MU_INLINE void _set_rec_fifo_fd(uint32_t fifo_id, int fd)
{
rec_fifo_fds[ fifo_id ] = fd;
}
__CL_MU_INLINE int get_rec_fifo_fd(uint32_t subgrid, uint32_t fifo_idx_in_subgrp)
{
return _get_rec_fifo_fd( subgrid * BGQ_MU_NUM_REC_FIFOS_PER_SUBGROUP + fifo_idx_in_subgrp);
}
__CL_MU_INLINE int get_rec_fifo_fd_grp(uint32_t groupid, uint32_t fifo_idx_in_grp)
{
return _get_rec_fifo_fd(groupid * BGQ_MU_NUM_REC_FIFOS_PER_GROUP + fifo_idx_in_grp);
}
__CL_MU_INLINE void set_rec_fifo_fd(uint32_t subgrid, uint32_t fifo_idx_in_subgrp, int fd)
{
_set_rec_fifo_fd(subgrid * BGQ_MU_NUM_REC_FIFOS_PER_SUBGROUP + fifo_idx_in_subgrp, fd);
}
__CL_MU_INLINE int have_rec_fifo_fd(uint32_t subgrid, uint32_t fifo_idx_in_subgrp)
{
return get_rec_fifo_fd(subgrid, fifo_idx_in_subgrp) != -1;
}
__CL_MU_INLINE int have_rec_fifo_fd_grp(uint32_t groupid, uint32_t fifo_idx_in_grp)
{
return get_rec_fifo_fd_grp(groupid, fifo_idx_in_grp) != -1;
}
__CL_MU_INLINE int _get_bat_fd(uint32_t bat_id)
{
return bat_fds[ bat_id ];
}
__CL_MU_INLINE void _set_bat_fd(uint32_t bat_id, int fd)
{
bat_fds[ bat_id ] = fd;
}
__CL_MU_INLINE int get_bat_fd(uint32_t subgrid, uint32_t bat_idx_in_subgrp)
{
return _get_bat_fd( subgrid * BGQ_MU_NUM_DATA_COUNTERS_PER_SUBGROUP + bat_idx_in_subgrp);
}
__CL_MU_INLINE void set_bat_fd(uint32_t subgrid, uint32_t bat_idx_in_subgrp, int fd)
{
_set_bat_fd(subgrid * BGQ_MU_NUM_DATA_COUNTERS_PER_SUBGROUP + bat_idx_in_subgrp, fd);
}
__CL_MU_INLINE int have_bat_fd(uint32_t groupid, uint32_t bat_idx_in_grp)
{
return get_bat_fd(groupid, bat_idx_in_grp) != -1;
}
__CL_MU_INLINE int get_coll_cr_fd(uint32_t coll_cr_id)
{
return coll_cr_fds[coll_cr_id];
}
__CL_MU_INLINE void set_coll_cr_fd(uint32_t coll_cr_id, int fd)
{
coll_cr_fds[coll_cr_id] = fd;
}
__CL_MU_INLINE int have_coll_cr_fd(uint32_t coll_cr_id)
{
return get_coll_cr_fd(coll_cr_id) != -1;
}
__CL_MU_INLINE int get_gi_cr_fd(uint32_t gi_cr_id)
{
return gi_cr_fds[gi_cr_id];
}
__CL_MU_INLINE void set_gi_cr_fd(uint32_t gi_cr_id, int fd)
{
gi_cr_fds[gi_cr_id] = fd;
}
__CL_MU_INLINE int have_gi_cr_fd(uint32_t gi_cr_id)
{
return get_gi_cr_fd(gi_cr_id) != -1;
}
#endif