Add files via upload

This commit is contained in:
VinhTA-Computer-Master 2021-08-25 11:46:57 -07:00 committed by GitHub
parent c1c2515b8a
commit a5ffebfe6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 54329 additions and 0 deletions

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

View File

@ -0,0 +1,11 @@
FILE1 = fact.c
all: fact
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
fact: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o factorial
clean:
rm -rf factorial CGRAExec m5out *.ll *.bc *~

BIN
benchmarks/factorial/a.out Normal file

Binary file not shown.

View File

@ -0,0 +1,29 @@
#include <stdio.h>
/*int factorial(int n){
int ret = 1;
int dummy = 0;
#pragma CGRA
for(int i=n; i > 1; i--){
ret *= i;
dummy++;
}
return ret;
}*/
int main(int argc, char* argv[]){
int n = atoi(argv[1]);
int fact=1;// = factorial(n);
int dummy=0;
#pragma CGRA
for(int i=n; i > 1; i--){
if(fact<10000)
fact *= i;
//dummy++;
}
printf("%d! = %d\n", n, fact);
}

6713
benchmarks/factorial/out Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

View File

@ -0,0 +1,11 @@
FILE1 = fib.c
all: fib
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
fib: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o fibonacci
clean:
rm -rf fibonacci CGRAExec m5out

View File

@ -0,0 +1,11 @@
FILE1 = add.c
all: loop
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
loop: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o loop
clean:
rm -rf loop output* CGRAExec m5out

BIN
benchmarks/fibonacci/a.out Normal file

Binary file not shown.

View File

@ -0,0 +1,37 @@
#include <stdio.h>
/*int fibonacci(int count){
int ret=1;
int prev=1;
#pragma CGRA
for(int i=1; i<count-1; i++){
if(i < count){
int temp = ret+prev;
prev = ret;
ret = temp;
}
}
return ret;
}*/
int main(int argc, char* argv[]){
int count = atoi(argv[1]);
printf("Calculating fibonacci for %d numbers\n", count);
//int fib = fibonacci(count);
int ret=1;
int prev=1;
#pragma CGRA
for(int i=1; i<count-1; i++){
//if(i < count){
int temp = ret+prev;
prev = ret;
ret = temp;
//}
}
printf("Result: %d\n", ret);
}

View File

@ -0,0 +1,37 @@
#include <stdio.h>
/*int fibonacci(int count){
int ret=1;
int prev=1;
#pragma CGRA
for(int i=1; i<count-1; i++){
if(i < count){
int temp = ret+prev;
prev = ret;
ret = temp;
}
}
return ret;
}*/
int main(int argc, char* argv[]){
int count = atoi(argv[1]);
printf("Calculating fibonacci for %d numbers\n", count);
//int fib = fibonacci(count);
int ret=1;
int prev=1;
#pragma CGRA
for(int i=1; i<count-1; i++){
if(i < count){
int temp = ret+prev;
prev = ret;
ret = temp;
}
}
printf("Result: %d\n", ret);
}

4590
benchmarks/fibonacci/out Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

View File

@ -0,0 +1,14 @@
4
4
4
0
0.7
2
8GB
0
RAMP
10
10
1000
50
0.02

View File

@ -0,0 +1,154 @@
digraph LoadConst {
{
0 [color=red ];
1 [color=red ];
2 [color=red ];
3 [color=red ];
4 [color=red ];
5 [color=red ];
6 [color=blue ];
7 [color=blue ];
8 [color=red ];
9 [color=red ];
10 [color=red ];
11 [color=red ];
16 [color=red ];
17 [color=red ];
24 [color=red ];
26 [color=red ];
27 [color=red ];
28 [color=red ];
29 [color=red ];
31 [color=green ];
32 [color=green ];
33 [color=green ];
34 [color=green ];
35 [color=green ];
36 [color=green ];
37 [color=green ];
38 [color=green ];
39 [color=green ];
40 [color=green ];
41 [color=green ];
42 [color=green ];
43 [color=green ];
44 [color=green ];
45 [color=green ];
46 [color=green ];
47 [color=green ];
48 [color=green ];
49 [color=green ];
50 [color=green ];
51 [color=green ];
52 [color=green ];
53 [color=green ];
54 [color=green ];
55 [color=green ];
56 [color=green ];
6 -> 7 [style=dotted, color=blue, label= mem]
16 -> 0 [style=bold, color=red, label=1]
0 -> 24
24 -> 5
5 -> 6
9 -> 10 [style=bold, color=blue ]
7 -> 10
3 -> 10
9 -> 11 [style=bold, color=blue ]
1 -> 11
7 -> 26
4 -> 26
8 -> 26 [style=bold, color=blue ]
26 -> 4 [style=bold, color=red, label=1]
10 -> 27
2 -> 28
8 -> 28 [style=bold, color=blue ]
28 -> 2 [style=bold, color=red, label=1]
11 -> 29
2 -> 29
0 -> 16
16 -> 17
8 -> 31
31 -> 29 [style=bold, color=blue ]
8 -> 32
0 -> 33
33 -> 11
29 -> 34
34 -> 1 [style=bold, color=red, label=1]
35 -> 36
0 -> 37
37 -> 38
38 -> 39
40 -> 35
7 -> 41
41 -> 8
3 -> 42
42 -> 43
43 -> 44
44 -> 9
7 -> 45
45 -> 9
32 -> 46
46 -> 27 [style=bold, color=blue ]
39 -> 47
36 -> 48
47 -> 49
48 -> 50
50 -> 27
49 -> 51
51 -> 28
4 -> 52
52 -> 40
53 -> 8
27 -> 54
54 -> 3 [style=bold, color=red, label=1]
55 -> 53
4 -> 56
56 -> 55
}
}

View File

@ -0,0 +1,181 @@
Mapping has started
Curerent II: 4 rec_MII: 4
Trying to schedule DDG at II: 4
19
1. src is: 8-8 target is: 10-9
1. Edge points to NULL!
20
Redoing ASAP and ALAP
20
1. src is: 8-8 target is: 10-9
1. Edge points to NULL!
21
Redoing ASAP and ALAP
21
1. src is: 0-3 target is: 29-10
1. Edge points to NULL!
1. src is: 0-3 target is: 1-8
1. Edge points to NULL!
22
Redoing ASAP and ALAP
22
23
Redoing ASAP and ALAP
23
1. src is: 4-7 target is: 10-9
1. Edge points to NULL!
24
Redoing ASAP and ALAP
24
1. src is: 35-4 target is: 10-9
1. Edge points to NULL!
25
Redoing ASAP and ALAP
25
1. src is: 0-3 target is: 29-10
1. Edge points to NULL!
26
Redoing ASAP and ALAP
26
1. src is: 37-4 target is: 29-10
1. Edge points to NULL!
27
Redoing ASAP and ALAP
27
1. src is: 38-5 target is: 29-10
1. Edge points to NULL!
28
Redoing ASAP and ALAP
28
29
Redoing ASAP and ALAP
29
1. src is: 7-7 target is: 8-8
1. Edge points to NULL!
1. src is: 7-6 target is: 8-8
1. Edge points to NULL!
30
Redoing ASAP and ALAP
30
31
Redoing ASAP and ALAP
31
32
Redoing ASAP and ALAP
32
33
Redoing ASAP and ALAP
33
34
Redoing ASAP and ALAP
34
1. src is: 32-10 target is: 10-11
1. Edge points to NULL!
1. src is: 32-9 target is: 10-11
1. Edge points to NULL!
35
Redoing ASAP and ALAP
35
1. src is: 39-6 target is: 29-12
1. Edge points to NULL!
36
Redoing ASAP and ALAP
36
1. src is: 36-6 target is: 10-11
1. Edge points to NULL!
37
Redoing ASAP and ALAP
37
1. src is: 47-7 target is: 29-12
1. Edge points to NULL!
38
Redoing ASAP and ALAP
38
1. src is: 48-7 target is: 10-11
1. Edge points to NULL!
39
Redoing ASAP and ALAP
39
1. src is: 49-8 target is: 29-12
1. Edge points to NULL!
40
Redoing ASAP and ALAP
40
41
Redoing ASAP and ALAP
41
42
Redoing ASAP and ALAP
42
43
Redoing ASAP and ALAP
43
44
Redoing ASAP and ALAP
44
45
Redoing ASAP and ALAP
45
45
Feasible II is 4 Schedule Len is 12
II after scheduling is: 4
Start Placement for II = 4
Node 0 is scheduled at 3 ASAP: 0 ALAP: 3 Mod: 3
Node 1 is scheduled at 12 ASAP: 9 ALAP: 12 Mod: 0
Node 2 is scheduled at 9 ASAP: 6 ALAP: 9 Mod: 1
Node 3 is scheduled at 8 ASAP: 5 ALAP: 8 Mod: 0
Node 4 is scheduled at 4 ASAP: 1 ALAP: 4 Mod: 0
Node 5 is scheduled at 5 ASAP: 2 ALAP: 5 Mod: 1
Node 6 is scheduled at 6 ASAP: 3 ALAP: 6 Mod: 2
Node 7 is scheduled at 7 ASAP: 4 ALAP: 7 Mod: 3
Node 8 is scheduled at 9 ASAP: 6 ALAP: 9 Mod: 1
Node 9 is scheduled at 12 ASAP: 9 ALAP: 12 Mod: 0
Node 10 is scheduled at 13 ASAP: 10 ALAP: 13 Mod: 1
Node 11 is scheduled at 13 ASAP: 10 ALAP: 13 Mod: 1
Node 16 is scheduled at 4 ASAP: 1 ALAP: 4 Mod: 0
Node 17 is scheduled at 5 ASAP: 2 ALAP: 5 Mod: 1
Node 24 is scheduled at 4 ASAP: 1 ALAP: 4 Mod: 0
Node 26 is scheduled at 10 ASAP: 7 ALAP: 10 Mod: 2
Node 27 is scheduled at 14 ASAP: 11 ALAP: 14 Mod: 2
Node 28 is scheduled at 10 ASAP: 7 ALAP: 10 Mod: 2
Node 29 is scheduled at 14 ASAP: 11 ALAP: 14 Mod: 2
Node 31 is scheduled at 10 ASAP: 7 ALAP: 10 Mod: 2
Node 32 is scheduled at 10 ASAP: 7 ALAP: 10 Mod: 2
Node 33 is scheduled at 4 ASAP: 1 ALAP: 4 Mod: 0
Node 34 is scheduled at 15 ASAP: 12 ALAP: 15 Mod: 3
Node 35 is scheduled at 7 ASAP: 4 ALAP: 7 Mod: 3
Node 36 is scheduled at 8 ASAP: 5 ALAP: 8 Mod: 0
Node 37 is scheduled at 4 ASAP: 1 ALAP: 4 Mod: 0
Node 38 is scheduled at 5 ASAP: 2 ALAP: 5 Mod: 1
Node 39 is scheduled at 6 ASAP: 3 ALAP: 6 Mod: 2
Node 40 is scheduled at 6 ASAP: 3 ALAP: 6 Mod: 2
Node 41 is scheduled at 8 ASAP: 5 ALAP: 8 Mod: 0
Node 42 is scheduled at 9 ASAP: 6 ALAP: 9 Mod: 1
Node 43 is scheduled at 10 ASAP: 7 ALAP: 10 Mod: 2
Node 44 is scheduled at 11 ASAP: 8 ALAP: 11 Mod: 3
Node 45 is scheduled at 8 ASAP: 5 ALAP: 8 Mod: 0
Node 46 is scheduled at 11 ASAP: 8 ALAP: 11 Mod: 3
Node 47 is scheduled at 7 ASAP: 4 ALAP: 7 Mod: 3
Node 48 is scheduled at 9 ASAP: 6 ALAP: 9 Mod: 1
Node 49 is scheduled at 8 ASAP: 5 ALAP: 8 Mod: 0
Node 50 is scheduled at 10 ASAP: 7 ALAP: 10 Mod: 2
Node 51 is scheduled at 9 ASAP: 6 ALAP: 9 Mod: 1
Node 52 is scheduled at 5 ASAP: 2 ALAP: 5 Mod: 1
Node 53 is scheduled at 7 ASAP: 4 ALAP: 7 Mod: 3
Node 54 is scheduled at 15 ASAP: 12 ALAP: 15 Mod: 3
Node 55 is scheduled at 6 ASAP: 3 ALAP: 6 Mod: 2
Node 56 is scheduled at 5 ASAP: 2 ALAP: 5 Mod: 1
Graph has n = 720 vertices.
Find a Clique of size at least k = 45
Attempt total number 1, Clique Size: 40
Attempt total number 1, Clique Size: 41
Attempt total number 2, Clique Size: 39
Attempt total number 2, Clique Size: 41
Attempt total number 3, Clique Size: 38
Attempt total number 3, Clique Size: 41
Attempt total number 4, Clique Size: 38
Attempt total number 4, Clique Size: 41
Attempt total number 5, Clique Size: 38
Attempt total number 5, Clique Size: 41

View File

@ -0,0 +1,3 @@
131 132 0 LRE 0
132 17 0 TRU 1
30 131 0 TRU 0

View File

@ -0,0 +1,4 @@
17 10 17 1
30 30 gVar1 1
131 19 ld_add_gVar1 1
132 20 ld_data_gVar1 1

View File

@ -0,0 +1,12 @@
134 135 0 SRE 0
26 135 0 TRU 0
133 135 0 TRU 1
137 138 0 SRE 0
27 138 0 TRU 0
136 138 0 TRU 1
140 141 0 SRE 0
28 141 0 TRU 0
139 141 0 TRU 1
143 144 0 SRE 0
29 144 0 TRU 0
142 144 0 TRU 1

View File

@ -0,0 +1,16 @@
26 26 26 0 1
133 30 gVar2 0 1
134 21 st_add_gVar2 4 1
135 22 st_data_gVar2 0 1
27 26 27 0 1
136 30 gVar3 0 1
137 21 st_add_gVar3 4 1
138 22 st_data_gVar3 0 1
28 26 28 0 1
139 30 gVar4 0 1
140 21 st_add_gVar4 4 1
141 22 st_data_gVar4 0 1
29 26 29 0 1
142 30 gVar5 0 1
143 21 st_add_gVar5 4 1
144 22 st_data_gVar5 0 1

View File

@ -0,0 +1,42 @@
6 7 0 LRE 0
16 0 1 TRU 0
18 0 0 TRU 1
19 1 0 TRU 1
20 2 0 TRU 1
21 3 0 TRU 1
22 4 0 TRU 1
23 5 0 TRU 0
0 24 0 TRU 0
25 24 0 TRU 1
24 5 0 TRU 1
5 6 0 TRU 0
7 8 0 TRU 0
4 8 0 TRU 1
7 9 0 TRU 0
3 9 0 TRU 1
9 10 0 PRE 2
7 10 0 TRU 1
3 10 0 TRU 0
9 11 0 PRE 2
0 11 0 TRU 1
1 11 0 TRU 0
7 26 0 TRU 1
4 26 0 TRU 0
8 26 0 PRE 2
26 4 1 TRU 0
10 27 0 TRU 0
4 27 0 TRU 1
8 27 0 PRE 2
27 3 1 TRU 0
0 28 0 TRU 1
2 28 0 TRU 0
8 28 0 PRE 2
28 2 1 TRU 0
11 29 0 TRU 0
2 29 0 TRU 1
8 29 0 PRE 2
29 1 1 TRU 0
0 16 0 TRU 0
18 16 0 TRU 1
16 17 0 TRU 0
30 17 0 LIE 1

View File

@ -0,0 +1,27 @@
0 29 0 0 1
1 29 1 0 1
2 29 2 0 1
3 29 3 0 1
4 29 4 0 1
5 0 5 0 1
6 19 6 4 1
7 20 7 0 1
8 9 8 0 1
9 9 9 0 1
10 26 10 0 1
11 26 11 0 1
16 0 16 0 1
17 10 17 0 1
18 30 ConstInt1 0 1
19 30 ConstInt-1 0 1
20 30 ConstInt0 0 1
21 30 ConstInt-2147483648 0 1
22 30 ConstInt136 0 1
23 30 __const.main.vector 0 1
24 2 idxprom1 0 1
25 30 ConstInt4 0 1
26 26 26 0 1
27 26 27 0 1
28 26 28 0 1
29 26 29 0 1
30 30 gVar1 4 1

View File

@ -0,0 +1,113 @@
digraph loop_45 {
{
0 [shape=box, color=red, label="0"];
1 [shape=box, color=red, label="1"];
2 [shape=box, color=red, label="2"];
3 [shape=box, color=red, label="3"];
4 [shape=box, color=red, label="4"];
5 [color=black, label="5"];
6 [color=blue, label="6"];
7 [color=blue, label="7"];
8 [color=black, label="8"];
9 [color=black, label="9"];
10 [shape=diamond, color=gray, label="10"];
11 [shape=diamond, color=gray, label="11"];
16 [color=black, label="16"];
17 [color=black, label="17"];
18 [color=black, label="ConstInt1"];
19 [color=black, label="ConstInt-1"];
20 [color=black, label="ConstInt0"];
21 [color=black, label="ConstInt-2147483648"];
22 [color=black, label="ConstInt136"];
23 [color=black, label="__const.main.vector"];
24 [color=black, label="idxprom1"];
25 [color=black, label="ConstInt4"];
26 [shape=diamond, color=gray, label="26"];
27 [shape=diamond, color=gray, label="27"];
28 [shape=diamond, color=gray, label="28"];
29 [shape=diamond, color=gray, label="29"];
30 [color=black, label="gVar1"];
133 [color=black, label="gVar2"];
136 [color=black, label="gVar3"];
139 [color=black, label="gVar4"];
142 [color=black, label="gVar5"];
16 -> 0 [style=bold, color=red, label=1]
18 -> 0 [color=gray]
19 -> 1 [color=gray]
20 -> 2 [color=gray]
21 -> 3 [color=gray]
22 -> 4 [color=gray]
23 -> 5 [color=gray]
0 -> 24
25 -> 24 [color=gray]
24 -> 5
5 -> 6
7 -> 8
4 -> 8
7 -> 9
3 -> 9
9 -> 10 [color=green ]
7 -> 10
3 -> 10
9 -> 11 [color=green ]
0 -> 11
1 -> 11
7 -> 26
4 -> 26
8 -> 26 [color=green ]
26 -> 4 [style=bold, color=red, label=1]
10 -> 27
4 -> 27
8 -> 27 [color=green ]
27 -> 3 [style=bold, color=red, label=1]
0 -> 28
2 -> 28
8 -> 28 [color=green ]
28 -> 2 [style=bold, color=red, label=1]
11 -> 29
2 -> 29
8 -> 29 [color=green ]
29 -> 1 [style=bold, color=red, label=1]
0 -> 16
18 -> 16 [color=gray]
16 -> 17
30 -> 17 [color=orange, label=4]
26 -> 133 [color=orange, label=4]
27 -> 136 [color=orange, label=4]
28 -> 139 [color=orange, label=4]
29 -> 142 [color=orange, label=4]
6 -> 7 [style=dotted, color=blue, label="4"]
}
}

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,19 @@
0 1
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
11 1
16 1
17 1
24 1
26 1
27 1
28 1
29 1

View File

@ -0,0 +1,114 @@
#!/bin/bash
############################################
############################################
## Author : Shail Dave ##
## Arizona State University ##
## ##
## Notes : Script File To Compile A Loop ##
## for its Execution on CGRA ##
## ##
############################################
############################################
#Set Architecture Parameters
#X=4
#Y=4
#R=4
X=0
Y=0
R=0
IC=0
CGRAclock=0
CPUClock=0
ALGO=""
MSA=10
MAPII=10
MAX_MAP=1000
MAX_II=50
LAMBDA=0.02
if [ -f "CGRA_config.csv" ]; then
INPUTFILE="CGRA_config.csv"
X=$(grep -w X $INPUTFILE | cut -d, -f2)
Y=$(grep -w Y $INPUTFILE | cut -d, -f2)
R=$(grep -w R $INPUTFILE | cut -d, -f2)
ALGO=$(grep -w ALGO $INPUTFILE | cut -d, -f2)
MSA=$(grep -w MSA $INPUTFILE | cut -d, -f2)
MAPII=$(grep -w MAPII $INPUTFILE | cut -d, -f2)
MAX_MAP=$(grep -w MAX_MAP $INPUTFILE | cut -d, -f2)
MAX_II=$(grep -w MAX_II $INPUTFILE | cut -d, -f2)
LAMBDA=$(grep -w LAMBDA $INPUTFILE | cut -d, -f2)
else
echo "Please include CGRA architecture file"
exit 1
fi
obj="$1"
#Setting Paths
LEVEL=../..
#toolchain="/home/shail/ccf-init"
ccf_root="$2"
script="$ccf_root/scripts"
opcodegen="$ccf_root/InstructionGenerator/insgen"
opcodegen1="$ccf_root/InstructionGenerator/falcon_insgen"
#Detect node and edge file
llvmedge="$(find . -name "*.txt" | grep -i loop | grep -i edge)"
llvmnode="$(find . -name "*.txt" | grep -i loop | grep -i node)"
echo $llvmnode
#RAMP - Scheduling and Mapping
#if [ $ALGO -eq 0 ]; then
# $script/map.sh $llvmnode $llvmedge -X $X -Y $Y -R $R
#elif [ $ALGO -eq 1 ]; then
# $script/map1.sh $llvmnode $llvmedge $X $Y $R $MODE
#elif [ $ALGO -eq 2 ]; then
# $script/map2.sh $llvmnode $llvmedge $X $Y $R $MODE
#elif [ $ALGO -eq 3 ]; then
# $script/map3.sh $llvmnode $llvmedge $X $Y $R $MODE
#else
# $script/map4.sh $llvmnode $llvmedge $X $Y $R $MODE $SCHED
#fi
pwd
find ${ccf_root}/mappings -maxdepth 1 -mindepth 1 -type d | while read dir; do
echo $dir
if [[ $dir == *"$ALGO" ]]; then
map="$dir/Release"
nodefile="$dir/DFGFiles"
$map/$ALGO -EDGE $llvmedge -NODE $llvmnode -X $X -Y $Y -R $R -MSA $MSA -MAPII $MAPII -MAX_MAP $MAX_MAP -MAX_II $MAX_II -LAMBDA $LAMBDA #> $schfile
$nodefile/nodefile $llvmnode DUMP_node.txt > final_node.txt
fi
done
finalnode="$(find ./ -name "*.txt" | grep -i final | grep -i node)"
node="$(find ./ -name "*.txt" | grep -i DUMP | grep -i node)"
edge="$(find ./ -name "*.txt" | grep -i DUMP | grep -i edge)"
liveoutnode="$(find ./ -name "*.txt" | grep -i liveout | grep -i node)"
liveoutedge="$(find ./ -name "*.txt" | grep -i liveout | grep -i edge)"
if [ $R -eq 0 ]; then
R=4
fi
#echo "Num regs is $R"
#Instruction Generator
echo Instruction Generator
if [ $ALGO == "FalconCrimson" ]; then
echo running FalcomCrimson
$opcodegen1 $finalnode $edge $llvmnode $llvmedge $obj prolog.sch kernel.sch epilog.sch $X $Y $R $liveoutnode $liveoutedge > cgra_instructions.txt
else
echo Running something else
#$opcodegen $finalnode $edge $llvmnode $llvmedge $obj prolog.sch kernel.sch epilog.sch $X $Y $R $liveoutnode $liveoutedge > cgra_instructions.txt
$opcodegen $finalnode $edge $llvmnode $llvmedge $obj prolog.sch kernel.sch epilog.sch $X $Y $R $liveoutnode $liveoutedge &> cgra_instructions.debug
fi

View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

10
benchmarks/max/Makefile Normal file
View File

@ -0,0 +1,10 @@
FILE1 = max.c
all: max
CC = cgracc
LIB = -lm
max: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o max
clean:
rm -rf max CGRAExec m5out

101
benchmarks/max/max.c Normal file
View File

@ -0,0 +1,101 @@
/*
* This example shows the double max and min search kernel
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define VECTOR_MAX 100
/*void find_max(int count){
int vector[VECTOR_MAX] = {
136, -227, 66, -10, 34, 27, -50, 210, 190, -30,
-12, -121, -33, 41, 64, -190, 141, -20, 198, -44,
112, 6, -16, 109, -134, -202, 83, 132, 91, 72,
242, 15, 100, -139, -155, -167, -231, 62, 79, 223,
242, 120, -81, 128, -107, -160, -107, -99, 244, -26,
-225, 238, 224, 126, -157, -5, -71, -29, 91, 215,
-149, 159, 157, 37, 65, -123, 121, -99, 183, -122,
-166, -223, 1, 243, -132, 89, -125, 195, -251, 146,
-129, -194, 15, -127, 134, -136, 228, -161, -108, 229,
106, -57, -240, -253, 17, -136, -21, 79, 167, 191 };
int a = vector[0]; // Max value
int b = INT32_MIN; // 2nd max value
int c = 0; // Max index
int d = -1; // 2nd max index
#pragma CGRA
for(unsigned i=1; i<count; i++) {
int temp = vector[i];
if (temp > a) { // Largest value found => b<-a, a<-vector[i]
b = a;
a = temp;
d = c;
c = i;
} else if (temp > b) { // 2nd largest found
b = temp;
d = i;
}
}
printf("Maximum 1 value = %d\n", a);
printf("Maximum 1 index = %d\n", c);
printf("Maximum 2 value = %d\n", b);
printf("Maximum 2 index = %d\n", d);
return;
}*/
int main(int32_t argc, char* argv[]){
if(argc < 2){
printf("Pass count to program\n");
return 0;
}
int vector[VECTOR_MAX] = {
136, -227, 66, -10, 34, 27, -50, 210, 190, -30,
-12, -121, -33, 41, 64, -190, 141, -20, 198, -44,
112, 6, -16, 109, -134, -202, 83, 132, 91, 72,
242, 15, 100, -139, -155, -167, -231, 62, 79, 223,
242, 120, -81, 128, -107, -160, -107, -99, 244, -26,
-225, 238, 224, 126, -157, -5, -71, -29, 91, 215,
-149, 159, 157, 37, 65, -123, 121, -99, 183, -122,
-166, -223, 1, 243, -132, 89, -125, 195, -251, 146,
-129, -194, 15, -127, 134, -136, 228, -161, -108, 229,
106, -57, -240, -253, 17, -136, -21, 79, 167, 191 };
int count = atoi(argv[1]);
count = (count >= 100)? 100:count; // cap at 100 max
printf("Find max of %d numbers\n", count);
//find_max(count);
int a = vector[0]; // Max value
int b = INT32_MIN; // 2nd max value
int c = 0; // Max index
int d = -1; // 2nd max index
#pragma CGRA
for(unsigned i=1; i<count; i++) {
int temp = vector[i];
if (temp > a) { // Largest value found => b<-a, a<-vector[i]
b = a;
a = temp;
d = c;
c = i;
} else if (temp > b) { // 2nd largest found
b = temp;
d = i;
}
}
printf("Maximum 1 value = %d\n", a);
printf("Maximum 1 index = %d\n", c);
printf("Maximum 2 value = %d\n", b);
printf("Maximum 2 index = %d\n", d);
return 0;
}

88
benchmarks/max/max.c~ Normal file
View File

@ -0,0 +1,88 @@
/*
* This example shows the double max and min search kernel
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define VECTOR_MAX 100
void find_max(int count){
int vector[VECTOR_MAX] = {
136, -227, 66, -10, 34, 27, -50, 210, 190, -30,
-12, -121, -33, 41, 64, -190, 141, -20, 198, -44,
112, 6, -16, 109, -134, -202, 83, 132, 91, 72,
242, 15, 100, -139, -155, -167, -231, 62, 79, 223,
242, 120, -81, 128, -107, -160, -107, -99, 244, -26,
-225, 238, 224, 126, -157, -5, -71, -29, 91, 215,
-149, 159, 157, 37, 65, -123, 121, -99, 183, -122,
-166, -223, 1, 243, -132, 89, -125, 195, -251, 146,
-129, -194, 15, -127, 134, -136, 228, -161, -108, 229,
106, -57, -240, -253, 17, -136, -21, 79, 167, 191 };
int a = vector[0]; // Max value
int b = INT32_MIN; // 2nd max value
int c = 0; // Max index
int d = -1; // 2nd max index
#pragma CGRA
for(unsigned i=1; i<count; i++) {
int temp = vector[i];
if (temp > a) { // Largest value found => b<-a, a<-vector[i]
b = a;
a = temp;
d = c;
c = i;
} else if (temp > b) { // 2nd largest found
b = temp;
d = i;
}
}
printf("Maximum 1 value = %d\n", a);
printf("Maximum 1 index = %d\n", c);
printf("Maximum 2 value = %d\n", b);
printf("Maximum 2 index = %d\n", d);
return;
}
int main(int32_t argc, char* argv[]){
if(argc < 2){
printf("Pass count to program\n");
return 0;
}
int count = atoi(argv[1]);
count = (count >= 100)? 100:count; // cap at 100 max
printf("Find max of %d numbers\n", count);
//find_max(count);
int a = vector[0]; // Max value
int b = INT32_MIN; // 2nd max value
int c = 0; // Max index
int d = -1; // 2nd max index
#pragma CGRA
for(unsigned i=1; i<count; i++) {
int temp = vector[i];
if (temp > a) { // Largest value found => b<-a, a<-vector[i]
b = a;
a = temp;
d = c;
c = i;
} else if (temp > b) { // 2nd largest found
b = temp;
d = i;
}
}
printf("Maximum 1 value = %d\n", a);
printf("Maximum 1 index = %d\n", c);
printf("Maximum 2 value = %d\n", b);
printf("Maximum 2 index = %d\n", d);
return 0;
}

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

View File

@ -0,0 +1,14 @@
X,8
Y,8
R,8
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02

View File

@ -0,0 +1,11 @@
FILE1 = double_min_max.c main.c
all: min_max
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm -lrt
min_max: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o min_max
clean:
rm -rf min_max CGRAExec m5out

View File

@ -0,0 +1,80 @@
#include <stdio.h>
#include <stdint.h>
#include "double_min_max.h"
#define MAX_SEARCH
#define MIN_SEARCH
void double_min_max(int32_t *arg[])
{
int32_t* vec = arg[0];
int32_t length = *(arg[1]);
int32_t a, b, c, d;
#ifdef MAX_SEARCH
printf("Maximum search\n");
/*kernel_res[0] = vec[0];
kernel_res[1] = INT32_MIN;
kernel_res[2] = 0;
kernel_res[3] = -1;*/
a = vec[0];
b = INT32_MIN;
c = 0;
d = -1;
#pragma CGRA
for(int32_t i=1; i<length; i++) {
if (vec[i] > a) {
b = a;
a = vec[i] ;
d = c;
c = i;
} else if (vec[i] > b) {
b = vec[i];
d = i;
}
}
printf("Maximum 1 index = %d\n", a);
printf("Maximum 1 value = %d\n", c);
printf("Maximum 2 index = %d\n", b);
printf("Maximum 2 value = %d\n", d);
#endif // MAX_SEARCH
#ifdef MIN_SEARCH
printf("Minimum search\n");
/*kernel_res[0] = vec[0];
kernel_res[1] = INT32_MAX;
kernel_res[2] = 0;
kernel_res[3] = -1;*/
a = vec[0];
b = INT32_MIN;
c = 0;
d = -1;
for(int i=1; i<length; i++) {
if (vec[i] < a) {
b = a;
a = vec[i] ;
d = c;
c = i;
} else if (vec[i] < b) {
b = vec[i];
d = i;
}
}
printf("Minimum 1 index = %d\n", a);
printf("Minimum 1 value = %d\n", c);
printf("Minimum 2 index = %d\n", d);
printf("Minimum 2 value = %d\n", b);
#endif // MIN_SEARCH
}

View File

@ -0,0 +1,9 @@
#ifndef _DOUBLE_MIN_MAX_
#define _DOUBLE_MIN_MAX_
#include <stdlib.h>
#include <limits.h>
void double_min_max(int32_t *arg[]);
#endif // _DOUBLE_MIN_MAX_

29
benchmarks/min_max/main.c Normal file
View File

@ -0,0 +1,29 @@
/*
* This example shows the double max and min search kernel
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "double_min_max.h"
#include "stimuli.h"
int32_t *arg[4];
int main(int32_t argc, char* argv[])
{
printf("Entering main function\n");
//int end = INPUT_LENGTH;
int end = atoi(argv[1]);
arg[0] = &stimuli[0];
arg[1] = &end;
double_min_max(arg);
printf("Leaving main function\n");
return 0;
}

70
benchmarks/min_max/out Normal file
View File

@ -0,0 +1,70 @@
/home/local/ASUAD/quoclon1/publish_ccf/benchmarks/min_max
5
Simulation for CGRA for 4 x 4 with 4 registers per PE
CPU frequency @ 2GHz
CGRA frequency @ 0.7GHz
CGRA4x4R4torus
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
gem5 Simulator System. http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.
gem5 version 20.1.0.4
gem5 compiled Aug 20 2021 18:45:51
gem5 started Aug 22 2021 23:19:38
gem5 executing on en4181851l, pid 2938338
command line: /home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt --debug-flags=CGRA_Detailed,CGRA_Execute /home/local/ASUAD/quoclon1/publish_ccf/gem5/configs/example/se.py -n 1 --cpu-type CGRA4x4R4torus -c ./min_max -o 5
**** REAL SIMULATION ****
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: No dot file generated. Please install pydot to generate the dot file and pdf.
info: Entering event queue @ 0. Starting simulation...
info: Increasing stack size by one page.
warn: ignoring syscall mprotect(...)
createCGRA
checkTotalLoops
from cgra.c Initialize Parameters
panic: panic condition !handled occurred: Page table fault when accessing virtual address 0
Memory Usage: 648252 KBytes
Program aborted at tick 9485000
--- BEGIN LIBC BACKTRACE ---
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x21420c0)[0x561a372ea0c0]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x21565fe)[0x561a372fe5fe]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fd9d5fa03c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7fd9d557b18b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fd9d555a859]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x4feae5)[0x561a356a6ae5]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x21958ee)[0x561a3733d8ee]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x180f1d7)[0x561a369b71d7]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x181e67c)[0x561a369c667c]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x214a139)[0x561a372f2139]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x216bcd8)[0x561a37313cd8]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x216cacd)[0x561a37314acd]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x7ccea0)[0x561a35974ea0]
/home/local/ASUAD/quoclon1/publish_ccf/gem5/build/ARM/gem5.opt(+0x62e26f)[0x561a357d626f]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x2a8738)[0x7fd9d6256738]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x8dd8)[0x7fd9d602bf48]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb)[0x7fd9d6178e3b]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x94)[0x7fd9d6256114]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7fd9d6022d6d]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x7d86)[0x7fd9d602aef6]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x8006b)[0x7fd9d602e06b]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7fd9d6022d6d]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x12fd)[0x7fd9d602446d]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb)[0x7fd9d6178e3b]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyFunction_Vectorcall+0x94)[0x7fd9d6256114]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x74d6d)[0x7fd9d6022d6d]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x7d86)[0x7fd9d602aef6]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x8fb)[0x7fd9d6178e3b]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(PyEval_EvalCodeEx+0x42)[0x7fd9d61791c2]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(PyEval_EvalCode+0x1f)[0x7fd9d61795af]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x1cfbf1)[0x7fd9d617dbf1]
/usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0(+0x25f537)[0x7fd9d620d537]
--- END LIBC BACKTRACE ---
/home/local/ASUAD/quoclon1/sw/bin/cgraexe: line 66: 2938338 Aborted (core dumped) ${ccf_root}/gem5/build/ARM/gem5.opt --debug-flags=CGRA_Detailed,CGRA_Execute ${ccf_root}/gem5/configs/example/se.py -n 1 --cpu-type "CGRA${X}x${Y}R${R}torus" -c ./${executable} -o ${args}

View File

@ -0,0 +1,20 @@
#ifndef _STIMULI_H_
#define _STIMULI_H_
#include <stdlib.h>
#define INPUT_LENGTH 100
int32_t stimuli[INPUT_LENGTH] = {
136, -227, 66, -10, 34, 27, -50, 210, 198, -30,
-12, -121, -33, 41, 64, -190, 141, -20, 190, -44,
112, 6, -16, 109, -134, -202, 83, 132, 91, 72,
242, 15, 100, -139, -155, -167, -231, 62, 79, 223,
242, 120, -81, 128, -107, -160, -107, -99, 244, -26,
-225, 238, 224, 126, -157, -5, -71, -29, 91, 215,
-149, 159, 157, 37, 65, -123, 121, -99, 183, -122,
-166, -223, 1, 243, -132, 89, -125, 195, -251, 146,
-129, -194, 15, -127, 134, -136, 228, -161, -108, 229,
106, -57, -240, -253, 17, -136, -21, 79, 167, 191};
#endif // _STIMULI_H_

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

11
benchmarks/pow/Makefile Normal file
View File

@ -0,0 +1,11 @@
FILE1 = pow.c
all: pow
CC = cgracc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
pow: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o pow
clean:
rm -rf pow CGRAExec m5out *.bc *.ll

5223
benchmarks/pow/out Normal file

File diff suppressed because it is too large Load Diff

33
benchmarks/pow/pow.c Normal file
View File

@ -0,0 +1,33 @@
#include <stdio.h>
#include <stdlib.h>
/*int sum(int count){
int ret=0;
//int vec[10] = {1,2,3,4,5,6,7,8,9,10};
#pragma CGRA
for(int i=0; i<count; i++)
ret += i;
return ret;
}*/
int power(int base, int pow){
if(pow == 0) return 1;
printf("Base = %d - Pow = %d\n", base, pow);
int ret = base;
#pragma CGRA
for(int i = 1; i < pow - 1; i++)
ret *= base;
return ret;
}
int main(int argc, char *argv[])
{
int pow = atoi(argv[1]);
int ret = power(2, pow);
//int ret = sum(pow);
printf("***** %d^%d = %d *****\n", 2, pow, ret);
}

34
benchmarks/pow/pow.c~ Normal file
View File

@ -0,0 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
/*int sum(int count){
int ret=0;
//int vec[10] = {1,2,3,4,5,6,7,8,9,10};
#pragma CGRA
for(int i=0; i<count; i++)
ret += i;
return ret;
}*/
int power(int base, int pow){
if(pow == 0) return 1;
printf("Base = %d - Pow = %d\n", base, pow);
int ret = base;
#pragma CGRA
for(int i = 1; i < pow - 1; i++)
ret *= base;
return ret;
}
int main(int argc, char *argv[])
{
int base = atoi(argv[1])/100;
int pow = atoi(argv[1]) - (100*base);
int ret = power(base, pow);
//int ret = sum(pow);
printf("***** %d^%d = %d *****\n", base, pow, ret);
}

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

View File

@ -0,0 +1,11 @@
FILE1 = prime.c
all: prime
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
prime: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o prime
clean:
rm -rf prime CGRAExec m5out

View File

@ -0,0 +1,23 @@
#include <stdio.h>
int prime_check(int num){
int ret=1;
#pragma CGRA
for(int i=2; i< (num/2 +1); i++){
if(num%i == 0) ret = 0;
}
return ret;
}
int main(int argc, char* argv[]){
int num = atoi(argv[1]);
printf("Checking %d for prime\n", num);
int prime = prime_check(num);
if(prime) printf("%d is prime\n", num);
else printf("%d is not prime\n", num);
return 0;
}

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

View File

@ -0,0 +1,14 @@
X,8
Y,8
R,8
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02

View File

@ -0,0 +1,11 @@
FILE1 = add.c
all: loop
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
loop: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o loop
clean:
rm -rf loop CGRAExec m5out

View File

@ -0,0 +1,11 @@
FILE1 = add.c
all: loop
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
loop: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o loop
clean:
rm -rf loop output* CGRAExec m5out

View File

@ -0,0 +1,27 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int iterations = atoi(argv[1]);
int a=30, b=3, result = 0;
int c = 0;
//char d = 'W', e;
int i;
#pragma CGRA
for(i=0;i<iterations; i++)
{
if(i<5)
c += a+b;
result++;
}
//printf("Address: %x\n", &result);
printf("iterations:%d\t, c:%d, result:%d\n", iterations, c , result);
}

36190
benchmarks/simple_loop/out Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
X,4
Y,4
R,4
IC,0
Cclock,0.7
CPUclock,2
Mem,8GB
MODE,0
ALGO,RAMP
MSA,10
MAPII,10
MAX_MAP,1000
MAX_II,50
LAMBDA,0.02
1 X 4
2 Y 4
3 R 4
4 IC 0
5 Cclock 0.7
6 CPUclock 2
7 Mem 8GB
8 MODE 0
9 ALGO RAMP
10 MSA 10
11 MAPII 10
12 MAX_MAP 1000
13 MAX_II 50
14 LAMBDA 0.02

11
benchmarks/sum/Makefile Normal file
View File

@ -0,0 +1,11 @@
FILE1 = sum.c
all: sum
CC = cgracc #gcc
ARMCC = arm-linux-gnueabi-gcc
LIB = -lm
sum: ${FILE1} Makefile
$(CC) -static -O3 ${FILE1} -o sum
clean:
rm -rf sum CGRAExec m5out

16
benchmarks/sum/sum.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
int ret=0;
int count = atoi(argv[1]);
#pragma CGRA
for(int i=0; i<=count; i++)
if(i<count)
ret += i;
printf("Sum from 0 to %d = %d\n", count, ret);
return 1;
}

16
benchmarks/sum/sum.c~ Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
int ret=0;
int count = atoi(argv[1]);
#pragma CGRA
for(int i=0; i<=count; i++)
if(i<count+1)
ret += i;
printf("Sum from 0 to %d = %d\n", count, ret);
return 1;
}