From 99914a94a8846662e759fbc779ccf5f3abf89405 Mon Sep 17 00:00:00 2001 From: Philip Smart Date: Fri, 25 Oct 2019 09:06:55 +0100 Subject: [PATCH] Tidy --- README.md | 6 +- IOCPMemoryMap.png => docs/IOCPMemoryMap.png | Bin .../ImplInstructions.png | Bin ZPUTAMemoryMap.png => docs/ZPUTAMemoryMap.png | Bin software/apps/mtest/mtest.c | 95 +++++++++++++++++- 5 files changed, 95 insertions(+), 6 deletions(-) rename IOCPMemoryMap.png => docs/IOCPMemoryMap.png (100%) rename ImplInstructions.png => docs/ImplInstructions.png (100%) rename ZPUTAMemoryMap.png => docs/ZPUTAMemoryMap.png (100%) diff --git a/README.md b/README.md index 48e0383..353de6e 100644 --- a/README.md +++ b/README.md @@ -222,7 +222,7 @@ Some extended instructions are under development (ie. LDIR) an exact opcode valu ##### Implemented Instructions Comparison Table -![alt text](https://github.com/pdsmart/ZPU/blob/master/ImplInstructions.png) +![alt text](https://github.com/pdsmart/ZPU/blob/master/docs/ImplInstructions.png) #### Hardware Variable Byte Write @@ -336,13 +336,13 @@ Tiny - IOCP is the smallest size possible to boot from SD Card. It is useful for Minimum - Full - IOCP has various inbuilt functions, such as application upload from serial port, memory edit/exam. -![alt text](https://github.com/pdsmart/ZPU/blob/master/IOCPMemoryMap.png) +![alt text](https://github.com/pdsmart/ZPU/blob/master/docs/IOCPMemoryMap.png) For ZPUTA, it can either be configured to be the boot application (ie. no IOCP) or it can be configured as an App booted by IOCP. Depending upon how ZPUTA is built. it can have applets (portions of its functionality created as dedicated executables on the SD card) or standalone with all functionality inbuilt. The former is used when there is limited memory or a set of loadable programs is desired. -![alt text](https://github.com/pdsmart/ZPU/blob/master/ZPUTAMemoryMap.png) +![alt text](https://github.com/pdsmart/ZPU/blob/master/docs/ZPUTAMemoryMap.png) diff --git a/IOCPMemoryMap.png b/docs/IOCPMemoryMap.png similarity index 100% rename from IOCPMemoryMap.png rename to docs/IOCPMemoryMap.png diff --git a/ImplInstructions.png b/docs/ImplInstructions.png similarity index 100% rename from ImplInstructions.png rename to docs/ImplInstructions.png diff --git a/ZPUTAMemoryMap.png b/docs/ZPUTAMemoryMap.png similarity index 100% rename from ZPUTAMemoryMap.png rename to docs/ZPUTAMemoryMap.png diff --git a/software/apps/mtest/mtest.c b/software/apps/mtest/mtest.c index ff9c5b6..4a2791b 100755 --- a/software/apps/mtest/mtest.c +++ b/software/apps/mtest/mtest.c @@ -84,12 +84,40 @@ void test8bit(uint32_t start, uint32_t end) while ( count-- ) { if ( *memPtr != data ) - xprintf( "\rError (8bit) at 0x%08lX (%02x:%02x)\n", memPtr, *memPtr, data ); + xprintf( "\rError (8bit ap) at 0x%08lX (%02x:%02x)\n", memPtr, *memPtr, data ); *memPtr++; data++; if ( data >= 0xFF ) data = 0x00; } + + xprintf( "\rWrite 8bit walking test pattern... " ); + memPtr = (unsigned char*)( start ); + data = 0x55; + count = end - start; + while ( count-- ) + { + *memPtr++ = data; + if ( data == 0x55 ) + data = 0xAA; + else + data = 0x55; + } + + xprintf( "\rRead 8bit walking test pattern... " ); + memPtr = (unsigned char*)( start ); + data = 0x55; + count = end - start; + while ( count-- ) + { + if ( *memPtr != data ) + xprintf( "\rError (8bit wp) at 0x%08lX (%02x:%02x)\n", memPtr, *memPtr, data ); + *memPtr++; + if ( data == 0x55 ) + data = 0xAA; + else + data = 0x55; + } } // Simple 16 bit memory write/read test. @@ -119,13 +147,43 @@ void test16bit(uint32_t start, uint32_t end) while ( count > 0 ) { if ( *memPtr != data ) - xprintf( "\rError (16bit) at 0x%08lX (%04x:%04x)\n", memPtr, *memPtr, data ); + xprintf( "\rError (16bit ap) at 0x%08lX (%04x:%04x)\n", memPtr, *memPtr, data ); *memPtr++; data++; if ( data >= 0xFFFF ) data = 0x00; count = count > 2 ? count -= 2 : 0; } + + xprintf( "\rWrite 16bit walking test pattern... " ); + memPtr = (uint16_t*)( start ); + data = 0xAA55; + count = end - start; + while ( count > 0 ) + { + *memPtr++ = data; + if ( data == 0xAA55 ) + data = 0x55AA; + else + data = 0xAA55; + count = count > 2 ? count -= 2 : 0; + } + + xprintf( "\rRead 16bit walking test pattern... " ); + memPtr = (uint16_t*)( start ); + data = 0xAA55; + count = end - start; + while ( count > 0 ) + { + if ( *memPtr != data ) + xprintf( "\rError (16bit wp) at 0x%08lX (%04x:%04x)\n", memPtr, *memPtr, data ); + *memPtr++; + if ( data == 0xAA55 ) + data = 0x55AA; + else + data = 0xAA55; + count = count > 2 ? count -= 2 : 0; + } } // Simple 32 bit memory write/read test. @@ -155,13 +213,44 @@ void test32bit(uint32_t start, uint32_t end) while ( count > 0 ) { if ( *memPtr != data ) - xprintf( "\rError (32bit) at 0x%08lX (%08lx:%08lx)\n", memPtr, *memPtr, data ); + xprintf( "\rError (32bit ap) at 0x%08lX (%08lx:%08lx)\n", memPtr, *memPtr, data ); *memPtr++; data++; if ( data >= 0xFFFFFFFE ) data = 0; count = count > 4 ? count -= 4 : 0; } + + xprintf( "\rWrite 32bit walking test pattern... " ); + memPtr = (uint32_t*)( start ); + data = 0xAA55AA55; + count = end - start; + while ( count > 0 ) + { + *memPtr++ = data; + if ( data == 0xAA55AA55 ) + data = 0x55AA55AA; + else + data = 0xAA55AA55; + count = count > 4 ? count -= 4 : 0; + } + + xprintf( "\rRead 32bit walking test pattern... " ); + memPtr = (uint32_t*)( start ); + data = 0x00; + data = 0xAA55AA55; + count = end - start; + while ( count > 0 ) + { + if ( *memPtr != data ) + xprintf( "\rError (32bit wp) at 0x%08lX (%08lx:%08lx)\n", memPtr, *memPtr, data ); + *memPtr++; + if ( data == 0xAA55AA55 ) + data = 0x55AA55AA; + else + data = 0xAA55AA55; + count = count > 4 ? count -= 4 : 0; + } } // Main entry and start point of a ZPUTA Application. Only 2 parameters are catered for and a 32bit return code, additional parameters can be added by changing the appcrt0.s