Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
config_cache.h
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 /* This may look like C code, but it is really -*- C++ -*-
00037  *
00038  * ====================================================================
00039  * ====================================================================
00040  *
00041  *
00042  * Revision history:
00043  *  14-Nov-96 - Original Version, duplicated from cache_parameters.h.
00044  *
00045  * Description:
00046  *
00047  * This is the description of the memory hierarcy.  It is only used
00048  * to determine how to SNL transform and for prefetching.  There's no
00049  * need to model memory hierarchy levels that are to be ignored during
00050  * transformation.  E.g. typically, there's no need to model main
00051  * memory.
00052  *
00053  * For instructions on adding new memory hierarchy configuration
00054  * parameters, see the header for config_lno.h.
00055  *
00056  * ====================================================================
00057  * ====================================================================
00058  */
00059 
00060 #ifndef config_cache_INCLUDED
00061 #define config_cache_INCLUDED
00062 
00063 #ifdef _KEEP_RCS_ID
00064 /*REFERENCED*/
00065 #endif /* _KEEP_RCS_ID */
00066 
00067 /*
00068  * NOTE: this file is included by lnodriver.c and therefore needs to be
00069  * compilable in C.  This is accomplished by declaring everything as structs
00070  * with public fields, and then having member functions be protected by
00071  * conditional compilation (conditional on C++).
00072  */
00073 
00317 typedef enum MHD_TYPE {
00318   MHD_TYPE_NONE=222,
00319   MHD_TYPE_CACHE,
00320   MHD_TYPE_MEM
00321 } MHD_TYPE;
00322 
00323 typedef struct MHD_LEVEL {
00324   MHD_TYPE  Type;
00325   INT64   Size;
00326   INT64   Effective_Size;
00327   INT32   Line_Size;
00328   INT32   Clean_Miss_Penalty;
00329   INT32   Dirty_Miss_Penalty;
00330   INT32   Associativity;
00331   INT32   TLB_Entries;
00332   INT32   Page_Size;
00333   BOOL    Prefetch_Level;
00334   INT32   TLB_Clean_Miss_Penalty;
00335   INT32   TLB_Dirty_Miss_Penalty;
00336 
00337   double  Typical_Outstanding;
00338   double  Load_Op_Overlap_1;
00339   double  Load_Op_Overlap_2;
00340   INT32   Pct_Excess_Writes_Nonhidable;
00341 
00342   /* Used just for option setting: */
00343   char *  CS_string;
00344   BOOL    CMP_Set;      /* Clean_Miss_Penalty was set explicitly */
00345   BOOL    DMP_Set;      /* Dirty_Miss_Penalty was set explicitly */
00346   BOOL    Is_Mem_Level;
00347   BOOL    Is_Mem_Level_Set;
00348   INT32   Miss_Penalty;
00349   BOOL    Miss_Penalty_Set;
00350   BOOL    TLB_CMP_Set;  /* TLB_Clean_Miss_Penalty set explicitly */
00351   BOOL    TLB_DMP_Set;  /* TLB_Dirty_Miss_Penalty set explicitly */
00352   INT32   TLB_Miss_Penalty;
00353   BOOL    TLB_MP_Set;
00354 
00355 #if defined(_LANGUAGE_C_PLUS_PLUS)
00356   MHD_LEVEL() : Type(MHD_TYPE_NONE),
00357                 Size(-1), Line_Size(-1),
00358                 Clean_Miss_Penalty(-1), Dirty_Miss_Penalty(-1),
00359                 Associativity(-1), Effective_Size(-1),
00360                 TLB_Entries(-1), Page_Size(-1), Prefetch_Level (-1),
00361                 TLB_Clean_Miss_Penalty(-1), TLB_Dirty_Miss_Penalty(-1),
00362                 Typical_Outstanding(-1.0),
00363                 Load_Op_Overlap_1(-1.0), Load_Op_Overlap_2(-1.0),
00364                 Pct_Excess_Writes_Nonhidable(-1),
00365                 CS_string (NULL), CMP_Set (FALSE), DMP_Set (FALSE),
00366                 Is_Mem_Level(-1), Is_Mem_Level_Set(FALSE),
00367                 Miss_Penalty(-1), Miss_Penalty_Set(FALSE),
00368                 TLB_CMP_Set (FALSE), TLB_DMP_Set (FALSE),
00369                 TLB_Miss_Penalty(-1), TLB_MP_Set(FALSE) {}
00370   MHD_LEVEL(MHD_TYPE type, INT64 cs, INT32 ls, INT32 cmp, INT32 dmp,
00371             INT32 assoc, INT32 entries, INT32 pagesz,
00372             INT32 tlb_cmp, INT32 tlb_dmp,
00373             double outstanding, double op_overlap_1, double op_overlap_2,
00374             INT32 pct_excess_writes_nonhidable);
00375   MHD_LEVEL(const MHD_LEVEL& x) { *this = x; }
00376   ~MHD_LEVEL() {}
00377 
00378   MHD_LEVEL& operator = (const MHD_LEVEL&);
00379 
00380   void      Print(FILE* f) const;
00381   void      Merge_Options(const MHD_LEVEL& o);
00382   BOOL      Valid() const;
00383   BOOL      TLB_Valid() const;
00384 
00385  private:
00386   void      Compute_Effective_Size();
00387 #endif
00388 
00389 } MHD_LEVEL;
00390 
00391 /* Don't forget to modify config_lno.c as well */
00392 #define MHD_MAX_LEVELS 4
00393 
00394 typedef struct MHD {
00395   INT32     Loop_Overhead_Base;
00396   INT32     Loop_Overhead_Memref;
00397   BOOL      Non_Blocking_Loads;
00398   INT32     TLB_Trustworthiness;
00399   BOOL      TLB_NoBlocking_Model;
00400   MHD_LEVEL L[MHD_MAX_LEVELS];
00401 
00402 #if defined(_LANGUAGE_C_PLUS_PLUS)
00403   INT       First();
00404   INT       Next(INT);
00405   void      Merge_Options(const MHD&);
00406   void      Initialize();
00407   void      Print(FILE*) const;
00408 
00409   MHD() : Non_Blocking_Loads(-1),
00410           Loop_Overhead_Base(-1),
00411           Loop_Overhead_Memref(-1),
00412           TLB_Trustworthiness(-1),
00413           TLB_NoBlocking_Model(-1) {}
00414   ~MHD() {}
00415 
00416  private:
00417 
00418   MHD(const MHD&);                /* undefined */
00419 #endif
00420 } MHD;
00421 
00422 extern MHD Mhd;
00423 extern MHD Mhd_Options;
00424 
00425 #endif /* config_cache_INCLUDED */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines