• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/core/techModels/libMcPATbeta/logic.h

00001 /*****************************************************************************
00002  *                                McPAT
00003  *                      SOFTWARE LICENSE AGREEMENT
00004  *            Copyright 2009 Hewlett-Packard Development Company, L.P.
00005  *                          All Rights Reserved
00006  *
00007  * Permission to use, copy, and modify this software and its documentation is
00008  * hereby granted only under the following terms and conditions.  Both the
00009  * above copyright notice and this permission notice must appear in all copies
00010  * of the software, derivative works or modified versions, and any portions
00011  * thereof, and both notices must appear in supporting documentation.
00012  *
00013  * Any User of the software ("User"), by accessing and using it, agrees to the
00014  * terms and conditions set forth herein, and hereby grants back to Hewlett-
00015  * Packard Development Company, L.P. and its affiliated companies ("HP") a
00016  * non-exclusive, unrestricted, royalty-free right and license to copy,
00017  * modify, distribute copies, create derivate works and publicly display and
00018  * use, any changes, modifications, enhancements or extensions made to the
00019  * software by User, including but not limited to those affording
00020  * compatibility with other hardware or software, but excluding pre-existing
00021  * software applications that may incorporate the software.  User further
00022  * agrees to use its best efforts to inform HP of any such changes,
00023  * modifications, enhancements or extensions.
00024  *
00025  * Correspondence should be provided to HP at:
00026  *
00027  * Director of Intellectual Property Licensing
00028  * Office of Strategy and Technology
00029  * Hewlett-Packard Company
00030  * 1501 Page Mill Road
00031  * Palo Alto, California  94304
00032  *
00033  * The software may be further distributed by User (but not offered for
00034  * sale or transferred for compensation) to third parties, under the
00035  * condition that such third parties agree to abide by the terms and
00036  * conditions of this license.
00037  *
00038  * THE SOFTWARE IS PROVIDED "AS IS" WITH ANY AND ALL ERRORS AND DEFECTS
00039  * AND USER ACKNOWLEDGES THAT THE SOFTWARE MAY CONTAIN ERRORS AND DEFECTS.
00040  * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THE SOFTWARE, INCLUDING ALL
00041  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL
00042  * HP BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
00043  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00044  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER ACTION, ARISING
00045  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
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);//, const ParseXML *_XML_interface);
00075         bool is_default;
00076         InputParameter l_ip;
00077         uca_org_t local_result;
00078         const ParseXML *XML_interface;
00079         /*-----SoM SST---------*/
00080          /* num_arbiter is necessary for fast leakage feedback. Note that num_arbiter declaration is deleted
00081            in selection_power() function.*/
00082         int num_arbiter;
00083         /*-----EoM SST---------*/
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         //added for SST
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         //added for SST
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         //added for SST
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 //      int pipeline_stages;
00191 //      int tot_stage_vector, per_stage_vector;
00192         bool process_ind;
00193         double WNANDn ;
00194         double WNANDp;
00195         double load_per_pipeline_stage;
00196 //      int  Hthread,  num_thread, fetchWidth, decodeWidth, issueWidth, commitWidth, instruction_length;
00197 //      int  PC_width, opcode_length, num_arch_reg_tag, data_width,num_phsical_reg_tag, address_width;
00198 //      bool thread_clock_gated;
00199 //      bool in_order, multithreaded;
00200         void compute_stage_vector();
00201         void compute();
00202         ~Pipeline(){
00203                 local_result.cleanup();
00204         };
00205 
00206 };
00207 
00208 //class core_pipeline :public pipeline{
00209 //public:
00210 //      int  Hthread,  num_thread, fetchWidth, decodeWidth, issueWidth, commitWidth, instruction_length;
00211 //      int  PC_width, opcode_length, num_arch_reg_tag, data_width,num_phsical_reg_tag, address_width;
00212 //      bool thread_clock_gated;
00213 //      bool in_order, multithreaded;
00214 //      core_pipeline(bool _is_default, const InputParameter *configure_interface);
00215 //      virtual void compute_stage_vector();
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         /*Added for SST*/
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 /* LOGIC_H_ */

Generated on Fri Oct 22 2010 11:02:16 for SST by  doxygen 1.7.1