src/Sim/Core/DataPredTypes.h

説明を見る。
00001 // 
00002 // Copyright (c) 2005-2008 Kenichi Watanabe.
00003 // Copyright (c) 2005-2008 Yasuhiro Watari.
00004 // Copyright (c) 2005-2008 Hironori Ichibayashi.
00005 // Copyright (c) 2008-2009 Kazuo Horio.
00006 // Copyright (c) 2009-2013 Naruki Kurata.
00007 // Copyright (c) 2005-2013 Ryota Shioya.
00008 // Copyright (c) 2005-2013 Masahiro Goshima.
00009 // 
00010 // This software is provided 'as-is', without any express or implied
00011 // warranty. In no event will the authors be held liable for any damages
00012 // arising from the use of this software.
00013 // 
00014 // Permission is granted to anyone to use this software for any purpose,
00015 // including commercial applications, and to alter it and redistribute it
00016 // freely, subject to the following restrictions:
00017 // 
00018 // 1. The origin of this software must not be misrepresented; you must not
00019 // claim that you wrote the original software. If you use this software
00020 // in a product, an acknowledgment in the product documentation would be
00021 // appreciated but is not required.
00022 // 
00023 // 2. Altered source versions must be plainly marked as such, and must not be
00024 // misrepresented as being the original software.
00025 // 
00026 // 3. This notice may not be removed or altered from any source
00027 // distribution.
00028 // 
00029 // 
00030 
00031 
00032 #ifndef SIM_CORE_DATA_PRED_TYPES_H
00033 #define SIM_CORE_DATA_PRED_TYPES_H
00034 
00035 // Definition of a type, policy and point of 
00036 // data prediction miss recovery.
00037 // Actual implementation of data prediction miss recovery is in
00038 // Core, InorderList, MemOrderManager...
00039 
00040 #include "Env/Param/ParamExchange.h"
00041 
00042 namespace Onikiri 
00043 {
00044 
00045     class DataPredMissRecovery : public ParamExchangeChild
00046     {
00047     public:
00048 
00049         //
00050         // Data prediction type
00051         //
00052         enum Type 
00053         {
00054             TYPE_LATENCY,       // Latency prediction
00055 
00056             TYPE_ADDRESS_MATCH, // Address match/unmatch prediction
00057 
00058             TYPE_PARTIAL_LOAD,  // Partial load
00059                                 // This type is not exactly data prediction, 
00060                                 // but this is defined here.
00061                                 // This type defines a recovery method on partial load,
00062                                 // which read data that is written by its predecessor.
00063             
00064             TYPE_VALUE,         // Value prediction
00065                                 // Value prediction is not implemented yet and this
00066                                 // is for user extension.
00067 
00068             TYPE_END            // End sentinel
00069         };
00070 
00071         //
00072         // Recovery policy
00073         //
00074         enum Policy 
00075         {
00076             // Re-fetch
00077             POLICY_REFETCH,         
00078             
00079             // Invalidate ready signals of ALL successor instructions 
00080             // and re-issue these from a issue queue.
00081             // This policy requires that a scheduler must
00082             // hold instructions after instruction issue.
00083             POLICY_REISSUE_ALL,     
00084 
00085             // Invalidate ONLY ready signals of dependent successor instructions 
00086             // and re-issue these from a issue queue.
00087             // This policy requires that a scheduler must
00088             // hold instructions after instruction issue.
00089             POLICY_REISSUE_SELECTIVE,   
00090         
00091             // Invalidate ready signals of ALL Unfinished instructions
00092             // and re-issue these from a issue queue.
00093             // This policy requires that a scheduler 
00094             // hold instructions before instruction finish.
00095             POLICY_REISSUE_NOT_FINISHED,
00096 
00097             // Re-dispatch ALL successor instructions from a re-dispatch buffer.
00098             POLICY_REDISPATCH_ALL,
00099 
00100             // End sentinel
00101             POLICY_END
00102         };
00103 
00104         // A point from which instructions are recovered
00105         enum From 
00106         {
00107             // Recovered from a producer( an instruction that did prediction ).
00108             // This means that an instruction that did prediction itself is recovered.
00109             FROM_PRODUCER,
00110 
00111             // Recovered from a next instruction of a producer.
00112             FROM_NEXT_OF_PRODUCER,
00113 
00114             // Recovered from a first consumer instruction of a producer.
00115             FROM_CONSUMER,
00116             
00117             // End sentinel
00118             FROM_END
00119         };
00120 
00121         BEGIN_PARAM_MAP( "" )
00122 
00123             BEGIN_PARAM_BINDING(  "@Type", m_type, Type )
00124                 PARAM_BINDING_ENTRY( "Latency",         TYPE_LATENCY )
00125                 PARAM_BINDING_ENTRY( "AddressMatch",    TYPE_ADDRESS_MATCH )
00126                 PARAM_BINDING_ENTRY( "PartialLoad",     TYPE_PARTIAL_LOAD )
00127                 PARAM_BINDING_ENTRY( "Value",           TYPE_VALUE )
00128             END_PARAM_BINDING()
00129 
00130             BEGIN_PARAM_BINDING(  "@Policy", m_policy, Policy )
00131                 PARAM_BINDING_ENTRY( "Refetch",     POLICY_REFETCH )
00132                 PARAM_BINDING_ENTRY( "ReissueAll",  POLICY_REISSUE_ALL )
00133                 PARAM_BINDING_ENTRY( "ReissueSelective", POLICY_REISSUE_SELECTIVE )
00134                 PARAM_BINDING_ENTRY( "ReissueNotFinished", POLICY_REISSUE_NOT_FINISHED )
00135                 PARAM_BINDING_ENTRY( "Redispatch",  POLICY_REDISPATCH_ALL )
00136             END_PARAM_BINDING()
00137 
00138             BEGIN_PARAM_BINDING(  "@From", m_from, From )
00139                 PARAM_BINDING_ENTRY( "Producer",        FROM_PRODUCER )
00140                 PARAM_BINDING_ENTRY( "NextOfProducer",  FROM_NEXT_OF_PRODUCER )
00141                 PARAM_BINDING_ENTRY( "Consumer",        FROM_CONSUMER )
00142             END_PARAM_BINDING()
00143 
00144         END_PARAM_MAP()
00145 
00146         DataPredMissRecovery( Type type = TYPE_END, Policy policy = POLICY_END, From from = FROM_END ) : 
00147             m_type  ( type ),
00148             m_policy( policy ), 
00149             m_from  ( from   )
00150         {}
00151 
00152         Policy GetPolicy()  const { return m_policy;    }
00153         From     GetFrom()  const { return m_from;      }
00154 
00155         bool IsRefetch()            const   {   return m_policy == POLICY_REFETCH;          }
00156         bool IsReissueAll()         const   {   return m_policy == POLICY_REISSUE_ALL;      }
00157         bool IsReissueSelective()   const   {   return m_policy == POLICY_REISSUE_SELECTIVE;}
00158         bool IsRedispatch()         const   {   return m_policy == POLICY_REDISPATCH_ALL;   }
00159         bool IsReissueNotFinished() const   {   return m_policy == POLICY_REISSUE_NOT_FINISHED;         }
00160 
00161         bool FromProducer()         const { return m_from == FROM_PRODUCER;         }
00162         bool FromNextOfProducer()   const { return m_from == FROM_NEXT_OF_PRODUCER; }
00163         bool FromConsumer()         const { return m_from == FROM_CONSUMER;         }
00164 
00165 
00166         // Check integrity of 'policy' and 'from'.
00167         void Validate();
00168 
00169         // Decide whether checkpointing is required or not for an op of 'opClass'.
00170         bool IsRequiredBeforeCheckpoint( const OpClass& opClass ) const;
00171         bool IsRequiredAfterCheckpoint ( const OpClass& opClass ) const;
00172 
00173     protected:
00174 
00175         Type    m_type;
00176         Policy  m_policy;
00177         From    m_from;
00178     };
00179 
00180 
00181     // A pipeline model of a load instruction.
00182     enum LoadPipelineModel
00183     {
00184         LPM_INVALID,
00185 
00186         // Add ports to a RF for a higher level cache read
00187         LPM_SINGLE_ISSUE,   
00188 
00189         // Do not add ports to a RF and issue load instruction
00190         // more than once.                                  
00191         LPM_MULTI_ISSUE     
00192     };
00193 
00194     // Whether forget or retain ops in a scheduler after issue.
00195     enum SchedulerRemovePolicy
00196     {
00197         RP_FOLLOW_CORE,         // Follow a policy of a core.
00198         RP_REMOVE,              // Remove ops after issue.
00199         RP_RETAIN,              // Retain ops to commit. (Remove ops after commit.)
00200         RP_REMOVE_AFTER_FINISH  // Remove ops after op finishes.
00201                                 // This policy is similar to that of Alpha 21264.
00202     };
00203 
00204     // Where are checkpoints taken.
00205     enum CheckpointingPolicy
00206     {
00207         // Checkpoints are taken for all ops.
00208         CP_ALL, 
00209 
00210         // Checkpoints are taken for necessary ops the require 
00211         // Core::IsRequiredCheckpointBefore() and Core::IsRequiredCheckpointAfter.
00212         CP_AUTO 
00213     };
00214 }; // namespace Onikiri
00215 
00216 #endif // SIM_CORE_DATA_PRED_TYPES_H
00217 

Onikiri2に対してTue Jun 18 14:34:22 2013に生成されました。  doxygen 1.4.7