Last change
on this file since 66 was
42,
checked in by rosiere, 17 years ago
|
Modification des classes d'encapsulation des interfaces :
- gère les signaux à écrire dans le vhdl
- les traces pour le testbench
- la génération des vhdl structurelles
-> test sur la Pattern History Table
|
File size:
1.4 KB
|
Rev | Line | |
---|
[2] | 1 | #ifdef VHDL |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Generic/Counter/include/Counter.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace generic { |
---|
| 14 | namespace counter { |
---|
| 15 | |
---|
[42] | 16 | void Counter::vhdl_body (Vhdl * & vhdl) |
---|
[2] | 17 | { |
---|
| 18 | log_printf(FUNC,Counter,"vhdl_body","Begin"); |
---|
[42] | 19 | vhdl->set_body (""); |
---|
[2] | 20 | |
---|
| 21 | for (uint32_t i=0; i<_param._nb_port; i++) |
---|
| 22 | { |
---|
| 23 | string counter_inc, counter_dec; |
---|
| 24 | |
---|
| 25 | if (_param._size_data > 1) |
---|
| 26 | { |
---|
[42] | 27 | counter_inc = "in_COUNTER_"+toString(i)+"_DATA+1"; |
---|
| 28 | counter_dec = "in_COUNTER_"+toString(i)+"_DATA-1"; |
---|
[2] | 29 | } |
---|
| 30 | else |
---|
| 31 | { |
---|
[42] | 32 | counter_inc = "in_COUNTER_"+toString(i)+"_DATA+1"; |
---|
| 33 | counter_dec = "in_COUNTER_"+toString(i)+"_DATA-1"; |
---|
[2] | 34 | } |
---|
| 35 | |
---|
[42] | 36 | vhdl->set_body ("out_COUNTER_"+toString(i)+"_DATA <="); |
---|
[2] | 37 | if (_param._size_data > 1) |
---|
| 38 | { |
---|
[42] | 39 | vhdl->set_body ("\tin_COUNTER_"+toString(i)+"_DATA+1 when in_COUNTER_"+toString(i)+"_ADDSUB = '1' and in_COUNTER_"+toString(i)+"_DATA < cst_max else"); |
---|
| 40 | vhdl->set_body ("\tin_COUNTER_"+toString(i)+"_DATA-1 when in_COUNTER_"+toString(i)+"_ADDSUB = '0' and in_COUNTER_"+toString(i)+"_DATA > cst_min else"); |
---|
| 41 | vhdl->set_body ("\tin_COUNTER_"+toString(i)+"_DATA;"); |
---|
[2] | 42 | } |
---|
| 43 | else |
---|
| 44 | { |
---|
[42] | 45 | vhdl->set_body ("\tin_COUNTER_"+toString(i)+"_ADDSUB;"); |
---|
[2] | 46 | } |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | log_printf(FUNC,Counter,"vhdl_body","End"); |
---|
| 50 | }; |
---|
| 51 | |
---|
| 52 | }; // end namespace counter |
---|
| 53 | }; // end namespace generic |
---|
| 54 | |
---|
| 55 | }; // end namespace behavioural |
---|
| 56 | }; // end namespace morpheo |
---|
| 57 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.