Rev | Line | |
---|
[2] | 1 | #ifdef SYSTEMC |
---|
| 2 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 3 | /* |
---|
| 4 | * $Id$ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/Generic/Counter/include/Counter.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace generic { |
---|
| 15 | namespace counter { |
---|
| 16 | |
---|
| 17 | void Counter::genMealy (void) |
---|
| 18 | { |
---|
| 19 | log_printf(FUNC,Counter,"genMealy","Begin"); |
---|
| 20 | |
---|
| 21 | for (uint32_t i=0; i<_param._nb_port; i++) |
---|
| 22 | { |
---|
| 23 | Tdata_t data = PORT_READ(in_COUNTER_DATA [i]); |
---|
| 24 | |
---|
| 25 | // Staturate counter |
---|
| 26 | if (PORT_READ(in_COUNTER_ADDSUB [i]) == 1) |
---|
| 27 | { |
---|
| 28 | if (data < _param._data_max) |
---|
| 29 | data ++; |
---|
| 30 | } |
---|
| 31 | else |
---|
| 32 | { |
---|
| 33 | if (data > 0) |
---|
| 34 | data --; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | PORT_WRITE(out_COUNTER_DATA[i], data); |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | log_printf(FUNC,Counter,"genMealy","End"); |
---|
| 41 | }; |
---|
| 42 | |
---|
| 43 | }; // end namespace counter |
---|
| 44 | }; // end namespace generic |
---|
| 45 | }; // end namespace behavioural |
---|
| 46 | }; // end namespace morpheo |
---|
| 47 | #endif |
---|
| 48 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.