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 #ifndef _KAPI_IA64_H_
00031 #define _KAPI_IA64_H_
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 typedef int kapi_iid_t;
00049 typedef int kapi_fu_t;
00050 typedef int kapi_port_t;
00051 typedef int kapi_cport_t;
00052 typedef int kapi_cutport_t;
00053 typedef int kapi_bid_t;
00054 typedef int kapi_cluster_t;
00055
00056
00057 #define kapi_fuNONE -1
00058
00059 #define kapi_bv32PORTS_ALL (0xFFFFFFFF)
00060
00061
00062
00063
00064
00065
00066 #include "kapi.h"
00067
00068
00069 typedef enum _RANGE_T {
00070 kapi_rangeEXACT_LATENCY,
00071 kapi_rangeMIN_LATENCY,
00072 kapi_rangeMAX_LATENCY
00073 } kapi_range_t;
00074
00075
00076
00077 #define kapi_nUT 4
00078 #define kapi_utFIRST 0
00079 #define kapi_utLAST 3
00080 typedef enum KAPI_UT_T {
00081 kapi_utM = 0,
00082 kapi_utI = 1,
00083 kapi_utF = 2,
00084 kapi_utB = 3
00085 } kapi_ut_t;
00086
00087
00088
00089
00090
00091
00092 #define kapi_itNONE -1
00093 #define kapi_itFIRST 0
00094 #define kapi_itLAST 6
00095 #define kapi_nIT (kapi_itLAST+1)
00096 typedef enum KAPI_IT_T {
00097 kapi_itA = 0,
00098 kapi_itM = 1,
00099 kapi_itB = 2,
00100 kapi_itBl = 3,
00101 kapi_itI = 4,
00102 kapi_itF = 5,
00103 kapi_itL = 6
00104 } kapi_it_t;
00105
00106
00107
00108
00109
00110
00111 #define kapi_nSYL 5
00112 #define kapi_sylFIRST 0
00113 #define kapi_sylLAST 4
00114 typedef enum KAPI_SYL_T {
00115 kapi_sylI = 0,
00116 kapi_sylM = 1,
00117 kapi_sylF = 2,
00118 kapi_sylB = 3,
00119 kapi_sylL = 4
00120 } kapi_syl_t;
00121
00122
00123
00124
00125 #define kapi_nBID 16
00126 #define kapi_lognBID 4
00127 #define nSYLBID 3
00128
00129 #define kapi_bidFIRST 0x0
00130 #define kapi_bidLAST 0xF
00131
00132 typedef struct PAPAIR_T {
00133 kapi_cluster_t cluster;
00134 kapi_fu_t fuSrc, fuDest;
00135 kapi_cutport_t cutportSrc, cutportDest;
00136 kapi_ut_t utSrc, utDest;
00137 int oppSrc, oppDest;
00138 int iValue;
00139 } papair_t;
00140
00141 typedef struct PEPAIR_T {
00142 kapi_cluster_t clusterSrc, clusterDest;
00143 kapi_fu_t fuSrc, fuDest;
00144 kapi_cutport_t cutportSrc, cutportDest;
00145 kapi_ut_t utSrc, utDest;
00146 int oppSrc, oppDest;
00147 int iValue;
00148 } pepair_t;
00149
00150 typedef struct UPORT_T {
00151 kapi_cluster_t cluster;
00152 kapi_ut_t ut;
00153 kapi_cutport_t cutport;
00154 } uport_t;
00155
00156
00157
00158 typedef enum KAPI_CACHE_CONTENT_E {
00159 KAPI_CACHE_CONTENT_INSTRUCTION = 0x1,
00160 KAPI_CACHE_CONTENT_DATA = 0x2,
00161 KAPI_CACHE_CONTENT_OTHER = 0x4
00162 } kapi_cache_content_e;
00163
00164 typedef enum KAPI_CACHE_TYPES_E {
00165 KAPI_CACHE_TYPE_INSTRUCTION,
00166 KAPI_CACHE_TYPE_DATA,
00167 KAPI_CACHE_TYPE_UNIFIED,
00168 } kapi_cache_types_e;
00169 #define KAPI_NCACHE_TYPES (KAPI_CACHE_TYPE_UNIFIED + 1)
00170
00171
00172
00173 #define KAPI_MAX_CACHE_PORTS_IMPL 16
00174
00175
00176 typedef enum KAPI_CACHE_POLICY_WRITE_E {
00177 KAPI_CACHE_POLICY_WRITE_OTHER=0,
00178 KAPI_CACHE_POLICY_WRITE_WB=1,
00179 KAPI_CACHE_POLICY_WRITE_WT=2
00180 } kapi_cache_policy_write_e;
00181
00182
00183 typedef enum KAPI_CACHE_POLICY_REPL_E {
00184 KAPI_CACHE_POLICY_REPL_OTHER=0,
00185 KAPI_CACHE_POLICY_REPL_LRU=1,
00186 KAPI_CACHE_POLICY_REPL_NRU=2
00187 } kapi_cache_policy_repl_e;
00188
00189
00190 typedef enum KAPI_CACHE_POLICY_ALLOC_E {
00191 KAPI_CACHE_POLICY_ALLOC_OTHER=0,
00192 KAPI_CACHE_POLICY_ALLOC_WA=1,
00193 KAPI_CACHE_POLICY_ALLOC_NWA=2
00194 } kapi_cache_policy_alloc_e;
00195
00196
00197 #define KAPI_ACCESSMODE_OTHER (1 << 0)
00198 #define KAPI_ACCESSMODE_READ (1 << 1)
00199 #define KAPI_ACCESSMODE_WRITE (1 << 2)
00200 #define KAPI_ACCESSMODE_SNOOP (1 << 3)
00201 #define KAPI_ACCESSMODE_FETCH (1 << 4)
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 typedef struct KAPI_CACHEPORT_T {
00220 bv32_t bv32AccessMode;
00221 } kapi_cacheport_t;
00222
00223 typedef struct KAPI_CACHE_T {
00224 int nLines;
00225 int nBytesLine;
00226 int nWays;
00227
00228 int nCachePorts;
00229 kapi_cacheport_t cacheportInfo[ KAPI_MAX_CACHE_PORTS_IMPL ];
00230
00231 bv32_t bv32CacheContents;
00232 kapi_cache_policy_write_e iWritePolicy;
00233 kapi_cache_policy_repl_e iReplPolicy;
00234 kapi_cache_policy_alloc_e iAllocPolicy;
00235 int nCyclesRead;
00236 } kapi_cache_t;
00237
00238
00239 typedef enum
00240 {
00241 kapi_fu_info_approximate_latency=0,
00242 kapi_fu_info_no_latency_info=1,
00243 kapi_fu_info_no_primary_source=30,
00244 kapi_fu_info_no_primary_destination=31
00245 } kapi_fu_infobits_e;
00246
00247 typedef enum
00248 {
00249 kapi_latency_type_none,
00250 kapi_latency_type_approximate,
00251 kapi_latency_type_full
00252 } kapi_latency_type_t;
00253
00254 typedef enum
00255 {
00256 kapi_op_role_dest,
00257 kapi_op_role_src
00258 } kapi_operand_role_e;
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269 void *KAPI_ia64_Initialize(void *pConfig);
00270
00271
00272
00273 extern int KAPI_fEnableIA64call_from_header(void **pConfig, void *pHeaderConfig, int iReserved);
00274
00275
00276
00277
00278
00279 #ifdef MED_API
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297 int KAPI_init(void **pLayer2Info, void **pLayer3Info, int iReserved);
00298
00299 int KAPI_init_external(void **pLayer2Info, void **pLayer3Info, void *pLayer2Data, void *pLayer3Data);
00300
00301
00302
00303 #endif
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329 extern int KAPI_iidCount( void *pConfig );
00330
00331
00332 extern kapi_it_t KAPI_iid2it( void *pConfig, kapi_iid_t iid, int iVariant );
00333
00334 extern kapi_fu_t KAPI_iid2fu( void *pConfig, kapi_iid_t iid, int iVariant );
00335
00336 extern char *KAPI_iid2mnemonic( void *pConfig, kapi_iid_t iid,
00337 int iVariant );
00338 extern char *KAPI_iid2uniqueName( void *pConfig, kapi_iid_t iid,
00339 int iVariant );
00340 extern kapi_iid_t KAPI_uniqueName2iid( void *pConfig, char *pchName,
00341 int iVariant );
00342
00343
00344 extern int KAPI_oppGetSource( void *pConfig, kapi_fu_t fu, char *pchOppName );
00345 extern int KAPI_oppGetDest( void *pConfig, kapi_fu_t fu, char *pchOppName );
00346
00347 extern int KAPI_GetOppIndex(void *pConfig, kapi_iid_t iid,
00348 int iIndex, kapi_operand_role_e iRole,
00349 char *pchOppName);
00350
00351
00352
00353
00354 extern int KAPI_BundleIssueWidth( void *pConfig, kapi_cluster_t cluster );
00355
00356
00357 extern int KAPI_DisperseCount4syl( void *pConfig, kapi_syl_t syl );
00358
00359 extern int KAPI_fuCount( void *pConfig );
00360
00361 extern int KAPI_clusterCount( void *pConfig );
00362
00363
00364 extern char *KAPI_fu2fuName( void *pConfig, kapi_fu_t fu, int iVariant );
00365
00366 extern int KAPI_fuName2fuIndex( void *pConfig, char *fuName );
00367
00368 extern bv32_t KAPI_fuGetMiscInfo(void *pConfig, kapi_fu_t fu);
00369 extern kapi_latency_type_t KAPI_fuGetLatencyType(void *pConfig, kapi_fu_t fu);
00370
00371
00372
00373 extern int KAPI_srcOppCount( void *pConfig, kapi_fu_t fuSrc );
00374 extern int KAPI_destOppCount( void *pConfig, kapi_fu_t fuDest );
00375
00376
00377 extern char *KAPI_srcOppName( void *pConfig, kapi_fu_t fuSrc, int opp );
00378 extern char *KAPI_destOppName( void *pConfig, kapi_fu_t fuDest, int opp );
00379
00380
00381 extern bv32_t KAPI_cportMask4fu( void *pConfig, kapi_cluster_t cluster,
00382 kapi_fu_t fu );
00383 extern bv32_t KAPI_cportMask4ut( void *pConfig, kapi_cluster_t cluster,
00384 kapi_ut_t ut );
00385
00386
00387 extern int KAPI_cportCount( void *pConfig, kapi_cluster_t cluster );
00388 extern int KAPI_cportCount4fu( void *pConfig, kapi_cluster_t cluster,
00389 kapi_fu_t fu );
00390 extern int KAPI_cportCount4ut( void *pConfig, kapi_cluster_t cluster,
00391 kapi_ut_t ut );
00392 extern int KAPI_cutportCount( void *pConfig, kapi_cluster_t cluster,
00393 kapi_ut_t utIn );
00394
00395
00396
00397 extern void KAPI_portInfo( void *pConfig, kapi_port_t port,
00398 kapi_cluster_t *pcluster, kapi_cport_t *pcport,
00399 kapi_ut_t *put, kapi_cutport_t *pcutport );
00400 extern void KAPI_cportInfo( void *pConfig, kapi_cluster_t cluster,
00401 kapi_cport_t cport,
00402 kapi_port_t *pport, kapi_ut_t *put, kapi_cutport_t *pcutport );
00403 extern void KAPI_cutportInfo( void *pConfig, kapi_cluster_t cluster,
00404 kapi_ut_t ut, kapi_cutport_t cutport,
00405 kapi_port_t *pport, kapi_cport_t *pcport );
00406
00407
00408
00409
00410
00411
00412 extern int KAPI_CoreLatency( void *pConfig, kapi_fu_t fuProd, int oppProd );
00413
00414 extern int KAPI_InterClusterBypass( void *pConfig,
00415 kapi_cluster_t clusterProd, kapi_fu_t fuProd,
00416 int oppProd, kapi_ut_t utProd, kapi_cutport_t
00417 cutportProd,
00418 kapi_cluster_t clusterCons, kapi_fu_t fuCons,
00419 int oppCons, kapi_ut_t utCons, kapi_cutport_t
00420 cutportCons );
00421
00422
00423 extern int KAPI_IntraClusterBypass( void *pConfig, kapi_cluster_t cluster,
00424 kapi_fu_t fuProd, int oppProd, kapi_ut_t utProd, kapi_cutport_t
00425 cutportProd,
00426 kapi_fu_t fuCons, int oppCons, kapi_ut_t utCons, kapi_cutport_t
00427 cutportCons );
00428
00429
00430 extern int KAPI_ClusterDistance( void *pConfig,
00431 kapi_cluster_t clusterProd, kapi_cluster_t clusterDest );
00432
00433
00434 extern papair_t *KAPI_IntraClusterBypassList( void *pConfig, kapi_cluster_t clr,
00435 kapi_fu_t fuProd, int oppProd, kapi_ut_t utProd, kapi_cutport_t cutportProd,
00436 kapi_fu_t fuCons, int oppCons, kapi_ut_t utCons, kapi_cutport_t cutportCons,
00437 int *pnbypass );
00438
00439 extern pepair_t *KAPI_InterClusterBypassList( void *pConfig,
00440 kapi_cluster_t clusterProd,
00441 kapi_fu_t fuProd, int oppProd, kapi_ut_t utProd,
00442 kapi_cutport_t cutportProd,
00443 kapi_cluster_t clusterCons,
00444 kapi_fu_t fuCons, int oppCons, kapi_ut_t utCons,
00445 kapi_cutport_t cutportCons,
00446 int *pnbypass );
00447
00448
00449
00450 extern int KAPI_TotalLatency( void *pConfig,
00451 kapi_cluster_t clusterProd, kapi_fu_t fuProd,
00452 int oppProd, kapi_ut_t utProd, kapi_cutport_t cutportProd,
00453 kapi_cluster_t clusterCons, kapi_fu_t fuCons,
00454 int oppCons, kapi_ut_t utCons, kapi_cutport_t cutportCons );
00455
00456
00457 extern int KAPI_MinIntraClusterTotalLatency( void *pConfig, kapi_cluster_t cluster,
00458 kapi_fu_t fuProd, int oppProd, kapi_fu_t fuCons, int oppCons );
00459
00460
00461 extern int KAPI_MaxIntraClusterTotalLatency( void *pConfig, kapi_cluster_t cluster,
00462 kapi_fu_t fuProd, int oppProd, kapi_fu_t fuCons, int oppCons );
00463
00464
00465
00466
00467
00468
00469 extern int KAPI_SylCount_bid( void *pConfig, kapi_bid_t bid, kapi_syl_t syl );
00470
00471 extern int KAPI_SbitPlacement_bid( void *pConfig, kapi_bid_t bid );
00472
00473 extern int KAPI_isReserved_bid( void *pConfig, kapi_bid_t bid );
00474
00475 extern void KAPI_SylOrder_bid( void *pConfig, kapi_bid_t bid, kapi_syl_t mpsyl[ nSYLBID ] );
00476
00477 extern void KAPI_utCount_syl( void *pConfig, kapi_syl_t syl, kapi_ut_t mput[kapi_nUT] );
00478
00479 extern char *KAPI_bidName( void *pConfig, kapi_bid_t bid );
00480
00481
00482
00483
00484
00485 extern double KAPI_ia64_GetInternalVersion();
00486
00487 extern int KAPI_ia64_GetXVersion_MAJOR();
00488 extern int KAPI_ia64_GetXVersion_MINOR();
00489
00490 extern int KAPI_ia64_GetAPIVersion_MAJOR();
00491 extern int KAPI_ia64_GetAPIVersion_MINOR();
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505 extern int KAPI_save_as_header_all_IA64_info( FILE *fp, void *pConfig , char *pchName);
00506 extern int KAPI_save_as_header_latency_all_info( FILE *fp, void *pConfig , char *pchName);
00507 extern int KAPI_save_as_header_latency_core_info( FILE *fp, void *pConfig , char *pchName);
00508 extern int KAPI_save_as_header_cluster_all_info( FILE *fp, void *pConfig , char *pchName);
00509 extern int KAPI_save_as_header_cluster_distance_info( FILE *fp, void *pConfig , char *pchName);
00510 extern int KAPI_save_as_header_cluster_intracluster_latency_info( FILE *fp, void *pConfig , char *pchName);
00511 extern int KAPI_save_as_header_cluster_intercluster_latency_info( FILE *fp, void *pConfig , char *pchName);
00512 extern int KAPI_save_as_header_cluster_width_info( FILE *fp, void *pConfig , char *pchName);
00513 extern int KAPI_save_as_header_functional_units_info_info( FILE *fp, void *pConfig , char *pchName);
00514 extern int KAPI_save_as_header_cport_info( FILE *fp, void *pConfig , char *pchName);
00515 extern int KAPI_save_as_header_instruction_all_info( FILE *fp, void *pConfig , char *pchName);
00516 extern int KAPI_save_as_header_instruction_type_info( FILE *fp, void *pConfig , char *pchName);
00517 extern int KAPI_save_as_header_byd_n_syl_info( FILE *fp, void *pConfig , char *pchName);
00518 extern int KAPI_fEnableIA64call_from_header(void **pConfig, void *pHeaderConfig, int iReserved);
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530 extern int KAPI_nCacheHierarchyLevels(void *pConfig, kapi_cache_types_e cachecontent );
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546 kapi_cache_t *KAPI_CacheHierarcy(void *pConfig, int level, kapi_cache_types_e cachecontent );
00547
00548
00549
00550 #ifdef MED_API
00551
00552
00553 typedef enum {
00554 VER_X_MAJOR,
00555 VER_X_MINOR,
00556 VER_DVLOC,
00557 VER_KNOBSFILE,
00558 VER_KAPI_LAYER2,
00559 VER_KAPI_LAYER3,
00560 VER_SCHED
00561 } SCHED_VERSION_E;
00562
00563
00564 extern double SCHED_VERSION(SCHED_VERSION_E VersionType);
00565
00566
00567 #endif
00568
00569
00570
00571
00572
00573 #endif
00574
00575