[2] | 1 | #ifndef morpheo_Type |
---|
| 2 | #define morpheo_Type |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include <stdint.h> |
---|
| 12 | |
---|
| 13 | namespace morpheo { |
---|
| 14 | |
---|
| 15 | #ifdef SYSTEMC |
---|
| 16 | |
---|
| 17 | // Definition of type |
---|
| 18 | #if ( defined(SC_CLOCK) || defined(SC_INTERNAL) || defined(SC_SIGNAL) || defined(SC_REGISTER) || defined(SC_IN) || defined(SC_OUT) ) |
---|
| 19 | # error "A type is already defined" |
---|
| 20 | #endif |
---|
| 21 | |
---|
| 22 | #if ( defined(PORT_READ) || defined(PORT_WRITE) ) |
---|
| 23 | # error "Action is already defined" |
---|
| 24 | #endif |
---|
| 25 | #if ( defined(INTERNAL_READ) || defined(INTERNAL_WRITE) ) |
---|
| 26 | # error "Action is already defined" |
---|
| 27 | #endif |
---|
| 28 | #if ( defined(SIGNAL_READ) || defined(SIGNAL_WRITE) ) |
---|
| 29 | # error "Action is already defined" |
---|
| 30 | #endif |
---|
| 31 | #if ( defined(REGISTER_READ) || defined(REGISTER_WRITE) ) |
---|
| 32 | # error "Action is already defined" |
---|
| 33 | #endif |
---|
| 34 | |
---|
| 35 | #define SC_CLOCK sc_in_clk |
---|
| 36 | #define SC_INTERNAL(type) type |
---|
[31] | 37 | #define SC_REGISTER(type) sc_signal<type > |
---|
[2] | 38 | #define SC_SIGNAL(type) sc_signal<type > |
---|
| 39 | #define SC_IN(type) sc_in <type > |
---|
| 40 | #define SC_OUT(type) sc_out <type > |
---|
| 41 | |
---|
| 42 | #define PORT_READ(sig) sig->read() |
---|
| 43 | #define PORT_WRITE(sig,val) sig->write(val) |
---|
| 44 | #define INTERNAL_READ(sig) (*sig) |
---|
| 45 | #define INTERNAL_WRITE(sig,val) (*sig) = val |
---|
| 46 | #define SIGNAL_READ(sig) sig->read() |
---|
| 47 | #define SIGNAL_WRITE(sig,val) sig->write(val) |
---|
| 48 | #define REGISTER_READ(sig) sig->read() |
---|
| 49 | #define REGISTER_WRITE(sig,val) sig->write(val) |
---|
| 50 | |
---|
| 51 | #endif |
---|
| 52 | }; // end namespace morpheo |
---|
| 53 | |
---|
| 54 | #endif |
---|