1 /* index.c: some index calculations */
8 #define CORE0 0x808 /* coreid of first core */
9 #define CORES_PER_ROW 4 /* cores per row - 4 on E16G3 */
11 uint32_t core_id2lin(e_coreid_t coreid)
12 { /* take coreid, return linear index */
13 return((coreid-CORE0) / (64/CORES_PER_ROW) + (coreid-CORE0)%64);
16 uint32_t core_lin2id(uint32_t eidx)
17 { /* take linear index, return coreid */
18 return(64 * eidx / CORES_PER_ROW + eidx % CORES_PER_ROW + CORE0);