Skip to content

Commit

Permalink
Add a few more coherency tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Oct 11, 2023
1 parent d803c21 commit ed57ccb
Show file tree
Hide file tree
Showing 8 changed files with 1,411 additions and 1 deletion.
27 changes: 27 additions & 0 deletions baremetal/coherency/src/crt.S
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@ _start:
//r -> iow : OK



//Test amo with random timings
li REPEAT_COUNTER, 1000
la PTR, sharedE
test_amo_delayed:
amoadd.w x2,x1,(PTR)

//Random delay
la x1, RANDOM
lw x1, 0(x1)
andi x1, x1, 0xF
addi x1, x1, 1
mul x1, x1, x1
1:
addi x1, x1, -1
nop
bnez x1, 1b

addi REPEAT_COUNTER, REPEAT_COUNTER, -1
bnez REPEAT_COUNTER, test_amo_delayed




// check if a lr.w pulling could lockup other thread from using a block
test_lrsc_lockup:
li REPEAT_COUNTER, 100
Expand Down Expand Up @@ -239,6 +263,9 @@ sharedC:
sharedD:
.word 0x0
.word 0x0
sharedE:
.word 0x0
.word 0x0
lrsc_lockup_data:
.word 0x0
.align 12
Expand Down
1 change: 1 addition & 0 deletions baremetal/coherency_burst/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
3 changes: 3 additions & 0 deletions baremetal/coherency_burst/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PROJ_NAME=coherency_burst

include ../common/asm.mk
Loading

0 comments on commit ed57ccb

Please sign in to comment.