Last change
on this file since 21 was
1,
checked in by buchmann, 17 years ago
|
Initial import from CVS repository
|
File size:
1.3 KB
|
Line | |
---|
1 | /*------------------------------------------------------------\ |
---|
2 | | | |
---|
3 | | Tool : systemcass | |
---|
4 | | | |
---|
5 | | File : data_field.h | |
---|
6 | | | |
---|
7 | | Author : Buchmann Richard | |
---|
8 | | | |
---|
9 | | Date : 03_05_2006 | |
---|
10 | | | |
---|
11 | \------------------------------------------------------------*/ |
---|
12 | #ifndef __DATA_FIELD_H__ |
---|
13 | #define __DATA_FIELD_H__ |
---|
14 | |
---|
15 | #include <endianness.h> |
---|
16 | |
---|
17 | template<int WIDTH, |
---|
18 | int PADDING, |
---|
19 | typename data_type> |
---|
20 | struct val_field { /* try to work with little endianess */ |
---|
21 | #if defined(little_endian) |
---|
22 | /* little endian */ |
---|
23 | // data_type pad:PADDING; |
---|
24 | data_type valW:WIDTH; |
---|
25 | #elif defined(big_endian) |
---|
26 | /* big endian */ |
---|
27 | data_type pad:PADDING; |
---|
28 | data_type valW:WIDTH; |
---|
29 | #else |
---|
30 | #error You must define endianness. |
---|
31 | #endif |
---|
32 | }; |
---|
33 | |
---|
34 | template<int WIDTH, |
---|
35 | typename data_type> |
---|
36 | struct val_field<WIDTH,0,data_type> { |
---|
37 | data_type valW:WIDTH; |
---|
38 | }; |
---|
39 | |
---|
40 | #endif |
---|
41 | |
---|
Note: See
TracBrowser
for help on using the repository browser.