source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Selftest.h

Last change on this file was 88, checked in by rosiere, 18 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1#ifndef morpheo_behavioural_Selftest_h
2#define morpheo_behavioural_Selftest_h
3
4/*
5 * $Id: Selftest.h 88 2008-12-10 18:31:39Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Behavioural/include/Allocation.h"
12#include "Common/include/FromString.h"
13#include "Common/include/Debug.h"
14
15// ======================================================================
16// =====[ ALLOCATION / DELETE of ARRAY ]=================================
17// ======================================================================
18
19#define AFFECT0(var,type,argv,x) \
20 var = morpheo::fromString<type>(argv[x++]);
21
22#define AFFECT1(var,type,argv,x,s1) \
23 for (uint32_t it1=0; it1<s1; ++it1) \
24 { \
25 var [it1] = morpheo::fromString<type>(argv[x++]); \
26 }
27
28#define AFFECT2(var,type,argv,x,s1,s2) \
29 for (uint32_t it1=0; it1<s1; ++it1) \
30 for (uint32_t it2=0; it2<s2; ++it2) \
31 { \
32 var [it1][it2] = morpheo::fromString<type>(argv[x++]); \
33 }
34
35#define AFFECT3(var,type,argv,x,s1,s2,s3) \
36 for (uint32_t it1=0; it1<s1; ++it1) \
37 for (uint32_t it2=0; it2<s2; ++it2) \
38 for (uint32_t it3=0; it3<s3; ++it3) \
39 { \
40 var [it1][it2][it3] = morpheo::fromString<type>(argv[x++]); \
41 }
42
43#define AFFECT4(var,type,argv,x,s1,s2,s3,s4) \
44 for (uint32_t it1=0; it1<s1; ++it1) \
45 for (uint32_t it2=0; it2<s2; ++it2) \
46 for (uint32_t it3=0; it3<s3; ++it3) \
47 for (uint32_t it4=0; it4<s4; ++it4) \
48 { \
49 var [it1][it2][it3][it4] = morpheo::fromString<type>(argv[x++]); \
50 }
51
52
53#define SELFTEST0(var,type,argv,x) \
54 AFFECT0(var,type,argv,x); \
55
56#define SELFTEST1(var,type,argv,x,s1) \
57 ALLOC1(var,type,s1); \
58 AFFECT1(var,type,argv,x,s1);
59
60#define SELFTEST2(var,type,argv,x,s1,s2) \
61 ALLOC2(var,type,s1,s2); \
62 AFFECT2(var,type,argv,x,s1,s2);
63
64#define SELFTEST3(var,type,argv,x,s1,s2,s3) \
65 ALLOC3(var,type,s1,s2,s3); \
66 AFFECT3(var,type,argv,x,s1,s2,s3);
67
68#define SELFTEST4(var,type,argv,x,s1,s2,s3,s4) \
69 ALLOC4(var,type,s1,s2,s3,s4); \
70 AFFECT4(var,type,argv,x,s1,s2,s3,s4);
71
72#endif
Note: See TracBrowser for help on using the repository browser.