/zsim-nvmain/src/cpuid.h

https://github.com/cyjseagull/SHMA · C Header · 102 lines · 65 code · 6 blank · 31 comment · 3 complexity · cf21c80c0ef7bad1b8ea861a419cf6fe MD5 · raw file

  1. /** $lic$
  2. * Copyright (C) 2012-2014 by Massachusetts Institute of Technology
  3. * Copyright (C) 2010-2013 by The Board of Trustees of Stanford University
  4. *
  5. * This file is part of zsim.
  6. *
  7. * zsim is free software; you can redistribute it and/or modify it under the
  8. * terms of the GNU General Public License as published by the Free Software
  9. * Foundation, version 2.
  10. *
  11. * If you use this software in your research, we request that you reference
  12. * the zsim paper ("ZSim: Fast and Accurate Microarchitectural Simulation of
  13. * Thousand-Core Systems", Sanchez and Kozyrakis, ISCA-40, June 2013) as the
  14. * source of the simulator in any publications that use this software, and that
  15. * you send us a citation of your work.
  16. *
  17. * zsim is distributed in the hope that it will be useful, but WITHOUT ANY
  18. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  19. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  20. * details.
  21. *
  22. * You should have received a copy of the GNU General Public License along with
  23. * this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #ifndef CPUID_H_
  26. #define CPUID_H_
  27. /* CPUID records gathered from other machines, used to virtualize CPUID
  28. * CPUID is a bundle of joy. See these to get started:
  29. * - http://www.sandpile.org/x86/cpuid.htm
  30. * - http://www.intel.com/content/www/us/en/processors/processor-identification-cpuid-instruction-note.html
  31. * Try not to cry.
  32. */
  33. struct CpuIdRecord {
  34. unsigned eaxIn;
  35. unsigned ecxIn;
  36. unsigned eax, ebx, ecx, edx;
  37. bool operator< (const CpuIdRecord& other) const {
  38. return (eaxIn < other.eaxIn) || ( (eaxIn == other.eaxIn) && (ecxIn < other.ecxIn) );
  39. }
  40. };
  41. // cpuid values produced by getcpuid (dsm)
  42. CpuIdRecord cpuid_core2[] = { // 2-socket Xeon E5335 (2x4 cores, core2 arch, 2.00GHz)
  43. {0000000000, 0000000000, 0x0000000a, 0x756e6547, 0x6c65746e, 0x49656e69},
  44. {0x00000001, 0000000000, 0x000006f7, 0x05040800, 0x0004e33d, 0xbfebfbff},
  45. {0x00000002, 0000000000, 0x05b0b101, 0x005657f0, 0000000000, 0x2cb43049},
  46. {0x00000003, 0000000000, 0000000000, 0000000000, 0000000000, 0000000000},
  47. {0x00000004, 0000000000, 0x0c000121, 0x01c0003f, 0x0000003f, 0x00000001},
  48. {0x00000004, 0x00000001, 0x0c000122, 0x01c0003f, 0x0000003f, 0x00000001},
  49. {0x00000004, 0x00000002, 0x0c004143, 0x03c0003f, 0x00000fff, 0x00000001},
  50. {0x00000004, 0x00000003, 0000000000, 0000000000, 0000000000, 0000000000},
  51. {0x00000005, 0000000000, 0x00000040, 0x00000040, 0x00000003, 0x00000020},
  52. {0x00000006, 0000000000, 0x00000001, 0x00000002, 0x00000001, 0000000000},
  53. {0x00000007, 0000000000, 0000000000, 0000000000, 0000000000, 0000000000},
  54. {0x00000008, 0000000000, 0x00000400, 0000000000, 0000000000, 0000000000},
  55. {0x00000009, 0000000000, 0000000000, 0000000000, 0000000000, 0000000000},
  56. {0x0000000a, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  57. {0x80000000, 0000000000, 0x80000008, 0000000000, 0000000000, 0000000000},
  58. {0x80000001, 0000000000, 0000000000, 0000000000, 0x00000001, 0x20100800},
  59. {0x80000002, 0000000000, 0x65746e49, 0x2952286c, 0x6f655820, 0x2952286e},
  60. {0x80000003, 0000000000, 0x55504320, 0x20202020, 0x20202020, 0x45202020},
  61. {0x80000004, 0000000000, 0x35333335, 0x20402020, 0x30302e32, 0x007a4847},
  62. {0x80000005, 0000000000, 0000000000, 0000000000, 0000000000, 0000000000},
  63. {0x80000006, 0000000000, 0000000000, 0000000000, 0x10008040, 0000000000},
  64. {0x80000007, 0000000000, 0000000000, 0000000000, 0000000000, 0000000000},
  65. {0x80000008, 0000000000, 0x00003024, 0000000000, 0000000000, 0000000000},
  66. {0x80000009, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  67. {0x8000000a, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  68. {0x8000000b, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  69. {0x8000000c, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  70. {0x8000000d, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  71. {0x8000000e, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  72. {0x8000000f, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  73. {0x80000010, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  74. {0x80000011, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  75. {0x80000012, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  76. {0x80000013, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  77. {0x80000014, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  78. {0x80000015, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  79. {0x80000016, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  80. {0x80000017, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  81. {0x80000018, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  82. {0x80000019, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  83. {0x8000001a, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  84. {0x8000001b, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  85. {0x8000001c, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  86. {0x8000001d, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  87. {0x8000001d, 0x00000001, 0x07280202, 0000000000, 0000000000, 0000000000},
  88. {0x8000001d, 0x00000002, 0x07280202, 0000000000, 0000000000, 0000000000},
  89. {0x8000001d, 0x00000003, 0x07280202, 0000000000, 0000000000, 0000000000},
  90. {0x8000001d, 0x00000004, 0x07280202, 0000000000, 0000000000, 0000000000},
  91. {0x8000001d, 0x00000005, 0x07280202, 0000000000, 0000000000, 0000000000},
  92. {0x8000001d, 0x00000006, 0x07280202, 0000000000, 0000000000, 0000000000},
  93. {0x8000001e, 0000000000, 0x07280202, 0000000000, 0000000000, 0000000000},
  94. {0xffffffff, 0}
  95. };
  96. #endif // CPUID_H_