00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef LOGIC_H_
00049 #define LOGIC_H_
00050
00051 #include "const.h"
00052 #include "McPATcomponent.h"
00053 #include "basic_components.h"
00054 #include "basic_circuit.h"
00055 #include "cacti_interface.h"
00056 #include "decoder.h"
00057 #include "parameter.h"
00058 #include "xmlParser.h"
00059 #include "XML_Parse.h"
00060 #include "arch_const.h"
00061 #include <cstring>
00062 #include <iostream>
00063 #include <cmath>
00064 #include <cassert>
00065
00066
00067 using namespace std;
00068
00069 class selection_logic : public McPATComponent{
00070 public:
00071 selection_logic(bool _is_default, int win_entries_,
00072 int issue_width_, const InputParameter *configure_interface,
00073 enum Device_ty device_ty_=Core_device,
00074 enum Core_type core_ty_=Inorder);
00075 bool is_default;
00076 InputParameter l_ip;
00077 uca_org_t local_result;
00078 const ParseXML *XML_interface;
00079
00080
00081
00082 int num_arbiter;
00083
00084
00085 int win_entries;
00086 int issue_width;
00087 int num_threads;
00088 enum Device_ty device_ty;
00089 enum Core_type core_ty;
00090
00091 void selection_power();
00092
00093
00094 void SSTleakage_feedback(double temperature);
00095
00096 };
00097
00098 class dep_resource_conflict_check : public McPATComponent{
00099 public:
00100 dep_resource_conflict_check(const InputParameter *configure_interface, const CoreDynParam & dyn_p_, int compare_bits_, bool _is_default=true);
00101 InputParameter l_ip;
00102 uca_org_t local_result;
00103 double WNORn, WNORp, Wevalinvp, Wevalinvn, Wcompn, Wcompp, Wcomppreequ;
00104 CoreDynParam coredynp;
00105 int compare_bits;
00106 bool is_default;
00107 statsDef tdp_stats;
00108 statsDef rtp_stats;
00109 statsDef stats_t;
00110 powerDef power_t;
00111
00112 void conflict_check_power();
00113 double compare_cap();
00114 ~dep_resource_conflict_check(){
00115 local_result.cleanup();
00116 }
00117
00118 void SSTleakage_feedback(double temperature);
00119
00120 };
00121
00122 class inst_decoder: public McPATComponent{
00123 public:
00124 inst_decoder(bool _is_default, const InputParameter *configure_interface,
00125 int opcode_length_,
00126 int num_decoders_,
00127 bool x86_,
00128 enum Device_ty device_ty_=Core_device,
00129 enum Core_type core_ty_=Inorder);
00130 inst_decoder();
00131 bool is_default;
00132 int opcode_length;
00133 int num_decoders;
00134 bool x86;
00135 int num_decoder_segments;
00136 int num_decoded_signals;
00137 InputParameter l_ip;
00138 uca_org_t local_result;
00139 enum Device_ty device_ty;
00140 enum Core_type core_ty;
00141
00142 Decoder * final_dec;
00143 Predec * pre_dec;
00144
00145 statsDef tdp_stats;
00146 statsDef rtp_stats;
00147 statsDef stats_t;
00148 powerDef power_t;
00149 void inst_decoder_delay_power();
00150 ~inst_decoder();
00151
00152
00153 void SSTleakage_feedback(double temperature);
00154
00155 };
00156
00157 class DFFCell : public McPATComponent {
00158 public:
00159 DFFCell(bool _is_dram, double _WdecNANDn, double _WdecNANDp,double _cell_load,
00160 const InputParameter *configure_interface);
00161 InputParameter l_ip;
00162 bool is_dram;
00163 double cell_load;
00164 double WdecNANDn;
00165 double WdecNANDp;
00166 double clock_cap;
00167 int model;
00168 int n_switch;
00169 int n_keep_1;
00170 int n_keep_0;
00171 int n_clock;
00172 powerDef e_switch;
00173 powerDef e_keep_1;
00174 powerDef e_keep_0;
00175 powerDef e_clock;
00176
00177 double fpfp_node_cap(unsigned int fan_in, unsigned int fan_out);
00178 void compute_DFF_cell(void);
00179 };
00180
00181 class Pipeline : public McPATComponent{
00182 public:
00183 Pipeline(const InputParameter *configure_interface, const CoreDynParam & dyn_p_, enum Device_ty device_ty_=Core_device, bool _is_core_pipeline=true, bool _is_default=true);
00184 InputParameter l_ip;
00185 uca_org_t local_result;
00186 CoreDynParam coredynp;
00187 enum Device_ty device_ty;
00188 bool is_core_pipeline, is_default;
00189 double num_piperegs;
00190
00191
00192 bool process_ind;
00193 double WNANDn ;
00194 double WNANDp;
00195 double load_per_pipeline_stage;
00196
00197
00198
00199
00200 void compute_stage_vector();
00201 void compute();
00202 ~Pipeline(){
00203 local_result.cleanup();
00204 };
00205
00206 };
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 class FunctionalUnit :public McPATComponent{
00220 public:
00221 ParseXML *XML;
00222 int ithCore;
00223 InputParameter interface_ip;
00224 CoreDynParam coredynp;
00225 double FU_height;
00226 double clockRate,executionTime;
00227 double num_fu;
00228 double energy, base_energy,per_access_energy;
00229 bool is_default;
00230 enum FU_type fu_type;
00231 statsDef tdp_stats;
00232 statsDef rtp_stats;
00233 statsDef stats_t;
00234 powerDef power_t;
00235
00236 FunctionalUnit(ParseXML *XML_interface, int ithCore_, InputParameter* interface_ip_,const CoreDynParam & dyn_p_, enum FU_type fu_type);
00237 void computeEnergy(bool is_tdp=true);
00238 void displayEnergy(uint32_t indent = 0,int plevel = 100, bool is_tdp=true);
00239
00240
00241 void SSTcomputeEnergy(bool is_tdp=true, double alu_access=0, double mul_access=0, double fpu_access=0);
00242 void SSTleakage_feedback(double temperature);
00243
00244
00245
00246 };
00247
00248 class UndiffCore :public McPATComponent{
00249 public:
00250 UndiffCore(ParseXML* XML_interface, int ithCore_, InputParameter* interface_ip_, const CoreDynParam & dyn_p_, bool exist_=true, bool embedded_=false);
00251 ParseXML *XML;
00252 int ithCore;
00253 InputParameter interface_ip;
00254 CoreDynParam coredynp;
00255 double clockRate,executionTime;
00256 double scktRatio, chip_PR_overhead, macro_PR_overhead;
00257 enum Core_type core_ty;
00258 bool opt_performance, embedded;
00259 double pipeline_stage,num_hthreads,issue_width;
00260 bool is_default;
00261
00262 void displayEnergy(uint32_t indent = 0,int plevel = 100, bool is_tdp=true);
00263 ~UndiffCore(){};
00264 bool exist;
00265
00266
00267 };
00268 #endif