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

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

Various modif (add test, and vhdl)

  • Property svn:keywords set to Id
File size: 6.6 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 137 2010-02-16 12:35:48Z 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#ifdef DEBUG
43  public : Tgeneral_data_t    * _address        ;
44#endif
45  public : Tgeneral_data_t    * _address_next   ;
46  public : Tcontrol_t         * _has_immediat   ;
47  public : Tgeneral_data_t    * _immediat       ;
48  public : Tcontrol_t         * _read_ra        ;
49  public : Tgeneral_address_t * _num_reg_ra     ;
50  public : Tcontrol_t         * _read_rb        ;
51  public : Tgeneral_address_t * _num_reg_rb     ;
52  public : Tcontrol_t         * _read_rc        ;
53  public : Tspecial_address_t * _num_reg_rc     ;
54  public : Tcontrol_t         * _write_rd       ;
55  public : Tgeneral_address_t * _num_reg_rd     ;
56  public : Tcontrol_t         * _write_re       ;
57  public : Tspecial_address_t * _num_reg_re     ;
58  public : Texception_t       * _exception_use  ;
59  public : Texception_t       * _exception      ;
60
61  public :  decod_queue_entry_t (uint32_t nb_inst):
62    _nb_inst (nb_inst)
63    {
64      ALLOC1(_val            ,Tcontrol_t         ,_nb_inst);
65      ALLOC1(_context_id     ,Tcontext_t         ,_nb_inst);
66      ALLOC1(_depth          ,Tdepth_t           ,_nb_inst);
67#ifdef STATISTICS
68      ALLOC1(_instruction    ,uint32_t           ,_nb_inst);
69#endif
70      ALLOC1(_type           ,Ttype_t            ,_nb_inst);
71      ALLOC1(_operation      ,Toperation_t       ,_nb_inst);
72      ALLOC1(_no_execute     ,Tcontrol_t         ,_nb_inst);
73      ALLOC1(_is_delay_slot  ,Tcontrol_t         ,_nb_inst);
74#ifdef DEBUG
75      ALLOC1(_address        ,Tgeneral_data_t    ,_nb_inst);
76#endif
77      ALLOC1(_address_next   ,Tgeneral_data_t    ,_nb_inst);
78      ALLOC1(_has_immediat   ,Tcontrol_t         ,_nb_inst);
79      ALLOC1(_immediat       ,Tgeneral_data_t    ,_nb_inst);
80      ALLOC1(_read_ra        ,Tcontrol_t         ,_nb_inst);
81      ALLOC1(_num_reg_ra     ,Tgeneral_address_t ,_nb_inst);
82      ALLOC1(_read_rb        ,Tcontrol_t         ,_nb_inst);
83      ALLOC1(_num_reg_rb     ,Tgeneral_address_t ,_nb_inst);
84      ALLOC1(_read_rc        ,Tcontrol_t         ,_nb_inst);
85      ALLOC1(_num_reg_rc     ,Tspecial_address_t ,_nb_inst);
86      ALLOC1(_write_rd       ,Tcontrol_t         ,_nb_inst);
87      ALLOC1(_num_reg_rd     ,Tgeneral_address_t ,_nb_inst);
88      ALLOC1(_write_re       ,Tcontrol_t         ,_nb_inst);
89      ALLOC1(_num_reg_re     ,Tspecial_address_t ,_nb_inst);
90      ALLOC1(_exception_use  ,Texception_t       ,_nb_inst);
91      ALLOC1(_exception      ,Texception_t       ,_nb_inst);
92
93      for (uint32_t i=0; i<_nb_inst; i++)
94        _val [i]=0; // default : not valid
95    }
96
97  public : ~decod_queue_entry_t (void)
98    {
99      DELETE1(_val            ,_nb_inst);
100      DELETE1(_context_id     ,_nb_inst);
101      DELETE1(_depth          ,_nb_inst);
102#ifdef STATISTICS
103      DELETE1(_instruction    ,_nb_inst);
104#endif
105      DELETE1(_type           ,_nb_inst);
106      DELETE1(_operation      ,_nb_inst);
107      DELETE1(_no_execute     ,_nb_inst);
108      DELETE1(_is_delay_slot  ,_nb_inst);
109#ifdef DEBUG
110      DELETE1(_address        ,_nb_inst);
111#endif
112      DELETE1(_address_next   ,_nb_inst);
113      DELETE1(_has_immediat   ,_nb_inst);
114      DELETE1(_immediat       ,_nb_inst);
115      DELETE1(_read_ra        ,_nb_inst);
116      DELETE1(_num_reg_ra     ,_nb_inst);
117      DELETE1(_read_rb        ,_nb_inst);
118      DELETE1(_num_reg_rb     ,_nb_inst);
119      DELETE1(_read_rc        ,_nb_inst);
120      DELETE1(_num_reg_rc     ,_nb_inst);
121      DELETE1(_write_rd       ,_nb_inst);
122      DELETE1(_num_reg_rd     ,_nb_inst);
123      DELETE1(_write_re       ,_nb_inst);
124      DELETE1(_num_reg_re     ,_nb_inst);
125      DELETE1(_exception_use  ,_nb_inst);
126      DELETE1(_exception      ,_nb_inst);
127    }
128  };
129
130}; // end namespace decod_queue
131}; // end namespace decod_unit
132}; // end namespace front_end
133}; // end namespace multi_front_end
134}; // end namespace core
135}; // end namespace behavioural
136
137  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)
138  {
139    switch (x)
140      {
141      case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO   : return "one_fifo"  ; break;
142      case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO : return "multi_fifo"; break;
143      default : return ""; break;
144      }
145  };
146
147  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)
148  {
149    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
150         (x.compare("one_fifo")   == 0))
151      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO;
152    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
153         (x.compare("multi_fifo") == 0))
154      return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO;
155   
156    throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
157  };
158
159
160}; // end namespace morpheo             
161
162#endif
Note: See TracBrowser for help on using the repository browser.