cpuinfo.pas 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. {
  2. Copyright (c) 1998-2002 by the Free Pascal development team
  3. Basic Processor information for the ARM
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. Unit CPUInfo;
  11. Interface
  12. uses
  13. globtype;
  14. Type
  15. bestreal = double;
  16. ts32real = single;
  17. ts64real = double;
  18. ts80real = type extended;
  19. ts128real = type extended;
  20. ts64comp = comp;
  21. pbestreal=^bestreal;
  22. { possible supported processors for this target }
  23. tcputype =
  24. (cpu_none,
  25. cpu_armv3,
  26. cpu_armv4,
  27. cpu_armv4t,
  28. cpu_armv5,
  29. cpu_armv5t,
  30. cpu_armv5te,
  31. cpu_armv5tej,
  32. cpu_armv6,
  33. cpu_armv6k,
  34. cpu_armv6t2,
  35. cpu_armv6z,
  36. cpu_armv6m,
  37. cpu_armv7,
  38. cpu_armv7a,
  39. cpu_armv7r,
  40. cpu_armv7m,
  41. cpu_armv7em
  42. );
  43. Const
  44. cpu_arm = [cpu_none,cpu_armv3,cpu_armv4,cpu_armv4t,cpu_armv5];
  45. cpu_thumb = [cpu_armv6m];
  46. cpu_thumb2 = [cpu_armv7m,cpu_armv7em];
  47. Type
  48. tfputype =
  49. (fpu_none,
  50. fpu_soft,
  51. fpu_libgcc,
  52. fpu_fpa,
  53. fpu_fpa10,
  54. fpu_fpa11,
  55. fpu_vfpv2,
  56. fpu_vfpv3,
  57. fpu_vfpv3_d16,
  58. fpu_fpv4_s16
  59. );
  60. tcontrollertype =
  61. (ct_none,
  62. { Phillips }
  63. ct_lpc1343,
  64. ct_lpc2114,
  65. ct_lpc2124,
  66. ct_lpc2194,
  67. ct_lpc1754,
  68. ct_lpc1756,
  69. ct_lpc1758,
  70. ct_lpc1764,
  71. ct_lpc1766,
  72. ct_lpc1768,
  73. { ATMEL }
  74. ct_at91sam7s256,
  75. ct_at91sam7se256,
  76. ct_at91sam7x256,
  77. ct_at91sam7xc256,
  78. { STMicroelectronics }
  79. ct_stm32f100x4, // LD&MD value line, 4=16,6=32,8=64,b=128
  80. ct_stm32f100x6,
  81. ct_stm32f100x8,
  82. ct_stm32f100xB,
  83. ct_stm32f100xC, // HD value line, r=512,d=384,c=256
  84. ct_stm32f100xD,
  85. ct_stm32f100xE,
  86. ct_stm32f101x4, // LD Access line, 4=16,6=32
  87. ct_stm32f101x6,
  88. ct_stm32f101x8, // MD Access line, 8=64,B=128
  89. ct_stm32f101xB,
  90. ct_stm32f101xC, // HD Access line, C=256,D=384,E=512
  91. ct_stm32f101xD,
  92. ct_stm32f101xE,
  93. ct_stm32f101xF, // XL Access line, F=768,G=1M
  94. ct_stm32f101xG,
  95. ct_stm32f102x4, // LD usb access line, 4=16,6=32
  96. ct_stm32f102x6,
  97. ct_stm32f102x8, // MD usb access line, 8=64,B=128
  98. ct_stm32f102xB,
  99. ct_stm32f103x4, // LD performance line, 4=16,6=32
  100. ct_stm32f103x6,
  101. ct_stm32f103x8, // MD performance line, 8=64,B=128
  102. ct_stm32f103xB,
  103. ct_stm32f103xC, // HD performance line, C=256,D=384,E=512
  104. ct_stm32f103xD,
  105. ct_stm32f103xE,
  106. ct_stm32f103xF, // XL performance line, F=768,G=1M
  107. ct_stm32f103xG,
  108. ct_stm32f107x8, // MD and HD connectivity line, 8=64,B=128,C=256
  109. ct_stm32f107xB,
  110. ct_stm32f107xC,
  111. { TI - Fury Class - 64 K Flash, 16 K SRAM Devices }
  112. ct_lm3s1110,
  113. ct_lm3s1133,
  114. ct_lm3s1138,
  115. ct_lm3s1150,
  116. ct_lm3s1162,
  117. ct_lm3s1165,
  118. ct_lm3s1166,
  119. ct_lm3s2110,
  120. ct_lm3s2139,
  121. ct_lm3s6100,
  122. ct_lm3s6110,
  123. { TI - Fury Class - 128K Flash, 32K SRAM devices }
  124. ct_lm3s1601,
  125. ct_lm3s1608,
  126. ct_lm3s1620,
  127. ct_lm3s1635,
  128. ct_lm3s1636,
  129. ct_lm3s1637,
  130. ct_lm3s1651,
  131. ct_lm3s2601,
  132. ct_lm3s2608,
  133. ct_lm3s2620,
  134. ct_lm3s2637,
  135. ct_lm3s2651,
  136. ct_lm3s6610,
  137. ct_lm3s6611,
  138. ct_lm3s6618,
  139. ct_lm3s6633,
  140. ct_lm3s6637,
  141. ct_lm3s8630,
  142. { TI - Fury Class - 256K Flash, 64K SRAM devices }
  143. ct_lm3s1911,
  144. ct_lm3s1918,
  145. ct_lm3s1937,
  146. ct_lm3s1958,
  147. ct_lm3s1960,
  148. ct_lm3s1968,
  149. ct_lm3s1969,
  150. ct_lm3s2911,
  151. ct_lm3s2918,
  152. ct_lm3s2919,
  153. ct_lm3s2939,
  154. ct_lm3s2948,
  155. ct_lm3s2950,
  156. ct_lm3s2965,
  157. ct_lm3s6911,
  158. ct_lm3s6918,
  159. ct_lm3s6938,
  160. ct_lm3s6950,
  161. ct_lm3s6952,
  162. ct_lm3s6965,
  163. ct_lm3s8930,
  164. ct_lm3s8933,
  165. ct_lm3s8938,
  166. ct_lm3s8962,
  167. ct_lm3s8970,
  168. ct_lm3s8971,
  169. { TI - Tempest Tempest - 256 K Flash, 64 K SRAM }
  170. ct_lm3s5951,
  171. ct_lm3s5956,
  172. ct_lm3s1b21,
  173. ct_lm3s2b93,
  174. ct_lm3s5b91,
  175. ct_lm3s9b81,
  176. ct_lm3s9b90,
  177. ct_lm3s9b92,
  178. ct_lm3s9b95,
  179. ct_lm3s9b96,
  180. ct_lm3s5d51,
  181. { TI Stellaris }
  182. ct_lm4f120h5,
  183. { SAMSUNG }
  184. ct_sc32442b,
  185. { Infineon }
  186. ct_xmc4500x1024,
  187. ct_xmc4500x768,
  188. ct_xmc4502x768,
  189. ct_xmc4504x512,
  190. // generic Thumb2 target
  191. ct_thumb2bare
  192. );
  193. Const
  194. {# Size of native extended floating point type }
  195. extended_size = 12;
  196. {# Size of a multimedia register }
  197. mmreg_size = 16;
  198. { target cpu string (used by compiler options) }
  199. target_cpu_string = 'arm';
  200. { calling conventions supported by the code generator }
  201. supported_calling_conventions : tproccalloptions = [
  202. pocall_internproc,
  203. pocall_safecall,
  204. pocall_stdcall,
  205. { same as stdcall only different name mangling }
  206. pocall_cdecl,
  207. { same as stdcall only different name mangling }
  208. pocall_cppdecl,
  209. { same as stdcall but floating point numbers are handled like equal sized integers }
  210. pocall_softfloat,
  211. { same as stdcall (requires that all const records are passed by
  212. reference, but that's already done for stdcall) }
  213. pocall_mwpascal,
  214. { used for interrupt handling }
  215. pocall_interrupt
  216. ];
  217. cputypestr : array[tcputype] of string[8] = ('',
  218. 'ARMV3',
  219. 'ARMV4',
  220. 'ARMV4T',
  221. 'ARMV5',
  222. 'ARMV5T',
  223. 'ARMV5TE',
  224. 'ARMV5TEJ',
  225. 'ARMV6',
  226. 'ARMV6K',
  227. 'ARMV6T2',
  228. 'ARMV6Z',
  229. 'ARMV6M',
  230. 'ARMV7',
  231. 'ARMV7A',
  232. 'ARMV7R',
  233. 'ARMV7M',
  234. 'ARMV7EM'
  235. );
  236. fputypestr : array[tfputype] of string[9] = ('',
  237. 'SOFT',
  238. 'LIBGCC',
  239. 'FPA',
  240. 'FPA10',
  241. 'FPA11',
  242. 'VFPV2',
  243. 'VFPV3',
  244. 'VFPV3_D16',
  245. 'FPV4_S16'
  246. );
  247. { We know that there are fields after sramsize
  248. but we don't care about this warning }
  249. {$WARN 3177 OFF}
  250. embedded_controllers : array [tcontrollertype] of tcontrollerdatatype =
  251. (
  252. (controllertypestr:''; controllerunitstr:''; flashbase:0; flashsize:0; srambase:0; sramsize:0),
  253. (controllertypestr:'LPC1343'; controllerunitstr:'LPC1343'; flashbase:$00000000; flashsize:$00008000; srambase:$10000000; sramsize:$00002000),
  254. (controllertypestr:'LPC2114'; controllerunitstr:'LPC21x4'; flashbase:$00000000; flashsize:$00040000; srambase:$40000000; sramsize:$00004000),
  255. (controllertypestr:'LPC2124'; controllerunitstr:'LPC21x4'; flashbase:$00000000; flashsize:$00040000; srambase:$40000000; sramsize:$00004000),
  256. (controllertypestr:'LPC2194'; controllerunitstr:'LPC21x4'; flashbase:$00000000; flashsize:$00040000; srambase:$40000000; sramsize:$00004000),
  257. (controllertypestr:'LPC1754'; controllerunitstr:'LPC1754'; flashbase:$00000000; flashsize:$00020000; srambase:$10000000; sramsize:$00004000),
  258. (controllertypestr:'LPC1756'; controllerunitstr:'LPC1756'; flashbase:$00000000; flashsize:$00040000; srambase:$10000000; sramsize:$00004000),
  259. (controllertypestr:'LPC1758'; controllerunitstr:'LPC1758'; flashbase:$00000000; flashsize:$00080000; srambase:$10000000; sramsize:$00008000),
  260. (controllertypestr:'LPC1764'; controllerunitstr:'LPC1764'; flashbase:$00000000; flashsize:$00020000; srambase:$10000000; sramsize:$00004000),
  261. (controllertypestr:'LPC1766'; controllerunitstr:'LPC1766'; flashbase:$00000000; flashsize:$00040000; srambase:$10000000; sramsize:$00008000),
  262. (controllertypestr:'LPC1768'; controllerunitstr:'LPC1768'; flashbase:$00000000; flashsize:$00080000; srambase:$10000000; sramsize:$00008000),
  263. { AT91 }
  264. (controllertypestr:'AT91SAM7S256'; controllerunitstr:'AT91SAM7x256'; flashbase:$00000000; flashsize:$00040000; srambase:$00200000; sramsize:$00010000),
  265. (controllertypestr:'AT91SAM7SE256'; controllerunitstr:'AT91SAM7x256'; flashbase:$00000000; flashsize:$00040000; srambase:$00200000; sramsize:$00010000),
  266. (controllertypestr:'AT91SAM7X256'; controllerunitstr:'AT91SAM7x256'; flashbase:$00000000; flashsize:$00040000; srambase:$00200000; sramsize:$00010000),
  267. (controllertypestr:'AT91SAM7XC256'; controllerunitstr:'AT91SAM7x256'; flashbase:$00000000; flashsize:$00040000; srambase:$00200000; sramsize:$00010000),
  268. { STM32F1 series }
  269. (controllertypestr:'STM32F100X4'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
  270. (controllertypestr:'STM32F100X6'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001000),
  271. (controllertypestr:'STM32F100X8'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002000),
  272. (controllertypestr:'STM32F100XB'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00002000),
  273. (controllertypestr:'STM32F100XC'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00006000),
  274. (controllertypestr:'STM32F100XD'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00060000; srambase:$20000000; sramsize:$00008000),
  275. (controllertypestr:'STM32F100XE'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00080000; srambase:$20000000; sramsize:$00008000),
  276. (controllertypestr:'STM32F101X4'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
  277. (controllertypestr:'STM32F101X6'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001800),
  278. (controllertypestr:'STM32F101X8'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002800),
  279. (controllertypestr:'STM32F101XB'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00004000),
  280. (controllertypestr:'STM32F101XC'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00008000),
  281. (controllertypestr:'STM32F101XD'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00060000; srambase:$20000000; sramsize:$0000C000),
  282. (controllertypestr:'STM32F101XE'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00080000; srambase:$20000000; sramsize:$0000C000),
  283. (controllertypestr:'STM32F101XF'; controllerunitstr:'STM32F10X_XL'; flashbase:$08000000; flashsize:$000C0000; srambase:$20000000; sramsize:$00014000),
  284. (controllertypestr:'STM32F101XG'; controllerunitstr:'STM32F10X_XL'; flashbase:$08000000; flashsize:$00100000; srambase:$20000000; sramsize:$00014000),
  285. (controllertypestr:'STM32F102X4'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
  286. (controllertypestr:'STM32F102X6'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00001800),
  287. (controllertypestr:'STM32F102X8'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00002800),
  288. (controllertypestr:'STM32F102XB'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00004000),
  289. (controllertypestr:'STM32F103X4'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00004000; srambase:$20000000; sramsize:$00001000),
  290. (controllertypestr:'STM32F103X6'; controllerunitstr:'STM32F10X_LD'; flashbase:$08000000; flashsize:$00008000; srambase:$20000000; sramsize:$00002800),
  291. (controllertypestr:'STM32F103X8'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00005000),
  292. (controllertypestr:'STM32F103XB'; controllerunitstr:'STM32F10X_MD'; flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00005000),
  293. (controllertypestr:'STM32F103XC'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$0000C000),
  294. (controllertypestr:'STM32F103XD'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00060000; srambase:$20000000; sramsize:$00010000),
  295. (controllertypestr:'STM32F103XE'; controllerunitstr:'STM32F10X_HD'; flashbase:$08000000; flashsize:$00080000; srambase:$20000000; sramsize:$00010000),
  296. (controllertypestr:'STM32F103XF'; controllerunitstr:'STM32F10X_XL'; flashbase:$08000000; flashsize:$000C0000; srambase:$20000000; sramsize:$00018000),
  297. (controllertypestr:'STM32F103XG'; controllerunitstr:'STM32F10X_XL'; flashbase:$08000000; flashsize:$00100000; srambase:$20000000; sramsize:$00018000),
  298. (controllertypestr:'STM32F107X8'; controllerunitstr:'STM32F10X_CONN'; flashbase:$08000000; flashsize:$00010000; srambase:$20000000; sramsize:$00010000),
  299. (controllertypestr:'STM32F107XB'; controllerunitstr:'STM32F10X_CONN'; flashbase:$08000000; flashsize:$00020000; srambase:$20000000; sramsize:$00010000),
  300. (controllertypestr:'STM32F107XC'; controllerunitstr:'STM32F10X_CONN'; flashbase:$08000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  301. (controllertypestr:'LM3S1110'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  302. (controllertypestr:'LM3S1133'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  303. (controllertypestr:'LM3S1138'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  304. (controllertypestr:'LM3S1150'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  305. (controllertypestr:'LM3S1162'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  306. (controllertypestr:'LM3S1165'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  307. (controllertypestr:'LM3S1166'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  308. (controllertypestr:'LM3S2110'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  309. (controllertypestr:'LM3S2139'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  310. (controllertypestr:'LM3S6100'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  311. (controllertypestr:'LM3S6110'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00010000; srambase:$20000000; sramsize:$00004000),
  312. { TI - 128K Flash, 32K SRAM devices }
  313. (controllertypestr:'LM3S1601'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  314. (controllertypestr:'LM3S1608'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  315. (controllertypestr:'LM3S1620'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  316. (controllertypestr:'LM3S1635'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  317. (controllertypestr:'LM3S1636'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  318. (controllertypestr:'LM3S1637'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  319. (controllertypestr:'LM3S1651'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  320. (controllertypestr:'LM3S2601'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  321. (controllertypestr:'LM3S2608'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  322. (controllertypestr:'LM3S2620'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  323. (controllertypestr:'LM3S2637'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  324. (controllertypestr:'LM3S2651'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  325. (controllertypestr:'LM3S6610'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  326. (controllertypestr:'LM3S6611'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  327. (controllertypestr:'LM3S6618'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  328. (controllertypestr:'LM3S6633'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  329. (controllertypestr:'LM3S6637'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  330. (controllertypestr:'LM3S8630'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00020000; srambase:$20000000; sramsize:$00008000),
  331. { TI - 256K Flash, 64K SRAM devices }
  332. (controllertypestr:'LM3S1911'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  333. (controllertypestr:'LM3S1918'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  334. (controllertypestr:'LM3S1937'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  335. (controllertypestr:'LM3S1958'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  336. (controllertypestr:'LM3S1960'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  337. (controllertypestr:'LM3S1968'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  338. (controllertypestr:'LM3S1969'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  339. (controllertypestr:'LM3S2911'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  340. (controllertypestr:'LM3S2918'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  341. (controllertypestr:'LM3S2919'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  342. (controllertypestr:'LM3S2939'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  343. (controllertypestr:'LM3S2948'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  344. (controllertypestr:'LM3S2950'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  345. (controllertypestr:'LM3S2965'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  346. (controllertypestr:'LM3S6911'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  347. (controllertypestr:'LM3S6918'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  348. (controllertypestr:'LM3S6938'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  349. (controllertypestr:'LM3S6950'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  350. (controllertypestr:'LM3S6952'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  351. (controllertypestr:'LM3S6965'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  352. (controllertypestr:'LM3S8930'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  353. (controllertypestr:'LM3S8933'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  354. (controllertypestr:'LM3S8938'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  355. (controllertypestr:'LM3S8962'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  356. (controllertypestr:'LM3S8970'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  357. (controllertypestr:'LM3S8971'; controllerunitstr:'LM3FURY'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  358. { TI - Tempest parts - up to 512 K Flash, 96 K SRAM }
  359. (controllertypestr:'LM3S5951'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  360. (controllertypestr:'LM3S5956'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00010000),
  361. (controllertypestr:'LM3S1B21'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  362. (controllertypestr:'LM3S2B93'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  363. (controllertypestr:'LM3S5B91'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  364. (controllertypestr:'LM3S9B81'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  365. (controllertypestr:'LM3S9B90'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  366. (controllertypestr:'LM3S9B92'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  367. (controllertypestr:'LM3S9B95'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  368. (controllertypestr:'LM3S9B96'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00018000),
  369. (controllertypestr:'LM3S5D51'; controllerunitstr:'LM3TEMPEST'; flashbase:$00000000; flashsize:$00080000; srambase:$20000000; sramsize:$00018000),
  370. { TI }
  371. (controllertypestr:'LM4F120H5'; controllerunitstr:'LM4F120'; flashbase:$00000000; flashsize:$00040000; srambase:$20000000; sramsize:$00008000),
  372. { Samsung }
  373. (controllertypestr:'SC32442B'; controllerunitstr:'SC32442b'; flashbase:$00000000; flashsize:$00000000; srambase:$00000000; sramsize:$08000000),
  374. { Infinion }
  375. (controllertypestr:'XMC4500X1024'; controllerunitstr:'XMC4500'; flashbase:$08000000; flashsize:$00100000; srambase:$20000000; sramsize:$00010000),
  376. (controllertypestr:'XMC4500X768'; controllerunitstr:'XMC4500'; flashbase:$08000000; flashsize:$000C0000; srambase:$20000000; sramsize:$00010000),
  377. (controllertypestr:'XMC4502X768'; controllerunitstr:'XMC4502'; flashbase:$08000000; flashsize:$000C0000; srambase:$20000000; sramsize:$00010000),
  378. (controllertypestr:'XMC4504X512'; controllerunitstr:'XMC4504'; flashbase:$08000000; flashsize:$00080000; srambase:$20000000; sramsize:$00010000),
  379. { Bare bones }
  380. (controllertypestr:'THUMB2_BARE'; controllerunitstr:'THUMB2_BARE'; flashbase:$00000000; flashsize:$00002000; srambase:$20000000; sramsize:$00000400)
  381. );
  382. vfp_scalar = [fpu_vfpv2,fpu_vfpv3,fpu_vfpv3_d16,fpu_fpv4_s16];
  383. { Supported optimizations, only used for information }
  384. supported_optimizerswitches = genericlevel1optimizerswitches+
  385. genericlevel2optimizerswitches+
  386. genericlevel3optimizerswitches-
  387. { no need to write info about those }
  388. [cs_opt_level1,cs_opt_level2,cs_opt_level3]+
  389. [cs_opt_regvar,cs_opt_loopunroll,cs_opt_tailrecursion,
  390. cs_opt_stackframe,cs_opt_nodecse,cs_opt_reorder_fields,cs_opt_fastmath];
  391. level1optimizerswitches = genericlevel1optimizerswitches;
  392. level2optimizerswitches = genericlevel2optimizerswitches + level1optimizerswitches +
  393. [cs_opt_regvar,cs_opt_stackframe,cs_opt_tailrecursion,cs_opt_nodecse];
  394. level3optimizerswitches = genericlevel3optimizerswitches + level2optimizerswitches + [cs_opt_scheduler{,cs_opt_loopunroll}];
  395. level4optimizerswitches = genericlevel4optimizerswitches + level3optimizerswitches + [];
  396. type
  397. tcpuflags =
  398. (CPUARM_HAS_BX, { CPU supports the BX instruction }
  399. CPUARM_HAS_BLX, { CPU supports the BLX rX instruction }
  400. CPUARM_HAS_BLX_LABEL, { CPU supports the BLX <label> instruction }
  401. CPUARM_HAS_CLZ, { CPU supports the CLZ instruction }
  402. CPUARM_HAS_EDSP, { CPU supports the PLD,STRD,LDRD,MCRR and MRRC instructions }
  403. CPUARM_HAS_REV, { CPU supports the REV instruction }
  404. CPUARM_HAS_RBIT, { CPU supports the RBIT instruction }
  405. CPUARM_HAS_DMB, { CPU has memory barrier instructions (DMB, DSB, ISB) }
  406. CPUARM_HAS_LDREX,
  407. CPUARM_HAS_IDIV
  408. );
  409. const
  410. cpu_capabilities : array[tcputype] of set of tcpuflags =
  411. ( { cpu_none } [],
  412. { cpu_armv3 } [],
  413. { cpu_armv4 } [],
  414. { cpu_armv4t } [CPUARM_HAS_BX],
  415. { cpu_armv5 } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ],
  416. { cpu_armv5t } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ],
  417. { cpu_armv5te } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP],
  418. { cpu_armv5tej } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP],
  419. { cpu_armv6 } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
  420. { cpu_armv6k } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
  421. { cpu_armv6t2 } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX],
  422. { cpu_armv6z } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_LDREX],
  423. { cpu_armv6m } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_REV],
  424. { the identifier armv7 is should not be used, it is considered being equal to armv7a }
  425. { cpu_armv7 } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB],
  426. { cpu_armv7a } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB],
  427. { cpu_armv7r } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_BLX_LABEL,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_DMB],
  428. { cpu_armv7m } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_IDIV,CPUARM_HAS_DMB],
  429. { cpu_armv7em } [CPUARM_HAS_BX,CPUARM_HAS_BLX,CPUARM_HAS_CLZ,CPUARM_HAS_EDSP,CPUARM_HAS_REV,CPUARM_HAS_RBIT,CPUARM_HAS_LDREX,CPUARM_HAS_IDIV,CPUARM_HAS_DMB]
  430. );
  431. Implementation
  432. end.