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

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