source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/include/Types.h @ 117

Last change on this file since 117 was 117, checked in by rosiere, 15 years ago

1) Platforms : add new organization for test
2) Load_Store_Unit : add array to count nb_check in store_queue
3) Issue_queue and Core_Glue : rewrite the issue network
4) Special_Register_Unit : add reset value to register CID
5) Softwares : add multicontext test
6) Softwares : add SPECINT
7) Softwares : add MiBench?
7) Read_queue : inhib access for r0
8) Change Core_Glue (network) - dont yet support priority and load balancing scheme

  • Property svn:keywords set to Id
File size: 3.1 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 117 2009-05-16 14:42:39Z 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_use       ; // set = is present in ROB (used by an instruction as destination)
28                                    // not necesseray in single thread mode : because an thread can't rename when they have an event
29                                    // in multi thread, the renaming continue and an old register can be reused
30
31  public :  stat_list_entry_t (void) {};
32  public : ~stat_list_entry_t (void) {};
33
34  public : void reset (bool is_link)
35    {
36      _is_free  = 0;
37      _is_link  = is_link;
38      _is_use   = is_link;
39    }
40
41  public : void insert_write_old (void)
42    {
43      // old is not in the rat, but is already used (if miss prediction or event)
44      _is_link  = 0;
45    }
46
47  public : void insert_write_new (void)
48    {
49      _is_free  = 0;
50      _is_link  = 1;
51      _is_use   = 1;
52    }
53
54  public : void retire_write_old (bool restore, bool restore_old)
55    {
56      // restore restore_old is_link
57      // 0       x           0       - normal case : unallocate
58      // 1       0           0       - event and previous update
59      // 1       1           1       - event and first update
60   
61      if (restore and restore_old)
62        {
63          _is_link = 1;
64//        _is_use  = 1; // already set
65        }
66      else
67        {
68//        _is_link = 0; // already unset
69          _is_use  = 0;
70        }
71       
72    }
73
74  public : void retire_write_new (bool restore, bool restore_old)
75    {
76      // restore restore_old is_link
77      // 0       x           1       - normal case : allocate
78      // 1       x           0       - event, need restore oldest register
79
80      if (restore)
81        {
82          // test if is the actual mapping (in RAT)
83          if (_is_link)
84            _is_use = 0;
85
86          _is_link = 0;
87        }
88    }
89
90  public : void free (void)
91    {
92      _is_free  = 1;
93    }
94
95  public : bool can_free (void)
96    {
97      return ((_is_free  == 0) and
98              (_is_link  == 0) and
99              (_is_use   == 0));
100    }
101
102  public : friend std::ostream& operator<< (std::ostream& output,
103                                            stat_list_entry_t & x)
104    {
105      output << x._is_free  << " "
106             << x._is_link  << " "
107             << x._is_use ;
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.