Skip to content

Commit eb8fdb8

Browse files
committed
cachelab part2 failed to accomplish
1 parent 27190b3 commit eb8fdb8

File tree

9 files changed

+1671465
-17
lines changed

9 files changed

+1671465
-17
lines changed

CacheLab/cachelab-handout/.csim_results

Lines changed: 0 additions & 1 deletion
This file was deleted.

CacheLab/cachelab-handout/csim

-24.9 KB
Binary file not shown.
-10 KB
Binary file not shown.

CacheLab/cachelab-handout/task.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# CacheLab
22

3+
## PartA Cache Simulator
34
任务分解:
45
1.程序参数的输入
56
getopt function
@@ -66,5 +67,48 @@ getopt用法
6667
}
6768
}
6869

69-
test
70-
70+
71+
72+
73+
## PartB Matrix Transpose
74+
目标是写出尽可能降低不命中率的倒置函数
75+
76+
char transpose_submit_desc[] = "Transpose submission";
77+
void transpose_submit(int M, int N, int A[N][M], int B[M][N]);
78+
79+
### 要求:
80+
- 编译没有警告
81+
- 最多可以定义12个int 变量在每个倒置函数中
82+
- 不能用迭代
83+
- 如果用了helper functions ,helper functions 和 transpose func 加起来的变量不能超过12个
84+
- 不能修改数组A
85+
86+
### Evaluation For PartB
87+
88+
• 32 × 32 (M = 32, N = 32)
89+
• 64 × 64 (M = 64, N = 64)
90+
• 61 × 67 (M = 61, N = 67)
91+
• 32 × 32: 8 points if m < 300, 0 points if m > 600
92+
• 64 × 64: 8 points if m < 1, 300, 0 points if m > 2, 000
93+
• 61 × 67: 10 points if m < 2, 000, 0 points if m > 3, 000
94+
95+
使用的cache规模是(s = 5, E = 1, b = 5).
96+
97+
linux> make
98+
linux> ./test-trans -M 32 -N 32
99+
### Working on PartB
100+
101+
可以自己写多种版本的transfunctions,每个的格式如下:
102+
103+
char trans_simple_desc[] = "A simple transpose";
104+
void trans_simple(int M, int N, int A[N][M], int B[M][N])
105+
{
106+
/* your transpose code here */
107+
}
108+
--------------------------------------------------------------
109+
registerTransFunction(trans_simple, trans_simple_desc);
110+
111+
改进建议:
112+
1.因为是直接映射cache,所以冲突不命中是一个主要的问题
113+
2.分块是一个好办法
114+
3.可以使用./csim-ref -v -s 5 -E 1 -b 5 -t trace.f0 来查看具体的情况
-31.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)