source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_allocation.cpp @ 15

Last change on this file since 15 was 15, checked in by rosiere, 17 years ago

Interface normalisé
Début du banc de registres multi niveaux

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