source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/src/RegisterFile_Multi_Banked_allocation.cpp @ 10

Last change on this file since 10 was 10, checked in by rosiere, 17 years ago
File size: 2.6 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace registerfile_multi_banked {
15
16
17  void RegisterFile_Multi_Banked::allocation (void)
18  {
19    string rename;
20
21    log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","Begin");
22
23//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
24    in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
25//#endif
26    in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET");
27
28    // ----- Interface Read
29     in_READ_VAL     = new SC_IN       (Tcontrol_t)     * [_param._nb_port_read];
30    out_READ_ACK     = new SC_OUT      (Tcontrol_t)     * [_param._nb_port_read];
31     in_READ_ADDRESS = new SC_IN       (Taddress_t)     * [_param._nb_port_read];
32    out_READ_DATA    = new SC_OUT      (Tdata_t)        * [_param._nb_port_read];
33
34    for (uint32_t i=0; i<_param._nb_port_read; i++)
35      {
36        rename =  "in_READ_VAL_"    +toString(i);
37         in_READ_VAL     [i] = new SC_IN       (Tcontrol_t) (rename.c_str());
38
39        rename = "out_READ_ACK_"    +toString(i);
40        out_READ_ACK     [i] = new SC_OUT      (Tcontrol_t) (rename.c_str());
41
42        rename =  "in_READ_ADDRESS_"+toString(i);
43         in_READ_ADDRESS [i] = new SC_IN       (Taddress_t) (rename.c_str());
44
45        rename = "out_READ_DATA_"   +toString(i);
46        out_READ_DATA    [i] = new SC_OUT      (Tdata_t)    (rename.c_str());
47      }
48
49    // ----- Interface Write
50     in_WRITE_VAL     = new SC_IN       (Tcontrol_t)     * [_param._nb_port_write];
51    out_WRITE_ACK     = new SC_OUT      (Tcontrol_t)     * [_param._nb_port_write];
52     in_WRITE_ADDRESS = new SC_IN       (Taddress_t)     * [_param._nb_port_write];
53     in_WRITE_DATA    = new SC_IN       (Tdata_t)        * [_param._nb_port_write];
54
55    for (uint32_t i=0; i<_param._nb_port_write; i++)
56      {
57        rename =  "in_WRITE_VAL_"    +toString(i);
58         in_WRITE_VAL     [i] = new SC_IN       (Tcontrol_t) (rename.c_str());
59
60        rename = "out_WRITE_ACK_"    +toString(i);
61        out_WRITE_ACK     [i] = new SC_OUT      (Tcontrol_t) (rename.c_str());
62
63        rename =  "in_WRITE_ADDRESS_"+toString(i);
64         in_WRITE_ADDRESS [i] = new SC_IN       (Taddress_t) (rename.c_str());
65
66        rename =  "in_WRITE_DATA_"   +toString(i);
67         in_WRITE_DATA    [i] = new SC_IN       (Tdata_t)    (rename.c_str());
68      }
69
70    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
71
72    log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","End");
73  };
74
75}; // end namespace registerfile_multi_banked
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.