From: Anton Blanchard Date: Thu, 23 Sep 2021 02:23:22 +0000 (+1000) Subject: tests/misc: Add an icbi test X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00259458c7b8f99dc4e08d8c0c2adfa4a39883ae;p=microwatt.git tests/misc: Add an icbi test We have a bug where an icbi can cause an instruction to execute twice. Add a test case for this. Signed-off-by: Anton Blanchard --- diff --git a/tests/misc/head.S b/tests/misc/head.S index 9044c51..025f226 100644 --- a/tests/misc/head.S +++ b/tests/misc/head.S @@ -185,3 +185,33 @@ test_loadhitstore: or %r7,%r6,%r7 subf %r3,%r0,%r7 blr + +/* Test for double execution of addi */ +.balign 64 + .global test_icbi +test_icbi: +1: li %r3,0 + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + icbi 0,%r0 + nop + nop + nop + nop + nop + nop + nop + nop + addi %r3,%r3,1 + blr diff --git a/tests/misc/misc.c b/tests/misc/misc.c index 3cc0300..d5eb12e 100644 --- a/tests/misc/misc.c +++ b/tests/misc/misc.c @@ -16,6 +16,7 @@ extern long test_mfpvr(void); extern long test_mtpvr(void); extern long test_bdnzl(void); extern long test_loadhitstore(void); +extern long test_icbi(void); // i < 100 void print_test_number(int i) @@ -74,5 +75,12 @@ int main(void) } else puts(PASS); + print_test_number(7); + if (test_icbi() != 1) { + fail = 1; + puts(FAIL); + } else + puts(PASS); + return fail; } diff --git a/tests/test_misc.bin b/tests/test_misc.bin index 648ab18..0897d85 100755 Binary files a/tests/test_misc.bin and b/tests/test_misc.bin differ diff --git a/tests/test_misc.console_out b/tests/test_misc.console_out index 5296101..041accf 100644 --- a/tests/test_misc.console_out +++ b/tests/test_misc.console_out @@ -4,3 +4,4 @@ Test 03:PASS Test 04:PASS Test 05:PASS Test 06:PASS +Test 07:PASS