2021-03-23 18:54:29 +00:00
|
|
|
#include "header.h"
|
|
|
|
|
|
|
|
int main(){
|
2021-05-24 16:13:33 +00:00
|
|
|
//int res = icache_spill_test();
|
2021-05-31 21:11:12 +00:00
|
|
|
global_hist_3_space_test();
|
|
|
|
global_hist_2_space_test();
|
2021-06-01 15:57:43 +00:00
|
|
|
global_hist_1_space_test();
|
|
|
|
global_hist_0_space_test();
|
2021-05-24 16:13:33 +00:00
|
|
|
int res = 1;
|
2021-03-23 18:54:29 +00:00
|
|
|
if (res < 0) {
|
|
|
|
fail();
|
|
|
|
return 0;
|
Created special test for driving the instruction spill error.
The extact problem occurs when a 4 byte instruction startles two cache blocks (or without a cache two ahbi words) and the code jumps to a cache block other than the next cache block. Consider the following sample of code.
0000000000000080 <test_spill>:
80: 42a9 li t0,10
82: 0001 nop
84: 0001 nop
86: 0001 nop
88: 02bd addi t0,t0,15
8a: 00628e33 add t3,t0,t1
8e: 01ce8963 beq t4,t3,a0 <match>
0000000000000092 <failure>:
92: 557d li a0,-1
94: 8082 ret
96: 00000013 nop
9a: 00000013 nop
9e: 0001 nop
00000000000000a0 <match>:
a0: 1ffd addi t6,t6,-1
a2: fc0f9fe3 bnez t6,80 <test_spill>
a6: 4501 li a0,0
a8: 8082 ret
Instructions 0x88, 0x8a and 0x8e are read incorrectly. However once the branch predictor begins to correctly predict the beq at 0x8e the instrution at 0xa0 is loaded incorrectly as the 2 upper bytes of 0x8e and the two bytes of 0x92. This amalgamation causes c.addi at 0xa0 to do something else and the loop never terminates.
The button of wavefile wave.do shows the exact problem in the 'icache'.
2021-04-08 20:05:08 +00:00
|
|
|
}else {
|
|
|
|
if((res = lbu_test()) < 0) {
|
|
|
|
fail();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
res = simple_csrbr_test();
|
2021-03-23 18:54:29 +00:00
|
|
|
return 0;
|
Created special test for driving the instruction spill error.
The extact problem occurs when a 4 byte instruction startles two cache blocks (or without a cache two ahbi words) and the code jumps to a cache block other than the next cache block. Consider the following sample of code.
0000000000000080 <test_spill>:
80: 42a9 li t0,10
82: 0001 nop
84: 0001 nop
86: 0001 nop
88: 02bd addi t0,t0,15
8a: 00628e33 add t3,t0,t1
8e: 01ce8963 beq t4,t3,a0 <match>
0000000000000092 <failure>:
92: 557d li a0,-1
94: 8082 ret
96: 00000013 nop
9a: 00000013 nop
9e: 0001 nop
00000000000000a0 <match>:
a0: 1ffd addi t6,t6,-1
a2: fc0f9fe3 bnez t6,80 <test_spill>
a6: 4501 li a0,0
a8: 8082 ret
Instructions 0x88, 0x8a and 0x8e are read incorrectly. However once the branch predictor begins to correctly predict the beq at 0x8e the instrution at 0xa0 is loaded incorrectly as the 2 upper bytes of 0x8e and the two bytes of 0x92. This amalgamation causes c.addi at 0xa0 to do something else and the loop never terminates.
The button of wavefile wave.do shows the exact problem in the 'icache'.
2021-04-08 20:05:08 +00:00
|
|
|
}
|
2021-03-23 18:54:29 +00:00
|
|
|
}
|