cpu.tcl 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. # Sample model of Intel i7-4790 CPU
  2. # Dimensions are taken from specs and photo found in Internet
  3. #Category: XDE
  4. #Title: Intel i7-4790 CPU
  5. pload MODELING VISUALIZATION XDE
  6. puts "Making board..."
  7. # board is rectangle 37.5 x 37.5 mm with semi-round holes on two sides;
  8. # assumed board thickness is 1 mm
  9. dset L 37.5
  10. dset t 1.
  11. polyline pboard 0 0 0 L 0 0 L L 0 0 L 0 0 0 0
  12. mkplane fboard pboard
  13. circle cslot -0.2 32.2 0 1
  14. mkedge eslot cslot
  15. wire wslot eslot
  16. mkplane fslot wslot
  17. bcut fboard fboard fslot
  18. ttranslate fslot L+0.4 0 0
  19. bcut fboard fboard fslot
  20. prism board fboard 0 0 t
  21. # make faces representing dard-green parts of the board sides
  22. mkoffset dgbot fboard 1 -0.5
  23. mkplane dgbot dgbot_1
  24. tcopy dgbot dgtop
  25. ttranslate dgtop 0 0 0.5*t
  26. box aux 36.6 17.7 0 10 8.4 2*t
  27. bcut dgtop dgtop aux
  28. prism pbot dgbot 0 0 0.5*t
  29. prism ptop dgtop 0 0 0.5*t
  30. bfuse board board pbot
  31. bfuse board board ptop
  32. # add triangular faces indicating base corner of the plate
  33. polyline btri 0.5 0.5 0 1.5 0.5 0 0.5 1.5 0 0.5 0.5 0
  34. polyline ttri 0.5 0.5 t 2.5 0.5 t 0.5 2.5 t 0.5 0.5 t
  35. thrusections stri 1 1 btri ttri
  36. bfuse board board stri
  37. explode board so
  38. renamevar board_1 board
  39. puts "Making case..."
  40. # case is made of two filleted prisms, base and top
  41. polyline lbase 3.4 1.8 t L-3.4 1.8 t L-3.4 11.4 t L-1.8 11.4 t L-1.8 25.2 t \
  42. L-3.4 25.2 t L-3.4 L-3 t 3.4 L-3 t 3.4 25.2 t \
  43. 1.8 25.2 t 1.8 11.4 t 3.4 11.4 t 3.4 1.8 t
  44. mkplane f lbase
  45. explode f e
  46. chfi2d fbase f f_1 f_2 F 1.3 f_2 f_3 F 0.7 f_3 f_4 F 0.7 f_4 f_5 F 0.7 \
  47. f_5 f_6 F 0.7 f_6 f_7 F 1.3 f_7 f_8 F 1.3 f_8 f_9 F 0.7 \
  48. f_9 f_10 F 0.7 f_10 f_11 F 0.7 f_11 f_12 F 0.7 f_12 f_1 F 1.3
  49. polyline ltop 4. 3.4 t L-4 3.4 t L-4 L-4.8 t 4 L-4.8 t 4. 3.4 t
  50. mkplane f ltop
  51. explode f e
  52. chfi2d ftop f f_1 f_2 F 1.6 f_2 f_3 F 1.6 f_3 f_4 F 1.6 f_4 f_1 F 1.6
  53. # make case, assume height of base 1 mm and top additional 2.5 mm
  54. prism pbase fbase 0 0 1
  55. prism ptop ftop 0 0 3.5
  56. bfuse case pbase ptop
  57. explode case so
  58. renamevar case_1 case
  59. # write text on top of the case
  60. # note that font is chosen by availability of Unicode symbols,
  61. # it is different from actual font found on processor
  62. set font "Arial Unicode MS"
  63. #set text "i\u24c2\u00a911\nINTEL\u00ae CORE\u2122 i7-4790\nSR1QF 3.60GHZ\nMALAY\nL411B540 \u24d4"
  64. #text2brep title $text "Arial Unicode MS" 1.7 x=10 y=24 z=4.51
  65. # alternative variant to work-around issue #25852
  66. set text "i\u20dd\u20dd11\nINTEL\u20dd CORE\u2122 i7-4790\nSR1QF 3.60GHZ\nMALAY\nL411B540 \u20dd"
  67. text2brep title0 $text -font $font -height 1.7 -pos 10 24 4.51 -valign topfirstline
  68. text2brep title1 " M C" -font $font -height 0.77 -pos 10 24.2 4.51
  69. text2brep title2 "R" -font $font -height 0.77 -pos 15.3 21.9 4.51
  70. text2brep title3 "e4" -font $font -height 0.7 -pos 18.6 15.1 4.51
  71. compound title0 title1 title2 title3 title
  72. puts "Adding contact pads..."
  73. # contact pads on top side (round); we need 42 with R=0.3 and 1 with R=0.6
  74. pcylinder rpad 0.27 0.1
  75. eval compound [lrepeat 42 rpad] cpad
  76. set lpad [explode cpad]
  77. for {set i 1} {$i <= 20} {incr i} {
  78. ttranslate cpad_[expr 2*$i ] [expr 4.5 + $i * 0.7] L-0.7 t
  79. ttranslate cpad_[expr 2*$i-1] [expr 4.85 + $i * 0.7] L-1.3 t
  80. }
  81. ttranslate cpad_41 L-0.7 L-0.7 t
  82. ttranslate cpad_42 L-0.7 0.7 t
  83. pcylinder Rpad 0.5 0.1
  84. ttranslate Rpad 0.9 L-0.9 t
  85. eval compound $lpad Rpad rpads
  86. # contact pads at the bottom
  87. box pad -0.45 -0.27 -0.1 0.9 0.54 0.1
  88. trotate pad 0 0 0 0 0 1 60
  89. ellipse c 0 0 -0.1 0.5 0.4
  90. mkedge e c
  91. wire w e
  92. mkplane f w
  93. prism b f 0 0 0.1
  94. bcommon bpad pad b
  95. explode bpad so
  96. renamevar bpad_1 bpad
  97. #donly bpad; boundings bpad
  98. # pattern of presence of bottom pads, on XY plane (top view)
  99. set pattern [join {
  100. ..ooooooooooooooo...ooooooooooooooooo...
  101. .oooooooooooooooo...ooooooooooooooooooo.
  102. .oooooooooooooooooooooooooooooooooooooo.
  103. .oooooooooooooooooooooooooooooooooooooo.
  104. .oooooooooooooooooooooooooooooooooooooo.
  105. .oooooooooooooooooooooooooooooooooooooo.
  106. .oooooooooooooooooooooooooooooooooooooo.
  107. .oooooooooooooooooooooooooooooooooooooo.
  108. .ooooooooooo................ooooooooooo.
  109. .oooooooooo.................ooooooooooo.
  110. oooooooooooo................oooooooooooo
  111. oooooooooooo................oooooooooooo
  112. oooooooooooo................oooooooooooo
  113. oooooooooooo................oooooooooooo
  114. oooooooooooo................oooooooooooo
  115. oooooooooooo................oooooooooooo
  116. oooooooooooo................oooooooooooo
  117. oooooooooooo................oooooooooooo
  118. ..oooooooooo................oooooooooo..
  119. ..oooooooooo................oooooooooo..
  120. ..oooooooooo................oooooooooo..
  121. ..oooooooooo................oooooooooo..
  122. oooooooooooo................oooooooooooo
  123. oooooooooooo................oooooooooooo
  124. oooooooooooo................oooooooooooo
  125. oooooooooooo................oooooooooooo
  126. oooooooooooo................oooooooooooo
  127. oooooooooooo................oooooooooooo
  128. oooooooooooo................oooooooooooo
  129. oooooooooooo................oooooooooooo
  130. .ooooooooooo.................ooooooooooo
  131. .ooooooooooo................oooooooooooo
  132. .ooooooooooooooooooooooooooooooooooooooo
  133. oooooooooooooooooooooooooooooooooooooooo
  134. oooooooooooooooooooooooooooooooooooooooo
  135. oooooooooooooooooooooooooooooooooooooooo
  136. oooooooooooooooooooooooooooooooooooooooo
  137. .ooooooooooooooooooooooooooooooooooooooo
  138. ..oooooooooooooooo...oooooooooooooooooo.
  139. ...ooooooooooooooo...ooooooooooooooooo..
  140. } ""]
  141. set nbpads 0
  142. for {set i 0} {$i < 1600} {incr i} {
  143. if { [string index $pattern $i] == "o" } { incr nbpads }
  144. }
  145. eval compound [lrepeat $nbpads bpad] cpad
  146. set lpad [explode cpad]
  147. for {set ipad 1; set iplace 0} {$ipad <= $nbpads && $iplace < 1600} {incr ipad; incr iplace} {
  148. while { [string index $pattern $iplace] == "." } { incr iplace }
  149. set icol [expr $iplace % 40]
  150. set irow [expr $iplace / 40]
  151. ttranslate cpad_$ipad [expr 1 + 0.91 * $icol] [expr [dval L] - 1 - 0.91 * $irow] 0
  152. }
  153. # round and square contact pads on top side
  154. # note re-use of rpad object used for bottom round pads
  155. eval compound [lrepeat 8 rpad] crpads
  156. set lrpad [explode crpads]
  157. ttranslate crpads_1 25.3 8.4 -0.1
  158. ttranslate crpads_2 12.2 29.2 -0.1
  159. ttranslate crpads_3 12.5 15. -0.1
  160. ttranslate crpads_4 12.5 18.75 -0.1
  161. ttranslate crpads_5 12.5 19.5 -0.1
  162. ttranslate crpads_6 12.5 20.25 -0.1
  163. ttranslate crpads_7 12.5 21. -0.1
  164. ttranslate crpads_8 12.5 22.5 -0.1
  165. box spad_1 12.21 13.75 -0.1 0.58 0.58 0.1
  166. box spad_2 12.21 23.2 -0.1 0.58 0.58 0.1
  167. # final compound for all bottom pads
  168. eval compound $lpad $lrpad spad_1 spad_2 bpads
  169. # resistor-like packages at the bottom
  170. box rpk1 -0.6 -0.25 -0.5 0.3 0.5 0.5
  171. box rpk2 -0.3 -0.25 -0.5 0.6 0.5 0.5
  172. box rpk3 0.3 -0.25 -0.5 0.3 0.5 0.5
  173. compound rpk1 rpk2 rpk3 rpk
  174. eval compound [lrepeat 47 rpk] crpk
  175. set lrpk [explode crpk]
  176. # rotate first 26 packages vertically
  177. for {set i 1} {$i <= 26} {incr i} {trotate crpk_$i 0 0 0 0 0 1 90}
  178. # first 9 are vertical column on the right side of the bottom view
  179. for {set i 1} {$i <= 9} {incr i} {
  180. ttranslate crpk_$i 13.4 [expr 9.8 + 1.6 * $i] 0
  181. }
  182. # next 8 are 2x4 grid in top left corner
  183. for {set i 1} {$i <= 4} {incr i} {
  184. ttranslate crpk_[expr 9 + $i] 23. [expr 21.5 + 1.6 * $i] 0
  185. ttranslate crpk_[expr 13 + $i] 24. [expr 21.5 + 1.6 * $i] 0
  186. }
  187. # others are translated individually, vertical first, bottom to top
  188. ttranslate crpk_18 21.5 9.4 0
  189. ttranslate crpk_19 21.5 11.0 0
  190. ttranslate crpk_20 21.5 12.6 0
  191. ttranslate crpk_21 22.5 9.8 0
  192. ttranslate crpk_22 20.0 12.2 0
  193. ttranslate crpk_23 24.0 13.6 0
  194. ttranslate crpk_24 24.0 15.2 0
  195. ttranslate crpk_25 19.5 16.0 0
  196. ttranslate crpk_26 20.5 16.0 0
  197. # now horizontal, bottom to top
  198. ttranslate crpk_27 23.7 9.5 0
  199. ttranslate crpk_28 23.7 10.5 0
  200. ttranslate crpk_29 22.8 11.5 0
  201. ttranslate crpk_30 22.8 12.5 0
  202. ttranslate crpk_31 22.7 14.3 0
  203. ttranslate crpk_32 22.7 16.0 0
  204. ttranslate crpk_33 22.8 17.0 0
  205. ttranslate crpk_34 22.8 19.1 0
  206. ttranslate crpk_35 22.7 20.0 0
  207. ttranslate crpk_36 23.0 20.9 0
  208. ttranslate crpk_37 23.3 21.8 0
  209. ttranslate crpk_38 19.8 21.6 0
  210. ttranslate crpk_39 19.8 22.6 0
  211. ttranslate crpk_40 19.8 23.6 0
  212. ttranslate crpk_41 21.6 22.2 0
  213. ttranslate crpk_42 21.6 23.2 0
  214. ttranslate crpk_43 21.6 24.2 0
  215. ttranslate crpk_44 18.0 24.6 0
  216. ttranslate crpk_45 18.0 25.6 0
  217. ttranslate crpk_46 18.0 26.6 0
  218. ttranslate crpk_47 18.0 27.6 0
  219. eval compound $lrpk brpk
  220. # show result in 3d viewer
  221. vinit View1
  222. vclear
  223. vsetdispmode 1
  224. vrenderparams -msaa 8
  225. vlight -clear
  226. vlight amblight -type AMBIENT
  227. vlight dirlight -type DIRECTIONAL -direction 1 -1 -2 -head 1
  228. if [info exists i7_show_3dview] {
  229. vdisplay case
  230. vsetcolor case GRAY70
  231. vdisplay title
  232. vsetcolor title GRAY10
  233. # board is mostly yellow (edges, triangle markers)
  234. foreach f [explode board f] { vdisplay $f; vsetcolor $f B3803D }
  235. # top and bottom faces are light-green (outside) and dark-green (inside)
  236. vsetcolor board_4 00998C
  237. vsetcolor board_5 00998C
  238. vsetcolor board_12 004D54
  239. vsetcolor board_14 004D54
  240. vdisplay rpads
  241. vsetcolor rpads B39966
  242. vdisplay bpads
  243. vsetcolor bpads B39966
  244. vdisplay brpk
  245. vsetcolor brpk 80664D
  246. donly board case rpads brpk; fit
  247. }
  248. # make XDE document
  249. catch {Close D}
  250. pload OCAF XDE
  251. NewDocument D MDTV-XCAF
  252. SetName D [XAddShape D board 0] "Board"
  253. foreach f [explode board f] { XSetColor D $f B3803D }
  254. XSetColor D board_4 00998C
  255. XSetColor D board_5 00998C
  256. XSetColor D board_12 004D54
  257. XSetColor D board_14 004D54
  258. SetName D [XAddShape D case 0] "Case"
  259. XSetColor D case GRAY70
  260. SetName D [XAddShape D title 0] "Case title"
  261. XSetColor D title GRAY10
  262. SetName D [XAddShape D rpads 1] "Top side contact pads"
  263. SetName D [XAddShape D bpads 1] "Bottom contact pads"
  264. SetName D [XFindShape D bpad] "Contact pad"
  265. SetName D [XFindShape D rpad] "Round pad"
  266. SetName D [XFindShape D Rpad] "Big round pad"
  267. SetName D [XFindShape D spad_1] "Square pad 1"
  268. SetName D [XFindShape D spad_2] "Square pad 2"
  269. XSetColor D rpad B39966
  270. XSetColor D Rpad B39966
  271. XSetColor D bpad B39966
  272. XSetColor D spad_1 B39966
  273. XSetColor D spad_2 B39966
  274. SetName D [XAddShape D brpk 1] "Bottom packages"
  275. SetName D [XFindShape D rpk] "Bottom package"
  276. XSetColor D rpk1 GRAY70
  277. XSetColor D rpk2 80664D
  278. XSetColor D rpk3 GRAY70
  279. # display in 3D Viewer
  280. XDisplay -dispMode 1 D -explore
  281. vfit
  282. # save to STEP if variable i7_save_xde is defined (specifies file name)
  283. if [info exists i7_save_xde] {
  284. param write.surfacecurve.mode 0
  285. WriteStep D $i7_save_xde
  286. }