source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/src/Dcache_Access_allocation.cpp @ 112

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 7.2 KB
Line 
1/*
2 * $Id: Dcache_Access_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Dcache_Access/include/Dcache_Access.h"
9#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace dcache_access {
16
17
18
19#undef  FUNCTION
20#define FUNCTION "Dcache_Access::allocation"
21  void Dcache_Access::allocation (
22#ifdef STATISTICS
23                               morpheo::behavioural::Parameters_Statistics * param_statistics
24#else
25                               void
26#endif
27                               )
28  {
29    log_begin(Dcache_Access,FUNCTION);
30
31    _component   = new Component (_usage);
32
33    Entity * entity = _component->set_entity (_name       
34                                              ,"Dcache_Access"
35#ifdef POSITION
36                                              ,COMBINATORY
37#endif
38                                              );
39
40    _interfaces = entity->set_interfaces();
41
42    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43    {
44      Interface * interface = _interfaces->set_interface(""
45#ifdef POSITION
46                                                         ,IN
47                                                         ,SOUTH,
48                                                         _("Generalist interface")
49#endif
50                                                         );
51     
52      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
53      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
54    }
55
56    // ~~~~~[ Interface "dcache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57    {
58      ALLOC1_INTERFACE_BEGIN("dcache_req", OUT, NORTH, _("Request to data cache"),_param->_nb_dcache_port);
59     
60      ALLOC1_VALACK_OUT(out_DCACHE_REQ_VAL         ,VAL);
61      ALLOC1_VALACK_IN ( in_DCACHE_REQ_ACK         ,ACK);
62      ALLOC1_SIGNAL_OUT(out_DCACHE_REQ_THREAD_ID   ,"thread_id",Tcontext_t           ,_param->_size_dcache_thread_id);
63      ALLOC1_SIGNAL_OUT(out_DCACHE_REQ_PACKET_ID   ,"packet_id",Tpacket_t            ,_param->_size_dcache_packet_id);
64      ALLOC1_SIGNAL_OUT(out_DCACHE_REQ_ADDRESS     ,"address"  ,Tdcache_address_t    ,_param->_size_address);
65      ALLOC1_SIGNAL_OUT(out_DCACHE_REQ_WDATA       ,"wdata"    ,Tdcache_data_t       ,_param->_size_data);
66      ALLOC1_SIGNAL_OUT(out_DCACHE_REQ_TYPE        ,"type"     ,Tdcache_type_t       ,_param->_size_dcache_type);
67
68      ALLOC1_INTERFACE_END(param->_nb_dcache_port);
69    }
70                                                                           
71    // ~~~~~[ Interface "dcache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
72    {
73      ALLOC1_INTERFACE_BEGIN("dcache_rsp", IN , NORTH, _("Respons from data cache"),_param->_nb_dcache_port);
74
75      ALLOC1_VALACK_IN ( in_DCACHE_RSP_VAL         ,VAL);
76      ALLOC1_VALACK_OUT(out_DCACHE_RSP_ACK         ,ACK);
77      ALLOC1_SIGNAL_IN ( in_DCACHE_RSP_THREAD_ID   ,"thread_id",Tcontext_t           ,_param->_size_dcache_thread_id);
78      ALLOC1_SIGNAL_IN ( in_DCACHE_RSP_PACKET_ID   ,"packet_id",Tpacket_t            ,_param->_size_dcache_packet_id);
79      ALLOC1_SIGNAL_IN ( in_DCACHE_RSP_RDATA       ,"rdata"    ,Tdcache_data_t       ,_param->_size_data);
80      ALLOC1_SIGNAL_IN ( in_DCACHE_RSP_ERROR       ,"error"    ,Tdcache_error_t      ,_param->_size_dcache_error);
81
82      ALLOC1_INTERFACE_END(_param->_nb_dcache_port);
83    }
84
85    // ~~~~~[ Interface "lsq_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86    {
87      ALLOC3_INTERFACE_BEGIN("lsq_req", IN, SOUTH, _("Request from load_store queue"), _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
88
89      _ALLOC3_VALACK_IN ( in_LSQ_REQ_VAL            ,VAL, _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
90      _ALLOC3_VALACK_OUT(out_LSQ_REQ_ACK            ,ACK, _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
91      _ALLOC3_SIGNAL_IN ( in_LSQ_REQ_THREAD_ID      ,"thread_id",Tcontext_t           ,_param->_size_thread_id [it1][it2], _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
92      _ALLOC3_SIGNAL_IN ( in_LSQ_REQ_PACKET_ID      ,"packet_id",Tpacket_t            ,_param->_size_packet_id [it1][it2], _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
93      _ALLOC3_SIGNAL_IN ( in_LSQ_REQ_ADDRESS        ,"address"  ,Tdcache_address_t    ,_param->_size_address             , _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
94      _ALLOC3_SIGNAL_IN ( in_LSQ_REQ_WDATA          ,"wdata"    ,Tdcache_data_t       ,_param->_size_data                , _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
95      _ALLOC3_SIGNAL_IN ( in_LSQ_REQ_TYPE           ,"type"     ,Tdcache_type_t       ,_param->_size_dcache_type         , _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
96
97      ALLOC3_INTERFACE_END(_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
98    }
99
100    // ~~~~~[ Interface "lsq_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101    {
102      ALLOC3_INTERFACE_BEGIN("lsq_rsp",OUT, SOUTH, _("Respons to load_store queue"), _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
103     
104      _ALLOC3_VALACK_OUT(out_LSQ_RSP_VAL            ,VAL, _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
105      _ALLOC3_VALACK_IN ( in_LSQ_RSP_ACK            ,ACK, _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
106      _ALLOC3_SIGNAL_OUT(out_LSQ_RSP_THREAD_ID      ,"thread_id",Tcontext_t           ,_param->_size_thread_id [it1][it2], _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
107      _ALLOC3_SIGNAL_OUT(out_LSQ_RSP_PACKET_ID      ,"packet_id",Tpacket_t            ,_param->_size_packet_id [it1][it2], _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
108      _ALLOC3_SIGNAL_OUT(out_LSQ_RSP_RDATA          ,"rdata"    ,Tdcache_data_t       ,_param->_size_data                , _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
109      _ALLOC3_SIGNAL_OUT(out_LSQ_RSP_ERROR          ,"error"    ,Tdcache_error_t      ,_param->_size_dcache_error       , _param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
110
111      ALLOC3_INTERFACE_END(_param->_nb_execute_loop, _param->_nb_load_store_unit[it1], _param->_nb_cache_access[it1][it2]);
112    }
113
114    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115#ifdef STATISTICS
116    if (usage_is_set(_usage,USE_SYSTEMC))
117      {
118        ALLOC1(_internal_DCACHE_REQ_NB_ACCESS        ,uint32_t,_param->_nb_dcache_port);
119        ALLOC1(_internal_DCACHE_REQ_NB_ACCESS_CONFLIT,uint32_t,_param->_nb_dcache_port);
120      }
121#endif
122
123    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
124    _priority  = new generic::priority::Priority (_name+"_priority",
125                                                  _param->_priority          ,
126                                                  _param->_load_balancing    ,
127                                                  _param->_nb_execute_loop   ,
128                                                  _param->_nb_load_store_unit,
129                                                  _param->_nb_execute_loop   );
130
131#ifdef POSITION
132    if (usage_is_set(_usage,USE_POSITION))
133        _component->generate_file();
134#endif
135
136    log_end(Dcache_Access,FUNCTION);
137  };
138
139}; // end namespace dcache_access
140}; // end namespace core
141
142}; // end namespace behavioural
143}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.