source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/include/Types.h @ 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: 3.0 KB
Line 
1#ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_stat_list_unit_Types_h
2#define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_register_translation_unit_stat_list_unit_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
13namespace morpheo {
14namespace behavioural {
15
16namespace core {
17namespace multi_ooo_engine {
18namespace ooo_engine {
19namespace rename_unit {
20namespace register_translation_unit {
21namespace stat_list_unit {
22
23  class stat_list_entry_t
24  {
25  public : bool     _is_free ; // set = is present in free list
26  public : bool     _is_link ; // set = is present in rat
27//public : bool     _is_valid; // set = an instruction have write in this register
28//public : uint32_t _counter ; // number of register that must read this register
29
30  public :  stat_list_entry_t (void) {};
31  public : ~stat_list_entry_t (void) {};
32
33  public : void reset (bool is_link)
34    {
35      _is_free  = 0;
36      _is_link  = is_link;
37//    _is_valid = 1;
38//    _counter  = 0;
39    }
40
41//   public : void insert_read (void)
42//     {
43//    _counter ++;
44//     }
45
46  public : void insert_write (void)
47    {
48      _is_free  = 0;
49      _is_link  = 1;
50//    _is_valid = 0;
51    }
52
53//   public : void retire_read (void)
54//     {
55//    _counter --;
56//     }
57
58  public : void retire_write_old (bool restore, bool restore_old)
59    {
60      // restore restore_old is_link
61      // 0       x           0       - normal case : unallocate
62      // 1       0           0       - event and previous update
63      // 1       1           1       - event and first update
64     
65      _is_link = restore and restore_old;
66    }
67
68  public : void retire_write_new (bool restore, bool restore_old)
69    {
70      // restore restore_old is_link
71      // 0       x           1       - normal case : allocate
72      // 1       x           0       - event, need restore oldest register
73
74      if (restore)
75        _is_link = 0;
76
77      // in all case
78//    _is_valid = 1;
79    }
80
81  public : void free (void)
82    {
83      _is_free  = 1;
84    }
85
86//   public : bool can_insert_read (uint32_t max_reader)
87//     {
88//    return ((_counter+1) < max_reader);
89//     }
90
91  public : bool can_free (void)
92    {
93      return ((_is_free  == 0) and
94              (_is_link  == 0) // and
95//            (_is_valid == 1) and // if is_link <- 0, then retire_write_old or reset
96//            (_counter  == 0)
97              );
98    }
99
100  public : friend std::ostream& operator<< (std::ostream& output,
101                                            stat_list_entry_t & x)
102    {
103      output << x._is_free  << " "
104             << x._is_link  // << " "
105//           << x._is_valid  << " "
106//              << x._counter
107        ;
108     
109      return output;
110    }
111
112  };
113
114
115}; // end namespace stat_list_unit
116}; // end namespace register_translation_unit
117}; // end namespace rename_unit
118}; // end namespace ooo_engine
119}; // end namespace multi_ooo_engine
120}; // end namespace core
121
122}; // end namespace behavioural
123}; // end namespace morpheo             
124
125#endif
Note: See TracBrowser for help on using the repository browser.