summaryrefslogtreecommitdiff
path: root/cesar/test_general/hard
diff options
context:
space:
mode:
authorsave2008-11-21 10:48:16 +0000
committersave2008-11-21 10:48:16 +0000
commit146877540652d1948bc282627269d66dbcacd7ad (patch)
tree4250b32253ab0d8983267274b1809e77b84544d3 /cesar/test_general/hard
parent6dd8af01b975da3414b415df4765c7e132da2d1a (diff)
[CESAR][ECOS]Completed tcm test, added a read/write test in instruction tcm
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@3507 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/test_general/hard')
-rw-r--r--cesar/test_general/hard/ecos/batch_iram15
-rw-r--r--cesar/test_general/hard/ecos/src/section.c30
2 files changed, 41 insertions, 4 deletions
diff --git a/cesar/test_general/hard/ecos/batch_iram b/cesar/test_general/hard/ecos/batch_iram
new file mode 100644
index 0000000000..4af4a38b66
--- /dev/null
+++ b/cesar/test_general/hard/ecos/batch_iram
@@ -0,0 +1,15 @@
+wmem 0x90160000 0xa8bf039c
+wmem 0x90160004 0x44a023fe
+wmem 0x90160008 0xa8bf23be
+wmem 0x9016000c 0x48a023fa
+wmem 0x90160010 0x44e027d0
+wmem 0x90160014 0x48e027d2
+wmem 0x90160018 0x44e007fa
+wmem 0x9016001c 0x48e007c2
+wmem 0x90160020 0x01400782
+wmem 0x90160024 0x01001090
+wmem 0x90160028 0xa8ff079c
+wmem 0x9016002c 0x44a003fe
+wmem 0x90160030 0x48a003fa
+wmem 0x90160034 0x08e0c381
+wmem 0x90160038 0xa8bf239c
diff --git a/cesar/test_general/hard/ecos/src/section.c b/cesar/test_general/hard/ecos/src/section.c
index 718adb8629..92be783128 100644
--- a/cesar/test_general/hard/ecos/src/section.c
+++ b/cesar/test_general/hard/ecos/src/section.c
@@ -13,9 +13,16 @@
#include <cyg/infra/diag.h>
-unsigned char test_section[5] __attribute__((section(".dlram")));
+//#define FETCH 1
+volatile unsigned char test_section[5] __attribute__((section(".dlram")));
+volatile unsigned char result_section __attribute__((section(".dlram")));
+
+#ifdef FETCH
int fct_add(int a, int b) __attribute__((section(".ilram")));
+#else
+volatile unsigned int test_section_i __attribute__((section(".ilram")));
+#endif
int fct_add(int a, int b)
{
@@ -25,17 +32,32 @@ int fct_add(int a, int b)
int main(void)
{
int a=5, b=6;
+ char c, d;
+#ifndef FETCH
+ unsigned int e;
+#endif
+
test_section[0] = 0xAA;
test_section[1] = 0xBB;
test_section[2] = 0xCC;
test_section[3] = 0xDD;
test_section[4] = 0xEE;
+ diag_write_string("ok test section for write variables\n");
+
+ c = test_section[1];
+ d = test_section[3];
+ diag_printf("ok test section for read variables (%02x, %02x)\n", c, d);
- diag_write_string("ok test section for variables");
+#ifndef FETCH
+ test_section_i = 0x12345678;
+ diag_write_string("ok test section for write code\n");
- a = fct_add(a, b);
+ e = test_section_i;
+ diag_printf("ok test section for read code (%08x)\n", e);
+#endif
- diag_write_string("ok test section for functions");
+ result_section = fct_add(a, b);
+ diag_printf("ok test section for functions (%d)\n",result_section);
return 0;
}