-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoreId16.h
34 lines (29 loc) · 1.16 KB
/
coreId16.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
#define CORECOUNT 16
#define MAXCORE 15
#define MINCORE 0
#define LOCAL_MEM_ADDRESS_BASE() (e_get_coreid() * 0x100000)
#define core00 0x80800000
#define core10 0x80900000
#define core20 0x80a00000
#define core30 0x80b00000
#define core01 0x84800000
#define core11 0x84900000
#define core21 0x84a00000
#define core31 0x84b00000
#define core02 0x88800000
#define core12 0x88900000
#define core22 0x88a00000
#define core32 0x88b00000
#define core03 0x8c800000
#define core13 0x8c900000
#define core23 0x8ca00000
#define core33 0x8cb00000
#define NEIGHBOUR_LOC(CORE, STRUCTURE, INDEX, SIZEOFTYPE) (CORE + ((unsigned int)STRUCTURE) + (INDEX * SIZEOFTYPE))
#define NEIGHBOR_LOC(CORE, STRUCTURE, INDEX, SIZEOFTYPE) (CORE + ((unsigned int)STRUCTURE) + (INDEX * SIZEOFTYPE)) /// for those who use the "alternative" spelling
/// usage:
//
/// *(int*)NEIGHBOUR_LOC(NEXT, vLocal, i, sizeof(int)) = vLocal[i];
//
/// where the contents of vLocal are ints
#define LOOPINGINCREMENT(newVal, val, inc) newVal = val + inc; if (newVal > MAXCORE) newVal = newVal - CORECOUNT;
#define LOOPINGDECREMENT(newVal, val, dec) newVal = val - dec; if (newVal < MINCORE) newVal = newVal + CORECOUNT;