source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/src/Victim_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/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Victim/include/Victim.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace victim {
15
16
17
18#undef  FUNCTION
19#define FUNCTION "Victim::allocation"
20  void Victim::allocation (
21#ifdef STATISTICS
22                               morpheo::behavioural::Parameters_Statistics * param_statistics
23#else
24                               void
25#endif
26                               )
27  {
28    log_printf(FUNC,Victim,FUNCTION,"Begin");
29
30   
31    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32    {
33      __ALLOC_SIGNAL(in_CLOCK ,"in_CLOCK" ,SC_CLOCK          );
34      __ALLOC_SIGNAL(in_NRESET,"in_NRESET",SC_IN (Tcontrol_t));
35    }
36
37    // ~~~~~[ Interface : "Access" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38    {
39      __ALLOC1_INTERFACE("ACCESS",_param->_nb_access);
40
41      __ALLOC1_SIGNAL_IN ( in_ACCESS_VAL    ,"VAL"    ,Tcontrol_t);
42      __ALLOC1_SIGNAL_OUT(out_ACCESS_ACK    ,"ACK"    ,Tcontrol_t);
43      if (_param->_have_port_address)
44      __ALLOC1_SIGNAL_IN ( in_ACCESS_ADDRESS,"ADDRESS",Taddress_t);
45      __ALLOC1_SIGNAL_IN ( in_ACCESS_HIT    ,"HIT"    ,Tcontrol_t);
46      __ALLOC1_SIGNAL_IN ( in_ACCESS_ENTITY ,"ENTITY" ,Tentity_t );
47      __ALLOC1_SIGNAL_OUT(out_ACCESS_VICTIM ,"VICTIM" ,Tentity_t );
48    }
49
50    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51    std::string name;
52
53    switch (_param->_victim_scheme)
54      {
55//       case VICTIM_RANDOM      :
56//       case VICTIM_ROUND_ROBIN :
57//       case VICTIM_NLU         :
58      case VICTIM_PSEUDO_LRU  :
59        {
60          std::cout << "Create   : " << _name << std::endl;
61
62          _component_victim_pseudo_lru = new morpheo::behavioural::generic::victim::victim_pseudo_lru::Victim_Pseudo_LRU
63            (_name.c_str()
64#ifdef STATISTICS
65             ,param_statistics
66#endif
67             ,_param->_param_victim_pseudo_lru);
68          break;
69        }
70//       case VICTIM_LRU         :
71//       case VICTIM_FIFO        :
72      default : break;
73      }
74   
75    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
76
77    std::cout << "Instance : " << _name << std::endl;
78
79    switch (_param->_victim_scheme)
80      {
81
82//       case VICTIM_RANDOM      :
83//       case VICTIM_ROUND_ROBIN :
84//       case VICTIM_NLU         :
85      case VICTIM_PSEUDO_LRU  :
86        {
87          {
88            (*(_component_victim_pseudo_lru-> in_CLOCK )) (*( in_CLOCK));
89            (*(_component_victim_pseudo_lru-> in_NRESET)) (*( in_NRESET));
90          }
91         
92          for (uint32_t i=0; i<_param->_nb_access; i++)
93            {
94              (*(_component_victim_pseudo_lru-> in_ACCESS_VAL     [i])) (*( in_ACCESS_VAL     [i]));
95              (*(_component_victim_pseudo_lru->out_ACCESS_ACK     [i])) (*(out_ACCESS_ACK     [i]));
96              if (_param->_have_port_address)
97              (*(_component_victim_pseudo_lru-> in_ACCESS_ADDRESS [i])) (*( in_ACCESS_ADDRESS [i]));
98              (*(_component_victim_pseudo_lru-> in_ACCESS_HIT     [i])) (*( in_ACCESS_HIT     [i]));
99              (*(_component_victim_pseudo_lru-> in_ACCESS_ENTITY  [i])) (*( in_ACCESS_ENTITY  [i]));
100              (*(_component_victim_pseudo_lru->out_ACCESS_VICTIM  [i])) (*(out_ACCESS_VICTIM  [i]));
101            }
102
103          break;
104        }
105//       case VICTIM_LRU         :
106//       case VICTIM_FIFO        :
107      default : break;
108      }
109
110   
111    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112    switch (_param->_victim_scheme)
113      {
114//    case VICTIM_RANDOM      : _component = _component_victim_random     ->_component; break;
115//    case VICTIM_ROUND_ROBIN : _component = _component_victim_round_robin->_component; break;
116//    case VICTIM_NLU         : _component = _component_victim_nlu        ->_component; break;
117      case VICTIM_PSEUDO_LRU  : _component = _component_victim_pseudo_lru ->_component; break;
118//    case VICTIM_LRU         : _component = _component_victim_lru        ->_component; break;
119//    case VICTIM_FIFO        : _component = _component_victim_fifo       ->_component; break;
120      default : break;
121      }
122
123    log_printf(FUNC,Victim,FUNCTION,"End");
124  };
125
126}; // end namespace victim
127}; // end namespace generic
128
129}; // end namespace behavioural
130}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.