Fix icache test when dynamic target branch prediction is enabled

This commit is contained in:
Charles Papon 2019-04-09 19:37:18 +02:00
parent a6dc530441
commit 9b6b65b8b4
3 changed files with 35 additions and 26 deletions

View File

@ -6,43 +6,46 @@ Disassembly of section .crt_section:
80000000 <_start>:
80000000: 00000097 auipc ra,0x0
80000004: 04408093 addi ra,ra,68 # 80000044 <fail>
80000004: 04c08093 addi ra,ra,76 # 8000004c <fail>
80000008 <test1>:
80000008: 00100e13 li t3,1
8000000c: 00100093 li ra,1
80000010: 00300113 li sp,3
80000014: 00208093 addi ra,ra,2
80000018: 02209663 bne ra,sp,80000044 <fail>
80000018: 02209a63 bne ra,sp,8000004c <fail>
8000001c <test2>:
8000001c: 00200e13 li t3,2
80000020: 01300093 li ra,19
80000024: 00000117 auipc sp,0x0
80000028: 01810113 addi sp,sp,24 # 8000003c <test2_trigger>
80000028: 02010113 addi sp,sp,32 # 80000044 <test2_trigger>
8000002c: 0040006f j 80000030 <test2_aligned>
80000030 <test2_aligned>:
80000030: 00112023 sw ra,0(sp)
80000034: 0000100f fence.i
80000038: 0040006f j 8000003c <test2_trigger>
80000038: 00800a13 li s4,8
8000003c: fffa0a13 addi s4,s4,-1
80000040: fe0a1ee3 bnez s4,8000003c <test2_aligned+0xc>
8000003c <test2_trigger>:
8000003c: 0080006f j 80000044 <fail>
80000040: 0100006f j 80000050 <pass>
80000044 <test2_trigger>:
80000044: 0080006f j 8000004c <fail>
80000048: 0100006f j 80000058 <pass>
80000044 <fail>:
80000044: f0100137 lui sp,0xf0100
80000048: f2410113 addi sp,sp,-220 # f00fff24 <pass+0x700ffed4>
8000004c: 01c12023 sw t3,0(sp)
8000004c <fail>:
8000004c: f0100137 lui sp,0xf0100
80000050: f2410113 addi sp,sp,-220 # f00fff24 <pass+0x700ffecc>
80000054: 01c12023 sw t3,0(sp)
80000050 <pass>:
80000050: f0100137 lui sp,0xf0100
80000054: f2010113 addi sp,sp,-224 # f00fff20 <pass+0x700ffed0>
80000058: 00012023 sw zero,0(sp)
8000005c: 00000013 nop
80000060: 00000013 nop
80000058 <pass>:
80000058: f0100137 lui sp,0xf0100
8000005c: f2010113 addi sp,sp,-224 # f00fff20 <pass+0x700ffec8>
80000060: 00012023 sw zero,0(sp)
80000064: 00000013 nop
80000068: 00000013 nop
8000006c: 00000013 nop
80000070: 00000013 nop
80000074: 00000013 nop
80000078: 00000013 nop
...

View File

@ -1,10 +1,11 @@
:0200000480007A
:100000009700000093804004130E1000930010002E
:10001000130130009380200063962002130E20000D
:100020009300300117010000130181016F004000AF
:10003000232011000F1000006F0040006F008000AF
:100040006F000001370110F0130141F22320C101BC
:10005000370110F0130101F223200100130000000A
:100060001300000013000000130000001300000044
:040070001300000079
:10000000970000009380C004130E100093001000AE
:100010001301300093802000639A2002130E200009
:100020009300300117010000130101026F0040002E
:10003000232011000F100000130A8000130AFAFF9A
:10004000E31E0AFE6F0080006F000001370110F010
:10005000130141F22320C101370110F0130101F215
:100060002320010013000000130000001300000013
:100070001300000013000000130000000000000047
:04008000000000007C
:00000001FF

View File

@ -1,6 +1,11 @@
.globl _star
#define TEST_ID x28
#define delay \
li x20, 8; \
1: addi x20, x20, -1; \
bne x20, x0, 1b;
_start:
la x1, fail
// csrw mtvec, x1
@ -21,7 +26,7 @@ test2:
test2_aligned:
sw x1, 0(x2)
fence.i
j test2_trigger
delay
test2_trigger:
j fail