Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

480 lines
13 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #pragma once
  9. typedef union EVENT_MASK(TC_deliver_mode)
  10. {
  11. struct
  12. {
  13. uint16 DD:1; // both logical processors in deliver mode },
  14. uint16 DB:1; // logical processor 0 in deliver mode, 1 in build mode },
  15. uint16 DI:1; // logical processor 0 in deliver mode, 1 is inactive },
  16. uint16 BD:1; // logical processor 0 in build mode, 1 in deliver mode },
  17. uint16 BB:1; // both logical processors in build mode },
  18. uint16 BI:1; // logical processor 0 in build mode, 1 is inactive },
  19. uint16 ID:1; // logical processor 0 is inactive, 1 in deliver mode },
  20. uint16 IB:1; // logical processor 0 is inactive, 1 in build mode }
  21. };
  22. uint16 flat;
  23. } EVENT_MASK(TC_deliver_mode);
  24. typedef union EVENT_MASK(BPU_fetch_request)
  25. {
  26. struct
  27. {
  28. uint16 TCMISS:1; // Trace cache lookup miss },
  29. };
  30. uint16 flat;
  31. } EVENT_MASK(BPU_fetch_request);
  32. typedef union EVENT_MASK(ITLB_reference)
  33. {
  34. struct
  35. {
  36. uint16 HIT : 1; //ITLB hit },
  37. uint16 MISS : 1;//ITLB miss },
  38. uint16 HIT_UC :1; // Uncacheable ITLB hit }
  39. };
  40. uint16 flat;
  41. } EVENT_MASK(ITLB_reference);
  42. typedef union EVENT_MASK(memory_cancel)
  43. {
  44. struct
  45. {
  46. uint16 dummy : 2;
  47. uint16 ST_RB_FULL:1; //Replayed because no store request buffer is available },
  48. uint16 _64K_CONF:1; //Conflicts due to 64K aliasing }
  49. };
  50. uint16 flat;
  51. }EVENT_MASK(memory_cancel);
  52. typedef union EVENT_MASK(memory_complete)
  53. {
  54. struct
  55. {
  56. uint16 LSC:1; // Load split completed, excluding UC/WC loads },
  57. uint16 SSC:1; //Any split stores completed } }
  58. };
  59. uint16 flat;
  60. } EVENT_MASK(memory_complete);
  61. typedef union EVENT_MASK(load_port_replay)
  62. {
  63. struct
  64. {
  65. uint16 dummy:1;
  66. uint16 SPLIT_LD:1; //Split load } }
  67. };
  68. uint16 flat;
  69. } EVENT_MASK(load_port_replay);
  70. typedef union EVENT_MASK(store_port_replay)
  71. {
  72. struct
  73. {
  74. uint16 dummy0:1;
  75. uint16 SPLIT_ST:1; //Split store } }
  76. };
  77. uint16 flat;
  78. } EVENT_MASK(store_port_replay);
  79. typedef union EVENT_MASK(MOB_load_replay)
  80. {
  81. struct
  82. {
  83. uint16 dummy0:1;
  84. uint16 NO_STA:1; //Replayed because of unknown store address },
  85. uint16 dummy2:1;
  86. uint16 NO_STD:1; //Replayed because of unknown store data },
  87. uint16 PARTIAL_DATA:1; //Replayed because of partially overlapped data access between the load and store operations },
  88. uint16 UNALGN_ADDR:1; //Replayed because the lower 4 bits of the linear address do not match between the load and store operations } }
  89. };
  90. uint16 flat;
  91. }EVENT_MASK(MOB_load_replay);
  92. typedef union EVENT_MASK(page_walk_type)
  93. {
  94. struct
  95. {
  96. uint16 DTMISS:1; // Page walk for a data TLB miss },
  97. uint16 ITMISS:1; // Page walk for an instruction TLB miss } }
  98. };
  99. uint16 flat;
  100. }EVENT_MASK(page_walk_type);
  101. typedef union EVENT_MASK(BSQ_cache_reference)
  102. {
  103. struct
  104. {
  105. uint16 RD_2ndL_HITS:1; // Read 2nd level cache hit Shared },
  106. uint16 RD_2ndL_HITE:1; // Read 2nd level cache hit Exclusive },
  107. uint16 RD_2ndL_HITM:1; // Read 2nd level cache hit Modified },
  108. uint16 RD_3rdL_HITS:1; // Read 3rd level cache hit Shared },
  109. uint16 RD_3rdL_HITE:1; // Read 3rd level cache hit Exclusive },
  110. uint16 RD_3rdL_HITM:1; // Read 3rd level cache hit Modified },
  111. uint16 dummy6:1;
  112. uint16 dummy7:1;
  113. uint16 RD_2ndL_MISS:1; // Read 2nd level cache miss },
  114. uint16 RD_3rdL_MISS:1; // Read 3rd level cache miss },
  115. uint16 WR_2ndL_MISS:1; // Writeback lookup from DAC misses the 2nd level cache } }
  116. };
  117. uint16 flat;
  118. } EVENT_MASK(BSQ_cache_reference) ;
  119. typedef union EVENT_MASK(IOQ)
  120. {
  121. struct
  122. {
  123. uint16 bit0:1; // bus request type (use 00001 for invalid or default)
  124. uint16 bit1:1; //
  125. uint16 bit2:1; //
  126. uint16 bit3:1; //
  127. uint16 bit4:1; //
  128. uint16 ALL_READ:1; // Count read entries },
  129. uint16 ALL_WRITE:1; // Count write entries },
  130. uint16 MEM_UC:1; // Count UC memory access entries },
  131. uint16 MEM_WC:1; // Count WC memory access entries },
  132. uint16 MEM_WT:1; // Count WT memory access entries },
  133. uint16 MEM_WP:1; // Count WP memory access entries },
  134. uint16 MEM_WB:1; // Count WB memory access entries },
  135. uint16 dummy12:1;
  136. uint16 OWN:1; // Count own store requests },
  137. uint16 OTHER:1; // Count other and DMA store requests },
  138. uint16 PREFETCH:1; // Include HW and SW prefetch requests } }
  139. };
  140. uint16 flat;
  141. } EVENT_MASK(IOQ) ;
  142. typedef union EVENT_MASK(FSB_data_activity)
  143. {
  144. struct
  145. {
  146. /* DRDY_OWN is mutually exclusive with DRDY_OTHER */
  147. /* DBSY_OWN is mutually exclusive with DBSY_OTHER */
  148. uint16 DRDY_DRV:1; // Count when this processor drives data onto the bus },
  149. uint16 DRDY_OWN:1; // Count when this processor reads data from the bus },
  150. uint16 DRDY_OTHER:1; // Count when data is on the bus but not being sampled by the processor },
  151. uint16 DBSY_DRV:1; // Count when this processor reserves the bus for driving data },
  152. uint16 DBSY_OWN:1; // Count when this processor reserves the bus for sampling data },
  153. uint16 DBSY_OTHER:1; // Count when the bus is reserved for driving data this processor will not sample } }
  154. };
  155. uint16 flat;
  156. }EVENT_MASK(FSB_data_activity);
  157. typedef union EVENT_MASK(BSQ)
  158. {
  159. struct
  160. {
  161. uint16 REQ_TYPE0:1; // Request type encoding bit 0 },
  162. uint16 REQ_TYPE1:1; // Request type encoding bit 1 },
  163. uint16 REQ_LEN0:1; // Request length encoding bit 0 },
  164. uint16 REQ_LEN1:1; // Request length encoding bit 1 },
  165. uint16 dummy4: 1;
  166. uint16 REQ_IO_TYPE:1; // Request type is input or output },
  167. uint16 REQ_LOCK_TYPE:1; // Request type is bus lock },
  168. uint16 REQ_CACHE_TYPE:1; // Request type is cacheable },
  169. uint16 REQ_SPLIT_TYPE:1; // Request type is a bus 8-byte chunk split across 8-byte boundary },
  170. uint16 REQ_DEM_TYPE:1; // Request type is a demand (1) or prefetch (0) },
  171. uint16 REQ_ORD_TYPE:1; // Request is an ordered type },
  172. uint16 MEM_TYPE0:1; // Memory type encoding bit 0 },
  173. uint16 MEM_TYPE1:1; // Memory type encoding bit 1 },
  174. uint16 MEM_TYPE2:1; // Memory type encoding bit 2 } }
  175. };
  176. uint16 flat;
  177. } EVENT_MASK(BSQ);
  178. typedef union EVENT_MASK(firm_uop)
  179. {
  180. struct
  181. {
  182. uint16 dummy15 : 15;
  183. uint16 ALL:1; // count all uops of this type } }
  184. };
  185. uint16 flat;
  186. } EVENT_MASK(firm_uop);
  187. typedef union EVENT_MASK(TC_misc)
  188. {
  189. struct
  190. {
  191. uint16 dymmy4 : 4;
  192. uint16 FLUSH:1; // Number of flushes } }
  193. };
  194. uint16 flat;
  195. } EVENT_MASK(TC_misc);
  196. typedef union EVENT_MASK(global_power_events)
  197. {
  198. struct
  199. {
  200. uint16 Running:1; // The processor is active } }
  201. };
  202. uint16 flat;
  203. } EVENT_MASK(global_power_events);
  204. typedef union EVENT_MASK(tc_ms_xfer)
  205. {
  206. struct
  207. {
  208. uint16 CISC:1; // A TC to MS transfer ocurred } }
  209. };
  210. uint16 flat;
  211. }EVENT_MASK(tc_ms_xfer);
  212. typedef union EVENT_MASK(uop_queue_writes)
  213. {
  214. struct
  215. {
  216. uint16 FROM_TC_BUILD:1; // uops written from TC build mode
  217. uint16 FROM_TC_DELIVER:1; // uops written from TC deliver mode
  218. uint16 FROM_ROM:1; // uops written from microcode ROM } }
  219. };
  220. uint16 flat;
  221. } EVENT_MASK(uop_queue_writes);
  222. typedef union EVENT_MASK(branch_type)
  223. {
  224. struct
  225. {
  226. uint16 dummy : 1;
  227. uint16 CONDITIONAL:1; // Conditional jumps
  228. uint16 CALL:1; // Direct or indirect call
  229. uint16 RETURN:1; // Return branches
  230. uint16 INDIRECT:1; // Returns, indirect calls, or indirect jumps
  231. };
  232. uint16 flat;
  233. } EVENT_MASK(branch_type);
  234. typedef union EVENT_MASK(resource_stall)
  235. {
  236. struct
  237. {
  238. uint16 dummy1 : 5;
  239. uint16 SBFULL:1; // A Stall due to lack of store buffers } }
  240. };
  241. uint16 flat;
  242. } EVENT_MASK(resource_stall);
  243. typedef union EVENT_MASK(WC_Buffer)
  244. {
  245. struct
  246. {
  247. uint16 WCB_EVICTS : 1; // all causes },
  248. uint16 WCB_FULL_EVICT : 1; // no WC buffer is available },
  249. /* XXX: 245472-011 no longer lists bit 2, but that looks like
  250. a table formatting error. Keeping it for now. */
  251. uint16 WCB_HITM_EVICT : 1; // store encountered a Hit Modified condition } }
  252. };
  253. uint16 flat;
  254. } EVENT_MASK(WC_Buffer);
  255. typedef union EVENT_MASK(b2b_cycles)
  256. {
  257. struct
  258. {
  259. uint16 dummy0 : 1;
  260. uint16 bit1 : 1; //
  261. uint16 bit2 : 1; //
  262. uint16 bit3 : 1; //
  263. uint16 bit4 : 1; //
  264. uint16 bit5 : 1; //
  265. uint16 bit6 : 1; //
  266. };
  267. uint16 flat;
  268. } EVENT_MASK(b2b_cycles);
  269. typedef union EVENT_MASK(bnr)
  270. {
  271. struct
  272. {
  273. uint16 bit0:1; //
  274. uint16 bit1:1; //
  275. uint16 bit2:1; //
  276. };
  277. uint16 flat;
  278. } EVENT_MASK(bnr);
  279. typedef union EVENT_MASK(snoop)
  280. {
  281. struct
  282. {
  283. uint16 dummy0 : 1;
  284. uint16 dummy1 : 1;
  285. uint16 bit2:1; //
  286. uint16 dummy3:1; //
  287. uint16 dummy4:1; //
  288. uint16 dummy5:1; //
  289. uint16 bit6:1; //
  290. uint16 bit7:1; //
  291. };
  292. uint16 flat;
  293. } EVENT_MASK(snoop);
  294. typedef union EVENT_MASK(response)
  295. {
  296. struct
  297. {
  298. uint16 dummy0:1; //
  299. uint16 bit1:1; //
  300. uint16 bit2:1; //
  301. uint16 dummy3:1; //
  302. uint16 dummy4:1; //
  303. uint16 dummy5:1; //
  304. uint16 dummy6:1; //
  305. uint16 dummy7:1; //
  306. uint16 bit8:1; //
  307. uint16 bit9:1; //
  308. };
  309. uint16 flat;
  310. } EVENT_MASK(response);
  311. typedef union EVENT_MASK(nbogus_bogus)
  312. {
  313. struct
  314. {
  315. uint16 NBOGUS:1; // The marked uops are not bogus
  316. uint16 BOGUS:1; // The marked uops are bogus
  317. };
  318. uint16 flat;
  319. } EVENT_MASK(nbogus_bogus);
  320. typedef union EVENT_MASK(execution_event)
  321. {
  322. struct
  323. {
  324. uint16 NBOGUS0:1; // non-bogus uops with tag bit 0 set },
  325. uint16 NBOGUS1:1; // non-bogus uops with tag bit 1 set },
  326. uint16 NBOGUS2:1; // non-bogus uops with tag bit 2 set },
  327. uint16 NBOGUS3:1; // non-bogus uops with tag bit 3 set },
  328. uint16 BOGUS0:1; // bogus uops with tag bit 0 set },
  329. uint16 BOGUS1:1; // bogus uops with tag bit 1 set },
  330. uint16 BOGUS2:1; // bogus uops with tag bit 2 set },
  331. uint16 BOGUS3:1; // bogus uops with tag bit 3 set } }
  332. };
  333. uint16 flat;
  334. }EVENT_MASK(execution_event);
  335. typedef union EVENT_MASK(instr_retired)
  336. {
  337. struct
  338. {
  339. uint16 NBOGUSNTAG:1; // Non-bogus instructions that are not tagged },
  340. uint16 NBOGUSTAG:1; // Non-bogus instructions that are tagged },
  341. uint16 BOGUSNTAG:1; // Bogus instructions that are not tagged },
  342. uint16 BOGUSTAG:1; // Bogus instructions that are tagged } }
  343. };
  344. uint16 flat;
  345. } EVENT_MASK(instr_retired);
  346. typedef union EVENT_MASK(uop_type)
  347. {
  348. struct
  349. {
  350. uint16 dummy0 : 1;
  351. uint16 TAGLOADS:1; // The uop is a load operation },
  352. uint16 TAGSTORES:1; // The uop is a store operation } }
  353. };
  354. uint16 flat;
  355. } EVENT_MASK(uop_type);
  356. typedef union EVENT_MASK(branch_retired)
  357. {
  358. struct
  359. {
  360. uint16 MMNP:1; // Branch Not-taken Predicted
  361. uint16 MMNM:1; // Branch Not-taken Mispredicted
  362. uint16 MMTP:1; // Branch Taken Predicted
  363. uint16 MMTM:1; // Branch Taken Mispredicted
  364. };
  365. uint16 flat;
  366. } EVENT_MASK(branch_retired);
  367. typedef union EVENT_MASK(mispred_branch_retired)
  368. {
  369. struct
  370. {
  371. uint16 NBOGUS:1; // The retired branch is not bogus } }
  372. };
  373. uint16 flat;
  374. } EVENT_MASK(mispred_branch_retired);
  375. typedef union EVENT_MASK(x87_assist)
  376. {
  377. struct
  378. {
  379. uint16 FPSU:1; // FP stack underflow },
  380. uint16 FPSO:1; // FP stack overflow },
  381. uint16 POAO:1; // x87 output overflow },
  382. uint16 POAU:1; // x87 output underflow },
  383. uint16 PREA:1; // x87 input assist } }
  384. };
  385. uint16 flat;
  386. }EVENT_MASK(x87_assist);
  387. typedef union EVENT_MASK(machine_clear)
  388. {
  389. struct
  390. {
  391. uint16 CLEAR:1; // Count a portion of the cycles when the machine is cleared },
  392. uint16 dummy1: 1;
  393. uint16 MOCLEAR:1; // Count clears due to memory ordering issues },
  394. uint16 dummy3: 1;
  395. uint16 dummy4: 1;
  396. uint16 dummy5: 1;
  397. uint16 SMCLEAR:1;// Count clears due to self-modifying code issues } }
  398. };
  399. uint16 flat;
  400. } EVENT_MASK(machine_clear);
  401. typedef union EVENT_MASK(x87_SIMD_moves_uop)
  402. {
  403. struct
  404. {
  405. uint16 dummy3:3;
  406. uint16 ALLP0:1; // Count all x87/SIMD store/move uops },
  407. uint16 ALLP2:1; // count all x87/SIMD load uops } }
  408. };
  409. uint16 flat;
  410. } EVENT_MASK(x87_SIMD_moves_uop);