Index: /trunk/softs/tests_ccvcache_v4/run_tests
===================================================================
--- /trunk/softs/tests_ccvcache_v4/run_tests	(revision 264)
+++ /trunk/softs/tests_ccvcache_v4/run_tests	(revision 265)
@@ -15,5 +15,5 @@
    test_dtlb_ptprinval test_itlb_ptprinval test_idtlb_ptprinval \
    test_sync \
-   test_sc_update_cache test_pte_llsc \
+   test_llsc test_sc_no_ll test_sc_update_cache test_pte_llsc \
    test_interrupt \
    test_interrupt_epc_modify \
Index: /trunk/softs/tests_ccvcache_v4/test_llsc/run
===================================================================
--- /trunk/softs/tests_ccvcache_v4/test_llsc/run	(revision 264)
+++ /trunk/softs/tests_ccvcache_v4/test_llsc/run	(revision 265)
@@ -1,7 +1,9 @@
 #!/bin/sh 
+
+. ../common/common.sh
 
 check_output()
 {
-	egrep "^0x00000000 0xAC4000FF 0xAC4000FF 0x00000000$" run.out > /dev/null
+	egrep "^0x0000DEAD 0x0000DEAD 0x0000BEEF 0x0000DEAD$" run.out > /dev/null
 	if [ $? -eq 0 ]; then
 		return 0;
@@ -12,5 +14,5 @@
 
 make --quiet || exit 1
-../platform/simulation.x > run.out 2>&1 
+${SIMUL} > run.out 2>&1 
 if [ $? -eq 0 ]; then
 	if check_output; then
Index: /trunk/softs/tests_ccvcache_v4/test_llsc/test.S
===================================================================
--- /trunk/softs/tests_ccvcache_v4/test_llsc/test.S	(revision 264)
+++ /trunk/softs/tests_ccvcache_v4/test_llsc/test.S	(revision 265)
@@ -31,5 +31,5 @@
 	PUTCHAR(' ')
 
-	/* now write to myvar via ll/sc
+	/* now write to myvar via ll/sc */
 	la	s1, myvar 
 1:
@@ -37,8 +37,17 @@
 	li	a1, MAGIC2
 	sc	a1, 0(s1)
-	beqz	a1, 2b
+	beqz	a1, 1b
 	nop
 
+	PRINTX /* print what we read with ll */
+	PUTCHAR(' ')
+
+	la	s1, myvar 
+	lw	a0, 0(s1) /* print the new value */
+	PRINTX
+	PUTCHAR(' ')
+
 	/* restore myvar value via normal write */
+	la	s1, myvar 
 	li	a1, MAGIC1
 	sw	a1, 0(s1)
@@ -93,5 +102,5 @@
 pte1:
 	.align 13
-	.word PTE1_V | PTE1_C | PTE1_W | 0x0 /* map PA 0 at VA 0 */
+	.word PTE1_V | PTE1_W | 0x0 /* map PA 0 at VA 0 */
 	.org pte1 + (BOOT_ADDRESS >> 21) * 4
 	.word PTE1_V | PTE1_C | PTE1_X | (BOOT_ADDRESS >> 21) /* map PA 0xbfc00000 at VA 0xbfc00000 */
Index: /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/Makefile
===================================================================
--- /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/Makefile	(revision 265)
+++ /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/Makefile	(revision 265)
@@ -0,0 +1,1 @@
+include ../Makefile.inc
Index: /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/run
===================================================================
--- /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/run	(revision 265)
+++ /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/run	(revision 265)
@@ -0,0 +1,28 @@
+#!/bin/sh 
+
+. ../common/common.sh
+
+check_output()
+{
+	egrep "^0x0000DEAD 0x00000000$" run.out > /dev/null
+	if [ $? -eq 0 ]; then
+		return 0;
+	fi
+	echo "couldn't find string in output - mtty not working ?" >> run.out
+	return 1
+}
+
+make --quiet || exit 1
+${SIMUL} > run.out 2>&1 
+if [ $? -eq 0 ]; then
+	if check_output; then
+		echo "test passsed";
+		make --quiet clean
+		exit 0;
+	fi
+	echo "test FAILED"
+	exit 1
+fi
+echo "test FAILED"
+exit 1
+
Index: /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/test.S
===================================================================
--- /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/test.S	(revision 265)
+++ /trunk/softs/tests_ccvcache_v4/test_sc_no_ll/test.S	(revision 265)
@@ -0,0 +1,104 @@
+/*
+ * check that a sc without ll does fail
+ */
+#include <registers.h>
+#include <misc.h>
+#include <vcache.h>
+
+	.text
+	.globl  _start
+_start:
+	.set noreorder
+	la	k0, TTY_BASE
+	la	k1, EXIT_BASE
+
+	/* reset cop0 status (keep BEV) */
+	lui	a0, 0x0040;
+	mtc0	a0, COP0_STATUS
+
+	la	a0, pte1
+	srl	a0, a0, 13
+	mtc2	a0, VC_PTPR
+	nop
+
+	li	a0, VC_TLB_EN_ITLB | VC_TLB_EN_DTLB | VC_TLB_EN_ICACHE | VC_TLB_EN_DCACHE
+	mtc2 	a0, VC_TLB_EN
+
+	/* make sure myvar is in cache */
+	la	s1, myvar 
+	lw	a0, 0(s1)
+	PRINTX
+	PUTCHAR(' ')
+
+	/* now write to myvar with sc, without ll first */
+	la	s1, myvar 
+1:
+	li	a1, MAGIC2
+	sc	a1, 0(s1)
+	beqz	a1, 2f
+	nop
+	
+	move a0, a1
+	PRINTX
+	/* we should not get there */
+	EXIT(1)
+
+2:
+	/* we jump here when the sc failed */
+	move a0, a1
+	PRINTX
+	PUTCHAR('\n');
+	EXIT(0)
+
+	.globl excep
+excep:
+	.set noreorder
+	PRINT(statusstr)
+	mfc0	a0, COP0_STATUS
+	PRINTX
+
+	PRINT(causestr)
+	mfc0	a0, COP0_CAUSE
+	PRINTX
+
+	PRINT(pcstr)
+	mfc0	a0, COP0_EXPC
+	PRINTX
+
+	PRINT(badvastr)
+	mfc0	a0, COP_0_BADVADDR
+	PRINTX
+
+	PUTCHAR('\n')
+	/* we should not get there */
+	EXIT(1)
+
+	.rodata:
+statusstr: .ascii "status \0"
+causestr: .ascii " cause \0"
+pcstr: .ascii " pc \0"
+badvastr: .ascii " badva \0"
+value:	.word 0x1234abcd
+string: .ascii "hello world \0"
+
+	.org EXCEP_ADDRESS - BOOT_ADDRESS
+	.globl evect
+evect:
+	j	excep
+	nop
+
+	.data
+myvar:	.word MAGIC1
+	.globl pte1
+pte1:
+	.align 13
+	.word PTE1_V | PTE1_W | 0x0 /* map PA 0 at VA 0 */
+	.org pte1 + (BOOT_ADDRESS >> 21) * 4
+	.word PTE1_V | PTE1_C | PTE1_X | (BOOT_ADDRESS >> 21) /* map PA 0xbfc00000 at VA 0xbfc00000 */
+	.org pte1 + (TTY_BASE >> 21) * 4
+	.word PTE1_V | PTE1_W | (TTY_BASE >> 21) /* map PA 0xd0200000 at VA 0xd0200000 */
+	.org pte1 + (EXIT_BASE >> 21) * 4
+	.word PTE1_V | PTE1_W | (EXIT_BASE >> 21) /* map PA 0xe0000000 at VA 0xe0000000 */
+	.org pte1 + 8192
+	.word 0
+
Index: /trunk/softs/tests_ccvcache_v4/test_sync/run.out
===================================================================
--- /trunk/softs/tests_ccvcache_v4/test_sync/run.out	(revision 264)
+++ /trunk/softs/tests_ccvcache_v4/test_sync/run.out	(revision 265)
@@ -1,4 +1,4 @@
 
-             SystemC 2.2.0 --- Apr 14 2011 18:52:40
+             SystemC 2.2.0 --- Jun  8 2009 14:24:30
         Copyright (c) 1996-2006 by all Contributors
                     ALL RIGHTS RESERVED
@@ -11,8 +11,7 @@
  <Segment "mdma_d": base = 0xe8000000 / size = 0x14 / tgtid = (5) / uncached>
 
-Mapping table: ad:(6) id:(6) cacheability mask: 0xf0000000
- <Segment "proc_c": base = 0x10000000 / size = 0x10 / tgtid = (0) / uncached / init = (0)>
- <Segment "memc_c": base = 0 / size = 0x2000010 / tgtid = (1) / uncached>
- <Segment "brom_c": base = 0xbfc00000 / size = 0x40000 / tgtid = (1) / uncached>
+Mapping table: ad:(14) id:(14) cacheability mask: 0xf0000000
+ <Segment "proc_c": base = 0 / size = 0x10 / tgtid = (0) / uncached>
+ <Segment "memc_c": base = 0x40000 / size = 0x10 / tgtid = (1) / uncached>
 
 Loading at 0xbfc00000 size 262144: .text 
