forked from olajep/esim-test-bins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testset.c
46 lines (32 loc) · 887 Bytes
/
testset.c
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
//asm(".global __CORE_ROW_;");
//asm(".set __CORE_ROW_,0x20;");
//asm(".global __CORE_COL_;");
//asm(".set __CORE_COL_,0x8;");
#include <stdio.h>
#include <e_lib.h>
int main()
{
int a = 0;
int b = 1;
register int zero __asm__("r32");
zero = 0;
register int *ptra __asm__ ("r33");
register int *ptrb __asm__ ("r34");
register int r35 __asm__ ("r35");
register int r36 __asm__ ("r36");
/* Local addrs will segfault */
//ptra = &a;
//ptrb = &b;
ptra = (int *) (((int) &a) | ((int) (e_get_coreid() << 20)));
ptrb = (int *) (((int) &b) | ((int) (e_get_coreid() << 20)));
r35 = 10;
r36 = 20;
printf("before testset\n");
printf("a: %d\tb: %d\n", a, b);
__asm__("testset r35, [r33,r32]");
__asm__("testset r36, [r34,r32]");
printf("after testset\n");
printf("a: %d\tb: %d\n", a, b);
printf("r35: %d\tr36: %d\n", r35, r36);
return 0;
}