source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_vhdl_body.cpp @ 42

Last change on this file since 42 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
Line 
1#ifdef VHDL
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Counter/include/Counter.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace counter {
15
16  void Counter::vhdl_body (Vhdl * & vhdl)
17  {
18    log_printf(FUNC,Counter,"vhdl_body","Begin");
19    vhdl->set_body ("");
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          {
27            counter_inc = "in_COUNTER_"+toString(i)+"_DATA+1";
28            counter_dec = "in_COUNTER_"+toString(i)+"_DATA-1";
29          }
30        else
31          {
32            counter_inc = "in_COUNTER_"+toString(i)+"_DATA+1";
33            counter_dec = "in_COUNTER_"+toString(i)+"_DATA-1";
34          }
35
36        vhdl->set_body ("out_COUNTER_"+toString(i)+"_DATA <=");
37        if (_param._size_data > 1)
38          {
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;");
42          }
43        else
44          {
45            vhdl->set_body ("\tin_COUNTER_"+toString(i)+"_ADDSUB;");
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.