source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_allocation.cpp @ 75

Last change on this file since 75 was 75, checked in by rosiere, 16 years ago

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File size: 2.1 KB
Line 
1#ifdef SYSTEMC
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
17  void Counter::allocation (void)
18  {
19    log_printf(FUNC,Counter,"allocation","Begin");
20
21    _component   = new Component ();
22
23    Entity * entity = _component->set_entity (_name     
24                                             ,"Counter" 
25#ifdef POSITION
26                                             ,COMBINATORY
27#endif
28                                              );
29   
30    _interfaces = entity->set_interfaces();
31
32    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33    {
34      Interface * interface = _interfaces->set_interface(""
35#ifdef POSITION
36                                                         , IN 
37                                                         , SOUTH
38                                                         , "Generalist interface"
39#endif
40                                                         );
41     
42      in_CLOCK              = interface->set_signal_clk              ("clock" ,1,CLOCK_VHDL_NO);
43      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_NO);
44    }
45
46    // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47     {
48        in_COUNTER_DATA  = new SC_IN (Tdata_t)    * [_param._nb_port];
49        in_COUNTER_ADDSUB= new SC_IN (Tcontrol_t) * [_param._nb_port];
50       out_COUNTER_DATA  = new SC_OUT(Tdata_t)    * [_param._nb_port];
51       
52       for (uint32_t i=0; i<_param._nb_port; i++)
53         {
54           Interface_fifo * interface = _interfaces->set_interface("counter_"+toString(i)
55#ifdef POSITION
56                                                                   , IN 
57                                                                   , SOUTH
58                                                                   , "Counter interface"
59#endif
60                                                                   );
61           
62            in_COUNTER_DATA   [i] = interface->set_signal_in  <Tdata_t   > ("data"  , _param._size_data);
63            in_COUNTER_ADDSUB [i] = interface->set_signal_in  <Tcontrol_t> ("addsub", 1                );
64           out_COUNTER_DATA   [i] = interface->set_signal_out <Tdata_t   > ("data"  , _param._size_data);
65         }
66     }
67#ifdef POSITION
68    _component->generate_file();
69#endif
70
71    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
72    log_printf(FUNC,Counter,"allocation","End");
73  };
74
75}; // end namespace counter
76}; // end namespace generic
77
78}; // end namespace behavioural
79}; // end namespace morpheo             
80#endif
Note: See TracBrowser for help on using the repository browser.