source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h @ 139

Last change on this file since 139 was 139, checked in by rosiere, 14 years ago
  • Add test for all configuration
  • RAT : add rat scheme (depth_save)
  • Property svn:keywords set to Id
File size: 6.7 KB
Line 
1#ifndef morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_queue_Types_h
2#define morpheo_behavioural_core_multi_front_end_front_end_decod_unit_decod_queue_Types_h
3
4/*
5 * $Id: Types.h 139 2010-07-30 14:47:27Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Behavioural/include/Types.h"
12#include "Behavioural/include/Allocation.h"
13
14namespace morpheo {
15namespace behavioural {
16namespace core {
17namespace multi_front_end {
18namespace front_end {
19namespace decod_unit {
20namespace decod_queue {
21
22  typedef enum 
23    {
24       DECOD_QUEUE_SCHEME_ONE_FIFO   // One fifo with a instruction bundle per slot (   internal fragmentation)
25      ,DECOD_QUEUE_SCHEME_MULTI_FIFO // One fifo per instruction. Rename in order   (no internal fragmentation)
26    } Tdecod_queue_scheme_t;
27
28  class decod_queue_entry_t
29  {
30  private: const uint32_t       _nb_inst        ;
31
32  public : Tcontrol_t         * _val            ;
33  public : Tcontext_t         * _context_id     ;
34  public : Tdepth_t           * _depth          ;
35#ifdef STATISTICS
36  public : uint32_t           * _instruction    ;
37#endif
38  public : Ttype_t            * _type           ;
39  public : Toperation_t       * _operation      ;
40  public : Tcontrol_t         * _no_execute     ;
41  public : Tcontrol_t         * _is_delay_slot  ;
42  public : Tcontrol_t         * _save_rat       ;
43#ifdef DEBUG
44  public : Tgeneral_data_t    * _address        ;
45#endif
46  public : Tgeneral_data_t    * _address_next   ;
47  public : Tcontrol_t         * _has_immediat   ;
48  public : Tgeneral_data_t    * _immediat       ;
49  public : Tcontrol_t         * _read_ra        ;
50  public : Tgeneral_address_t * _num_reg_ra     ;
51  public : Tcontrol_t         * _read_rb        ;
52  public : Tgeneral_address_t * _num_reg_rb     ;
53  public : Tcontrol_t         * _read_rc        ;
54  public : Tspecial_address_t * _num_reg_rc     ;
55  public : Tcontrol_t         * _write_rd       ;
56  public : Tgeneral_address_t * _num_reg_rd     ;
57  public : Tcontrol_t         * _write_re       ;
58  public : Tspecial_address_t * _num_reg_re     ;
59  public : Texception_t       * _exception_use  ;
60  public : Texception_t       * _exception      ;
61
62  public :  decod_queue_entry_t (uint32_t nb_inst):
63    _nb_inst (nb_inst)
64    {
65      ALLOC1(_val            ,Tcontrol_t         ,_nb_inst);
66      ALLOC1(_context_id     ,Tcontext_t         ,_nb_inst);
67      ALLOC1(_depth          ,Tdepth_t           ,_nb_inst);
68#ifdef STATISTICS
69      ALLOC1(_instruction    ,uint32_t           ,_nb_inst);
70#endif
71      ALLOC1(_type           ,Ttype_t            ,_nb_inst);
72      ALLOC1(_operation      ,Toperation_t       ,_nb_inst);
73      ALLOC1(_no_execute     ,Tcontrol_t         ,_nb_inst);
74      ALLOC1(_is_delay_slot  ,Tcontrol_t         ,_nb_inst);
75      ALLOC1(_save_rat       ,Tcontrol_t         ,_nb_inst);
76#ifdef DEBUG
77      ALLOC1(_address        ,Tgeneral_data_t    ,_nb_inst);
78#endif
79      ALLOC1(_address_next   ,Tgeneral_data_t    ,_nb_inst);
80      ALLOC1(_has_immediat   ,Tcontrol_t         ,_nb_inst);
81      ALLOC1(_immediat       ,Tgeneral_data_t    ,_nb_inst);
82      ALLOC1(_read_ra        ,Tcontrol_t         ,_nb_inst);
83      ALLOC1(_num_reg_ra     ,Tgeneral_address_t ,_nb_inst);
84      ALLOC1(_read_rb        ,Tcontrol_t         ,_nb_inst);
85      ALLOC1(_num_reg_rb     ,Tgeneral_address_t ,_nb_inst);
86      ALLOC1(_read_rc        ,Tcontrol_t         ,_nb_inst);
87      ALLOC1(_num_reg_rc     ,Tspecial_address_t ,_nb_inst);
88      ALLOC1(_write_rd       ,Tcontrol_t         ,_nb_inst);
89      ALLOC1(_num_reg_rd     ,Tgeneral_address_t ,_nb_inst);
90      ALLOC1(_write_re       ,Tcontrol_t         ,_nb_inst);
91      ALLOC1(_num_reg_re     ,Tspecial_address_t ,_nb_inst);
92      ALLOC1(_exception_use  ,Texception_t       ,_nb_inst);
93      ALLOC1(_exception      ,Texception_t       ,_nb_inst);
94
95      for (uint32_t i=0; i<_nb_inst; i++)
96        _val [i]=0; // default : not valid
97    }
98
99  public : ~decod_queue_entry_t (void)
100    {
101      DELETE1(_val            ,_nb_inst);
102      DELETE1(_context_id     ,_nb_inst);
103      DELETE1(_depth          ,_nb_inst);
104#ifdef STATISTICS
105      DELETE1(_instruction    ,_nb_inst);
106#endif
107      DELETE1(_type           ,_nb_inst);
108      DELETE1(_operation      ,_nb_inst);
109      DELETE1(_no_execute     ,_nb_inst);
110      DELETE1(_is_delay_slot  ,_nb_inst);
111      DELETE1(_save_rat       ,_nb_inst);
112#ifdef DEBUG
113      DELETE1(_address        ,_nb_inst);
114#endif
115      DELETE1(_address_next   ,_nb_inst);
116      DELETE1(_has_immediat   ,_nb_inst);
117      DELETE1(_immediat       ,_nb_inst);
118      DELETE1(_read_ra        ,_nb_inst);
119      DELETE1(_num_reg_ra     ,_nb_inst);
120      DELETE1(_read_rb        ,_nb_inst);
121      DELETE1(_num_reg_rb     ,_nb_inst);
122      DELETE1(_read_rc        ,_nb_inst);
123      DELETE1(_num_reg_rc     ,_nb_inst);
124      DELETE1(_write_rd       ,_nb_inst);
125      DELETE1(_num_reg_rd     ,_nb_inst);
126      DELETE1(_write_re       ,_nb_inst);
127      DELETE1(_num_reg_re     ,_nb_inst);
128      DELETE1(_exception_use  ,_nb_inst);
129      DELETE1(_exception      ,_nb_inst);
130    }
131  };
132
133}; // end namespace decod_queue
134}; // end namespace decod_unit
135}; // end namespace front_end
136}; // end namespace multi_front_end
137}; // end namespace core
138}; // end namespace behavioural
139
140  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t& x)
141  {
142    switch (x)
143      {
144      case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO   : return "one_fifo"  ; break;
145      case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO : return "multi_fifo"; break;
146      default : return ""; break;
147      }
148  };
149
150  template<> inline morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t fromString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const std::string& x)
151  {
152    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO  ))) == 0) or
153         (x.compare("one_fifo")   == 0))
154      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO;
155    if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO))) == 0) or
156         (x.compare("multi_fifo") == 0))
157      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO;
158   
159    throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
160  };
161
162
163}; // end namespace morpheo             
164
165#endif
Note: See TracBrowser for help on using the repository browser.