source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Icache_Access/src/Icache_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: 6.7 KB
Line 
1/*
2 * $Id: Icache_Access_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Icache_Access/include/Icache_Access.h"
9#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace icache_access {
16
17
18
19#undef  FUNCTION
20#define FUNCTION "Icache_Access::allocation"
21  void Icache_Access::allocation (
22#ifdef STATISTICS
23                               morpheo::behavioural::Parameters_Statistics * param_statistics
24#else
25                               void
26#endif
27                               )
28  {
29    log_begin(Icache_Access,FUNCTION);
30
31    _component   = new Component (_usage);
32
33    Entity * entity = _component->set_entity (_name       
34                                              ,"Icache_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 "icache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57    {
58      ALLOC1_INTERFACE_BEGIN("icache_req",WEST,OUT,_("Request to instruction cache"),_param->_nb_icache_port);
59     
60      ALLOC1_VALACK_OUT(out_ICACHE_REQ_VAL         ,VAL);
61      ALLOC1_VALACK_IN ( in_ICACHE_REQ_ACK         ,ACK);
62      ALLOC1_SIGNAL_OUT(out_ICACHE_REQ_THREAD_ID   ,"thread_id",Tcontext_t           ,_param->_size_icache_thread_id);
63      ALLOC1_SIGNAL_OUT(out_ICACHE_REQ_PACKET_ID   ,"packet_id",Tpacket_t            ,_param->_size_icache_packet_id);
64      ALLOC1_SIGNAL_OUT(out_ICACHE_REQ_ADDRESS     ,"address"  ,Ticache_address_t    ,_param->_size_address         );
65      ALLOC1_SIGNAL_OUT(out_ICACHE_REQ_TYPE        ,"type"     ,Ticache_type_t       ,_param->_size_icache_type     );
66
67      ALLOC1_INTERFACE_END(_param->_nb_icache_port);
68    }
69
70    // ~~~~~[ Interface "icache_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
71    {
72      ALLOC1_INTERFACE_BEGIN("icache_rsp",WEST,IN ,_("Respons from instruction cache"),_param->_nb_icache_port);
73
74      ALLOC1_VALACK_IN ( in_ICACHE_RSP_VAL         ,VAL);
75      ALLOC1_VALACK_OUT(out_ICACHE_RSP_ACK         ,ACK);
76      ALLOC1_SIGNAL_IN ( in_ICACHE_RSP_THREAD_ID   ,"thread_id"  ,Tcontext_t           ,_param->_size_icache_thread_id);
77      ALLOC1_SIGNAL_IN ( in_ICACHE_RSP_PACKET_ID   ,"packet_id"  ,Tpacket_t            ,_param->_size_icache_packet_id);
78      ALLOC1_SIGNAL_IN ( in_ICACHE_RSP_ERROR       ,"error"      ,Ticache_error_t      ,_param->_size_icache_error    );
79
80      ALLOC1_INTERFACE_END(_param->_nb_icache_port);
81    }
82    {
83      ALLOC2_INTERFACE_BEGIN("icache_rsp",WEST,IN ,_("Respons from instruction cache"),_param->_nb_icache_port,_param->_icache_nb_instruction[it1]);
84
85      _ALLOC2_SIGNAL_IN ( in_ICACHE_RSP_INSTRUCTION ,"instruction",Ticache_instruction_t,_param->_size_instruction,_param->_nb_icache_port,_param->_icache_nb_instruction[it1]);
86
87      ALLOC2_INTERFACE_END(_param->_nb_icache_port,_param->_icache_nb_instruction[it1]);
88    }
89
90    // ~~~~~[ Interface "context_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91    {
92      ALLOC2_INTERFACE_BEGIN("context_req",EAST,IN ,_("Request from context_unit."),_param->_nb_front_end, _param->_nb_context[it1]);
93
94      _ALLOC2_VALACK_IN ( in_CONTEXT_REQ_VAL        ,VAL,_param->_nb_front_end, _param->_nb_context[it1]);
95      _ALLOC2_VALACK_OUT(out_CONTEXT_REQ_ACK        ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
96//    _ALLOC2_SIGNAL_IN ( in_CONTEXT_REQ_THREAD_ID  ,"thread_id"  ,Tcontext_t           ,_param->_size_);
97      _ALLOC2_SIGNAL_IN ( in_CONTEXT_REQ_PACKET_ID  ,"packet_id"  ,Tpacket_t            ,_param->_size_packet_id[it1][it2],_param->_nb_front_end, _param->_nb_context[it1]);
98      _ALLOC2_SIGNAL_IN ( in_CONTEXT_REQ_ADDRESS    ,"address"    ,Ticache_address_t    ,_param->_size_address            ,_param->_nb_front_end, _param->_nb_context[it1]);
99      _ALLOC2_SIGNAL_IN ( in_CONTEXT_REQ_TYPE       ,"type"       ,Ticache_type_t       ,_param->_size_icache_type        ,_param->_nb_front_end, _param->_nb_context[it1]);
100
101      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
102    }
103
104    // ~~~~~[ Interface "context_rsp" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105    {
106      ALLOC2_INTERFACE_BEGIN("context_rsp",EAST,OUT,_("Respons to context_unit."),_param->_nb_front_end, _param->_nb_context[it1]);
107
108      _ALLOC2_VALACK_OUT(out_CONTEXT_RSP_VAL        ,VAL,_param->_nb_front_end, _param->_nb_context[it1]);
109      _ALLOC2_VALACK_IN ( in_CONTEXT_RSP_ACK        ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
110//    _ALLOC2_SIGNAL_OUT(out_CONTEXT_RSP_THREAD_ID  ,"thread_id"  ,Tcontext_t           ,_param->_size_                   ,_param->_nb_front_end, _param->_nb_context[it1]);
111      _ALLOC2_SIGNAL_OUT(out_CONTEXT_RSP_PACKET_ID  ,"packet_id"  ,Tpacket_t            ,_param->_size_packet_id[it1][it2],_param->_nb_front_end, _param->_nb_context[it1]);
112      _ALLOC2_SIGNAL_OUT(out_CONTEXT_RSP_ERROR      ,"error"      ,Ticache_error_t      ,_param->_size_icache_error       ,_param->_nb_front_end, _param->_nb_context[it1]);
113
114      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
115    }
116    {
117      ALLOC3_INTERFACE_BEGIN("context_rsp",EAST,OUT,_("Respons to context_unit."),_param->_nb_front_end, _param->_nb_context[it1],_param->_nb_instruction[it1][it2]);
118
119      _ALLOC3_SIGNAL_OUT(out_CONTEXT_RSP_INSTRUCTION,"instruction",Ticache_instruction_t,_param->_size_instruction,_param->_nb_front_end, _param->_nb_context[it1],_param->_nb_instruction[it1][it2]);
120
121      ALLOC3_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1],_param->_nb_instruction[it1][it2]);
122    }
123
124    if (usage_is_set(_usage,USE_SYSTEMC))
125      {
126        // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127#ifdef STATISTICS
128        ALLOC1(_internal_ICACHE_REQ_NB_ACCESS        ,uint32_t,_param->_nb_icache_port);
129        ALLOC1(_internal_ICACHE_REQ_NB_ACCESS_CONFLIT,uint32_t,_param->_nb_icache_port);
130#endif
131      }
132
133    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
134    _priority  = new generic::priority::Priority (_name+"_priority",
135                                                  _param->_priority      ,
136                                                  _param->_load_balancing,
137                                                  _param->_nb_front_end  ,
138                                                  _param->_nb_context    ,
139                                                  _param->_nb_front_end  );
140
141#ifdef POSITION
142    if (usage_is_set(_usage,USE_POSITION))
143        _component->generate_file();
144#endif
145
146    log_end(Icache_Access,FUNCTION);
147  };
148
149}; // end namespace icache_access
150}; // end namespace core
151
152}; // end namespace behavioural
153}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.