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

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

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 4.1 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace registerfile {
15namespace registerfile_multi_banked {
16
17
18  void RegisterFile_Multi_Banked::allocation (void)
19  {
20    log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","Begin");
21
22    _component   = new Component ();
23
24    Entity * entity = _component->set_entity (_name       
25                                              ,"RegisterFile_Multi_Banked"
26#ifdef POSITION
27                                              ,REGISTER
28#endif
29                                              );
30
31    _interfaces = entity->set_interfaces();
32
33    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34
35      Interface * interface = _interfaces->set_interface(""
36#ifdef POSITION
37                                                         ,IN
38                                                         ,SOUTH,
39                                                         "Generalist interface"
40#endif
41                                                         );
42
43     in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
44     in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
45
46    // ~~~~~[ Interface : "read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47
48     in_READ_VAL         = new SC_IN (Tcontrol_t) * [_param->_nb_port_read];
49    out_READ_ACK         = new SC_OUT(Tcontrol_t) * [_param->_nb_port_read];
50    if (_param->_have_port_address == true)
51     in_READ_ADDRESS     = new SC_IN (Taddress_t) * [_param->_nb_port_read];
52    out_READ_DATA        = new SC_OUT(Tdata_t   ) * [_param->_nb_port_read];
53
54    for (uint32_t i=0; i<_param->_nb_port_read; i++)
55      { 
56        Interface_fifo * interface = _interfaces->set_interface("read_"+toString(i)
57#ifdef POSITION
58                                                                , IN 
59                                                                ,WEST
60                                                                , "Interface Read"
61#endif
62                                                                );
63
64         in_READ_VAL     [i]  = interface->set_signal_valack_in        ("val"    , VAL);
65        out_READ_ACK     [i]  = interface->set_signal_valack_out       ("ack"    , ACK);
66        if (_param->_have_port_address == true)
67         in_READ_ADDRESS [i]  = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word)));
68        out_READ_DATA    [i]  = interface->set_signal_out <Tdata_t   > ("data"   , _param->_size_word);
69      }
70
71    // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72
73     in_WRITE_VAL        = new SC_IN (Tcontrol_t) * [_param->_nb_port_write];
74    out_WRITE_ACK        = new SC_OUT(Tcontrol_t) * [_param->_nb_port_write];
75    if (_param->_have_port_address == true)
76     in_WRITE_ADDRESS    = new SC_IN (Taddress_t) * [_param->_nb_port_write];
77     in_WRITE_DATA       = new SC_IN (Tdata_t   ) * [_param->_nb_port_write];
78   
79    for (uint32_t i=0; i<_param->_nb_port_write; i++)
80      {
81        Interface_fifo * interface = _interfaces->set_interface("write_"+toString(i)
82#ifdef POSITION
83                                                                , IN 
84                                                                ,EAST
85                                                                , "Interface Write"
86#endif
87                                                                );
88
89         in_WRITE_VAL     [i]  = interface->set_signal_valack_in        ("val"    , VAL);
90        out_WRITE_ACK     [i]  = interface->set_signal_valack_out       ("ack"    , ACK);
91        if (_param->_have_port_address == true)
92         in_WRITE_ADDRESS [i]  = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(log2(_param->_nb_word)));
93         in_WRITE_DATA    [i]  = interface->set_signal_in  <Tdata_t   > ("data"   , _param->_size_word);
94      }
95
96    // ~~~~~[ Registers ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
98    reg_DATA = new Tdata_t * [_param->_nb_bank];
99
100    for (uint32_t i=0; i<_param->_nb_bank; i++)
101      {
102        reg_DATA [i] = new Tdata_t [_param->_nb_word];
103      }
104
105    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106    internal_WRITE_VAL     = new bool       [_param->_nb_port_write];
107    internal_WRITE_BANK    = new Taddress_t [_param->_nb_port_write];
108    internal_WRITE_NUM_REG = new Taddress_t [_param->_nb_port_write];
109
110    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
111
112#ifdef POSITION
113    _component->generate_file();
114#endif
115
116    log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","End");
117  };
118
119}; // end namespace registerfile_multi_banked
120}; // end namespace registerfile
121}; // end namespace generic
122
123}; // end namespace behavioural
124}; // end namespace morpheo             
125#endif
Note: See TracBrowser for help on using the repository browser.