source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_allocation.cpp @ 2

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

Import Morpheo

File size: 2.1 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile/include/RegisterFile.h"
10
11namespace morpheo                    {
12namespace behavioural                {
13namespace generic                    {
14namespace registerfile               {
15
16  void RegisterFile::allocation (void)
17  {
18    in_CLOCK = new SC_CLOCK ("in_CLOCK");
19
20    // ----- Interface Read
21     in_READ_ENABLE      = new SC_IN (Tcontrol_t) * [_param._nb_port_read];
22     in_READ_ADDRESS     = new SC_IN (Taddress_t) * [_param._nb_port_read];
23    out_READ_DATA        = new SC_OUT(Tdata_t   ) * [_param._nb_port_read];
24
25    for (uint32_t i=0; i<_param._nb_port_read; i++)
26      {
27        string rename;
28
29        rename = "in_READ_ENABLE["  + toString(i) + "]";
30        in_READ_ENABLE  [i]  = new SC_IN (Tcontrol_t) (rename.c_str());
31
32        rename = "in_READ_ADDRESS[" + toString(i) + "]";
33        in_READ_ADDRESS [i]  = new SC_IN (Taddress_t) (rename.c_str());
34
35        rename = "out_READ_DATA["    + toString(i) + "]";
36        out_READ_DATA   [i]  = new SC_OUT(Tdata_t)    (rename.c_str());
37      }
38
39    // ----- Interface Write
40     in_WRITE_ENABLE     = new SC_IN (Tcontrol_t) * [_param._nb_port_write];
41     in_WRITE_ADDRESS    = new SC_IN (Taddress_t) * [_param._nb_port_write];
42     in_WRITE_DATA       = new SC_IN (Tdata_t   ) * [_param._nb_port_write];
43   
44    for (uint32_t i=0; i<_param._nb_port_write; i++)
45      {
46        string rename;
47
48        rename = "in_WRITE_ENABLE["  + toString(i) + "]";
49        in_WRITE_ENABLE  [i]  = new SC_IN (Tcontrol_t) (rename.c_str());
50
51        rename = "in_WRITE_ADDRESS[" + toString(i) + "]";
52        in_WRITE_ADDRESS [i]  = new SC_IN (Taddress_t) (rename.c_str());
53
54        rename = "in_WRITE_DATA["    + toString(i) + "]";
55        in_WRITE_DATA    [i]  = new SC_IN (Tdata_t)    (rename.c_str());
56      }
57
58    // ----- Register
59    reg_DATA = new SC_REGISTER (Tdata_t) * [_param._nb_word];
60   
61    for (uint32_t i=0; i<_param._nb_word; i++)
62      {
63        string rename = "reg_DATA["  + toString(i) + "]";
64        reg_DATA [i]  = new SC_REGISTER (Tdata_t) (rename.c_str());
65      }   
66  };
67
68}; // end namespace registerfile
69}; // end namespace generic
70}; // end namespace behavioural         
71}; // end namespace morpheo             
72#endif
Note: See TracBrowser for help on using the repository browser.