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

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 1.3 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    string rename;
20
21    log_printf(FUNC,Counter,"allocation","Begin");
22
23#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
24    in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
25#endif
26
27     in_COUNTER_DATA  = new SC_IN (Tdata_t)    * [_param._nb_port];
28     in_COUNTER_ADDSUB= new SC_IN (Tcontrol_t) * [_param._nb_port];
29    out_COUNTER_DATA  = new SC_OUT(Tdata_t)    * [_param._nb_port];
30   
31    for (uint32_t i=0; i<_param._nb_port; i++)
32      {
33        rename = " in_COUNTER_DATA_" +toString(i);
34         in_COUNTER_DATA  [i] = new SC_IN (Tdata_t)    (rename.c_str());
35
36        rename = " in_COUNTER_ADDSUB_"+toString(i);
37         in_COUNTER_ADDSUB[i] = new SC_IN (Tcontrol_t) (rename.c_str());
38
39        rename = "out_COUNTER_DATA_" +toString(i);
40        out_COUNTER_DATA  [i] = new SC_OUT(Tdata_t)    (rename.c_str());
41      }
42
43    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
44    log_printf(FUNC,Counter,"allocation","End");
45  };
46
47}; // end namespace counter
48}; // end namespace generic
49
50}; // end namespace behavioural
51}; // end namespace morpheo             
52#endif
Note: See TracBrowser for help on using the repository browser.