Skip to content

Commit fb0cf7d

Browse files
committed
Merge branch 'prerelease'
# Conflicts: # benchmarks/gemm/defines.h # src/hwacc/LLVMRead/src/base_instruction.cc # src/hwacc/LLVMRead/src/base_instruction.hh # src/hwacc/LLVMRead/src/basic_block.cc # src/hwacc/LLVMRead/src/instructions.cc # src/hwacc/LLVMRead/src/instructions.hh # src/hwacc/LLVMRead/src/macros.hh # src/hwacc/LLVMRead/src/registers.hh # src/hwacc/LLVMRead/src/utilization.cc # src/hwacc/LLVMRead/src/utilization.hh # src/hwacc/llvm_interface.cc # src/hwacc/llvm_interface.hh
1 parent 5003c58 commit fb0cf7d

File tree

38,924 files changed

+9138
-8377795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

38,924 files changed

+9138
-8377795
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
2+
build-
23
parser.out
34
parsetab.py
45
cscope.files
@@ -9,6 +10,8 @@ cscope.out
910
.*.swo
1011
m5out
1112
/src/doxygen
13+
/src/hwacc/llvm
14+
/src/hwacc/llvm-c
1215
/ext/dramsim2/DRAMSim2
1316
/ext/mcpat/regression/*/*.out
1417
/util/m5/*.o
@@ -28,4 +31,7 @@ m5out
2831
/system/arm/aarch64_bootloader/boot_emm.arm64
2932
/system/arm/aarch64_bootloader/boot_emm_v2.arm64
3033
old-code
34+
llvm
35+
llvm-9
36+
llvm-c
3137
BM_ARM_OUT

baremetalarm.sh

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
FLAGS="HWACC"
2+
FLAGS="JDEV"
33
BENCH=""
44
DEBUG="false"
55
PRINT_TO_FILE="false"
@@ -64,19 +64,4 @@ else
6464
$RUN_SCRIPT
6565
fi
6666

67-
# Debug Flags List
68-
#
69-
# IOAcc
70-
# ClassDetail
71-
# CommInterface
72-
# ComputeUnit
73-
# LLVMInterface
74-
# ComputeNode
75-
# LLVMRegister
76-
# LLVMOp
77-
# LLVMParse
78-
# LLVMGEP
79-
# LLVMRuntime == ComputeNode + LLVMRegister + LLVMOp + LLVMParse
80-
# NoncoherentDma - bfs, fft, gemm, md-knn, nw, spmv
81-
8267

benchmarks/bfs/bench/bfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Hong, Oguntebi, Olukotun. "Efficient Parallel Graph Exploration on Multi-Core CP
66

77
#include "bfs.h"
88

9+
// int horizon_value = 1;
10+
911
void bfs(node_t nodes[N_NODES], edge_t edges[N_EDGES],
1012
node_index_t starting_node, level_t level[N_NODES],
1113
edge_index_t level_counts[N_LEVELS])

benchmarks/fft/config.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[CycleCounts]
2-
counter = 1
2+
counter = 0
33
gep = 0
44
phi = 0
55
select = 1
@@ -92,7 +92,7 @@ data_bases = 0
9292
addr_range = 0x2f100000
9393
size = 131072
9494
latency = 2ns
95-
ports = 8
95+
ports = 16
9696
ready_mode = True
9797
reset_on_private_read = False
9898

benchmarks/fir/defines.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include "stdint.h"
55

6-
#define SPM
7-
//#define CHECK
6+
// #define SPM
7+
#define CHECK
88
#define TEST
99

1010
#ifdef TEST

benchmarks/gemm-full-unroll/bench/gemm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void gemm( TYPE m1[N], TYPE m2[N], TYPE prod[N] ){
88
int i, j, k;
99
int k_col, i_col;
1010
TYPE mult;
11-
#pragma clang loop unroll(full)
11+
#pragma clang loop unroll_count(8)
1212
for(i=0;i<row_size;i++) {
1313
#pragma clang loop unroll(full)
1414
for(j=0;j<col_size;j++) {

benchmarks/gemm/bench/Makefile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
KERN=gemm
2-
TARGET=$(KERN).ll
3-
%.o : %.c
4-
clang -emit-llvm -c -o $@ $<
5-
%.bc : %.o
6-
opt -O1 -mem2reg -simplifycfg -loops -loop-unroll -o $@ $<
7-
%.ll : %.bc
8-
llvm-dis -o $@ $<
9-
build : $(TARGET)
1+
KERN=gemm.c
2+
build: $(FILES)
3+
clang -O1 -S -fno-slp-vectorize -fno-vectorize -fno-unroll-loops -fno-inline -fno-builtin -emit-llvm $(KERN)
104

115
clean:
126
rm -f *.ll

benchmarks/gemm/bench/gemm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ void gemm( TYPE m1[N], TYPE m2[N], TYPE prod[N] ){
1010
TYPE mult;
1111
//#pragma clang loop unroll_count(8)
1212
for(i=0;i<row_size;i++) {
13-
//#pragma clang loop unroll(full)
13+
//#pragma clang loop unroll_count(8)
1414
for(j=0;j<col_size;j++) {
1515
i_col = i * col_size;
1616
TYPE sum = 0;
17-
//#pragma clang loop unroll_count(8)
1817
#pragma clang loop unroll(full)
1918
for(k=0;k<row_size;k++) {
2019
k_col = k * col_size;

benchmarks/gemm/defines.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef __DEFINES_H__
22
#define __DEFINES_H__
33

4-
#define SPM
5-
#define CHECK
4+
//#define SPM
5+
//#define CHECK
66

77
#define TYPE double
88
#define ROW 64

benchmarks/hotspot/defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "stdint.h"
55

66
#define SPM
7-
//#define CHECK
7+
#define CHECK
88
#define TEST
99

1010
#ifdef TEST

benchmarks/hotspot/host/hotspot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int checkData(hotspot_struct * hss) {
2323

2424
for (i = 0; i < GRID_COLS*GRID_ROWS; i++) {
2525
error = (hss->result[i]-hss->check[i])/hss->result[i]*100;
26-
printf("Error[%d] = %f%\n",i, error);
26+
// printf("Error[%d] = %f%\n",i, error);
2727
if(error >= 0.1) {
2828
printf("Check Failed\n");
2929
return 0;

benchmarks/md-grid/defines.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#include "stdint.h"
55

6-
#define SPM
7-
//#define CHECK
6+
//#define SPM
7+
#define CHECK
88
//#define TEST
99

1010
#ifdef TEST

benchmarks/md-knn/config.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ data_bases = 0
9292
addr_range = 0x2f100000
9393
size = 131072
9494
latency = 2ns
95-
ports = 8
95+
ports = 2
9696
ready_mode = True
9797
reset_on_private_read = False
9898

benchmarks/md-knn/defines.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#include "stdint.h"
55

66
#define SPM
7-
//#define CHECK
7+
#define CHECK
88
//#define TEST
99

10-
#ifdef TEST
10+
//#ifdef TEST
1111
#define TYPE double
1212
// Problem Constants
1313
#define nAtoms 256
@@ -16,13 +16,13 @@
1616
#define lj1 1.5
1717
#define lj2 2.0
1818

19-
#else
20-
#define TYPE double
19+
//#else
20+
//#define TYPE double
2121
// Problem Constants
22-
#define nAtoms 256
23-
#define maxNeighbors 16
22+
//#define nAtoms 256
23+
//#define maxNeighbors 16
2424
// LJ coefficients
25-
#define lj1 1.5
26-
#define lj2 2.0
27-
#endif
25+
//#define lj1 1.5
26+
//#define lj2 2.0
27+
//#endif
2828
#endif

benchmarks/md-knn/host/data.c

Lines changed: 1 addition & 3 deletions
Large diffs are not rendered by default.

benchmarks/md-knn/host/main.cpp

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ int main(void) {
5050
common_val = 0;
5151

5252
//#ifndef SPM
53-
mds.force_x = force_x;
54-
mds.force_y = force_y;
55-
mds.force_z = force_z;
56-
mds.position_x = position_x;
57-
mds.position_y = position_y;
58-
mds.position_z = position_z;
59-
mds.NL = NL;
60-
mds.check_x = check_x;
61-
mds.check_y = check_y;
62-
mds.check_z = check_z;
63-
/*
64-
#else
53+
// mds.force_x = force_x;
54+
// mds.force_y = force_y;
55+
// mds.force_z = force_z;
56+
// mds.position_x = position_x;
57+
// mds.position_y = position_y;
58+
// mds.position_z = position_z;
59+
// mds.NL = NL;
60+
// mds.check_x = check_x;
61+
// mds.check_y = check_y;
62+
// mds.check_z = check_z;
63+
64+
//#else
6565
mds.force_x = spmfx;
6666
mds.force_y = spmfy;
6767
mds.force_z = spmfz;
@@ -72,8 +72,8 @@ int main(void) {
7272
mds.check_x = check_x;
7373
mds.check_y = check_y;
7474
mds.check_z = check_z;
75-
#endif
76-
*/
75+
//#endif
76+
7777
printf("Generating data\n");
7878
genData(&mds);
7979
printf("Data generated\n");
@@ -96,16 +96,16 @@ int main(void) {
9696
loc_NL = (uint64_t)(SPM_BASE+NL_OFFSET);
9797

9898

99-
dmacpy(spmpx, position_x, sizeof(TYPE)*nAtoms);
99+
dmacpy(spmpx, mds.position_x, sizeof(TYPE)*nAtoms);
100100
while(!pollDma());
101101
resetDma();
102-
dmacpy(spmpy, position_y, sizeof(TYPE)*nAtoms);
102+
dmacpy(spmpy, mds.position_y, sizeof(TYPE)*nAtoms);
103103
while(!pollDma());
104104
resetDma();
105-
dmacpy(spmpz, position_z, sizeof(TYPE)*nAtoms);
105+
dmacpy(spmpz, mds.position_z, sizeof(TYPE)*nAtoms);
106106
while(!pollDma());
107107
resetDma();
108-
dmacpy(spmnl, NL, sizeof(int32_t)*nAtoms*maxNeighbors);
108+
dmacpy(spmnl, mds.NL, sizeof(int32_t)*nAtoms*maxNeighbors);
109109
while(!pollDma());
110110
resetDma();
111111

@@ -134,7 +134,7 @@ int main(void) {
134134
#endif
135135
acc = 0x00;
136136
#ifdef CHECK
137-
137+
printf("Data Check\n");
138138
if(!checkData(&mds)) {
139139
/* int checkvals = 0;
140140
int errors = 0;
@@ -174,6 +174,7 @@ int main(void) {
174174
}
175175

176176
#endif
177-
*(char *)0x7fffffff = 1; //Kill the simulation
178-
//m5_exit();
177+
//*(char *)0x7fffffff = 1; //Kill the simulation
178+
m5_dump_stats();
179+
m5_exit();
179180
}

benchmarks/md-knn/host/md.h

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define loc_position_z *(int *)0x2f000029
1313
#define loc_NL *(int *)0x2f000031
1414

15-
#define EPSILON 1.0e-2
15+
#define EPSILON 1.0e-8
1616

1717
typedef struct {
1818
TYPE * force_x;
@@ -35,14 +35,19 @@ int checkData(md_struct * mds) {
3535
}
3636
return 0;
3737
*/
38-
38+
printf("Checking Data\n");
3939
for (int i = 0; i < nAtoms; i++) {
40-
if ( (std::abs(mds->force_x[i]-mds->check_x[i])/mds->check_x[i] > EPSILON) ||
41-
(std::abs(mds->force_y[i]-mds->check_y[i])/mds->check_y[i] > EPSILON) ||
42-
(std::abs(mds->force_z[i]-mds->check_z[i])/mds->check_z[i] > EPSILON)) {
43-
printf("Check Failed\n");
44-
return 0;
45-
}
40+
41+
printf("X[%d] = %f || Xc[%d] = %f \n",i, mds->force_x[i], i, mds->check_x[i]);
42+
printf("Y[%d] = %f || Yc[%d] = %f \n",i, mds->force_y[i], i, mds->check_y[i]);
43+
printf("Z[%d] = %f || Zc[%d] = %f \n",i, mds->force_z[i], i, mds->check_z[i]);
44+
printf("\n");
45+
//if ( (std::abs(mds->force_x[i]-mds->check_x[i])/mds->check_x[i] > EPSILON) ||
46+
// (std::abs(mds->force_y[i]-mds->check_y[i])/mds->check_y[i] > EPSILON) ||
47+
// (std::abs(mds->force_z[i]-mds->check_z[i])/mds->check_z[i] > EPSILON)) {
48+
// printf("Check Failed\n");
49+
// return 0;
50+
//}
4651
}
4752
printf("Check Passed\n");
4853
return 1;
@@ -58,6 +63,7 @@ void genData(md_struct * mds) {
5863
mds->position_x[i] = p_x[i];
5964
mds->position_y[i] = p_y[i];
6065
mds->position_z[i] = p_z[i];
66+
printf("X[i] = %f || Y[i] = %f || Z[i] = %f",mds->position_x[i],mds->position_y[i],mds->position_z[i]);
6167
}
6268
for(i = 0; i < nAtoms*maxNeighbors; i++) {
6369
mds->NL[i] = n_l[i];

benchmarks/nw/config.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[CycleCounts]
2-
counter = 1
2+
counter = 0
33
gep = 0
44
phi = 0
5-
select = 1
5+
select = 0
66
ret = 1
77
br = 0
88
switch = 1
@@ -11,7 +11,7 @@ invoke = 1
1111
resume = 1
1212
unreachable = 1
1313
icmp = 0
14-
fcmp = 1
14+
fcmp = 0
1515
trunc = 0
1616
zext = 0
1717
sext = 0
@@ -92,7 +92,7 @@ data_bases = 0
9292
addr_range = 0x2f100000
9393
size = 131072
9494
latency = 2ns
95-
ports = 8
95+
ports = 32
9696
ready_mode = True
9797
reset_on_private_read = False
9898

benchmarks/nw/host/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ int main(void) {
109109
}
110110
}
111111
#endif
112-
*(char *)0x7fffffff = 1;
113-
//m5_exit();
112+
// *(char *)0x7fffffff = 1;
113+
m5_exit();
114114
}

benchmarks/nw/host/nw.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#define val_M *(int *)0x2f000021
1111
#define val_ptr *(int *)0x2f000029
1212

13+
#define CHECK
14+
1315
typedef struct {
1416
char * seqA;
1517
char * seqB;
@@ -32,6 +34,8 @@ int checkData(nw_struct * nws) {
3234
printf("Check Failed\n");
3335
return 0;
3436
}
37+
printf("Aligned A Value: %d \t Check A Value: %d\n", nws->alignedA[i], nws->checkA[i]);
38+
printf("Aligned B Value: %d \t Check B Value: %d\n", nws->alignedB[i], nws->checkB[i]);
3539
}
3640
printf("Check Passed\n");
3741
return 1;

benchmarks/spmv/bench/spmv.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ void spmv(TYPE val[NNZ], int32_t cols[NNZ], int32_t rowDelimiters[N+1], TYPE vec
1919
out[i] = sum;
2020
}
2121
}
22-
23-

0 commit comments

Comments
 (0)