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

Last change on this file was 137, checked in by rosiere, 14 years ago

Various modif (add test, and vhdl)

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1/*
2 * $Id: RegisterFile_Multi_Banked_allocation.cpp 137 2010-02-16 12:35:48Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/include/RegisterFile_Multi_Banked.h"
9#include "Behavioural/include/Allocation.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 (_usage);
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       ALLOC1_INTERFACE_BEGIN("read",IN,WEST,_("Interface Read"),_param->_nb_port_read);
49
50       ALLOC1_VALACK_IN ( in_READ_VAL    ,VAL);
51       ALLOC1_VALACK_OUT(out_READ_ACK    ,ACK);
52       ALLOC1_SIGNAL_IN ( in_READ_ADDRESS,"address",Taddress_t, _param->_size_address);
53       ALLOC1_SIGNAL_OUT(out_READ_DATA   ,"data"   ,Tdata_t   , _param->_size_word);
54
55       ALLOC1_INTERFACE_END(_param->_nb_port_read);
56     }
57     
58     // ~~~~~[ Interface : "write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59     {
60       ALLOC1_INTERFACE_BEGIN("write",IN,EAST,_("Interface Write"),_param->_nb_port_write);
61
62       ALLOC1_VALACK_IN ( in_WRITE_VAL    ,VAL);
63       ALLOC1_VALACK_OUT(out_WRITE_ACK    ,ACK);
64       ALLOC1_SIGNAL_IN ( in_WRITE_ADDRESS,"address",Taddress_t,_param->_size_address);
65       ALLOC1_SIGNAL_IN ( in_WRITE_DATA   ,"data"   ,Tdata_t   ,_param->_size_word);
66
67       ALLOC1_INTERFACE_END(_param->_nb_port_write);
68      }
69
70    if (usage_is_set(_usage,USE_SYSTEMC))
71      {
72        // ~~~~~[ Registers ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73        ALLOC2(reg_DATA,Tdata_t,_param->_nb_bank,_param->_nb_word);
74
75        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76        ALLOC1(internal_WRITE_VAL    ,bool      ,_param->_nb_port_write);
77        ALLOC1(internal_WRITE_BANK   ,Taddress_t,_param->_nb_port_write);
78        ALLOC1(internal_WRITE_NUM_REG,Taddress_t,_param->_nb_port_write);
79
80#ifdef STATISTICS
81        ALLOC1(internal_READ_VAL     ,bool      ,_param->_nb_port_read);
82#endif
83      }
84
85    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
86#ifdef POSITION
87    if (usage_is_set(_usage,USE_POSITION))
88      _component->generate_file();
89#endif
90   
91    log_printf(FUNC,RegisterFile_Multi_Banked,"allocation","End");
92  };
93
94}; // end namespace registerfile_multi_banked
95}; // end namespace registerfile
96}; // end namespace generic
97
98}; // end namespace behavioural
99}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.