program_jun_bytes.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. // Aplica o back-end do juninho
  2. @target : mips
  3. // Especifica o tipo de metodo empregado para salvar o resultado da compilação
  4. @export : simulation //MultCoreJun
  5. // Diretorio onde o resultado da compilação será gravado
  6. @outputDirectory : `C:\Users\EUGENIO CARVALHO\Desktop\tmp\bytes`
  7. // Quantidade de palavras de um bloco 32 palavras de 4bytes
  8. @cacheBlockSize: `32`
  9. /**
  10. Profile de compilacao do back-end
  11. O formato da string é um json que descreve um array de definições de cada core
  12. {
  13. "stackBaseAddress" : 5888, -> endereço da base da pilha do core em questão
  14. "initFunction": "multiplica(0)", -> define a main de cada core. aceita ate 4 parametros com valores de constantes
  15. "id": "core0" -> label que define o codigo de cada core
  16. },
  17. Se "stackBaseAddress" não for definido o compilador irá inferir o valor iniciando do ultimo endereço da memoria
  18. */
  19. @profile: `[
  20. {
  21. "id" : "core0",
  22. "initFunction" : "multiplica(0)",
  23. "filename" : "%s_core_0.txt"
  24. },
  25. {
  26. "id" : "core1",
  27. "initFunction" : "multiplica(5)",
  28. "filename" : "%s_core_1.txt"
  29. },
  30. {
  31. "id" : "core2",
  32. "initFunction" : "multiplica(10)",
  33. "filename" : "%s_core_2.txt"
  34. },
  35. {
  36. "id" : "core3",
  37. "initFunction" : "multiplica(15)",
  38. "filename" : "%s_core_3.txt"
  39. }
  40. ]`
  41. package main;
  42. const (
  43. LIN = 4
  44. )
  45. var (
  46. origin [LIN]byte
  47. )
  48. func main() {
  49. for i:=0; i < LIN ; i++ {
  50. origin[i] = i
  51. }
  52. }
  53. /**
  54. main.@preenche_matriz.main.@preenche_matriz.value : _V8
  55. main.@preenche_matriz.@for_0.main.@preenche_matriz.@for_0.i : _V6
  56. main.@preenche_matriz.@for_0.@for_1.COL : 4
  57. main.@preenche_matriz.main.@preenche_matriz.LM1 : _V3
  58. main.@preenche_matriz.@for_0.@for_1.LM1 : _V3
  59. main.main.result : _G90
  60. main.@preenche_matriz.w : _V1
  61. main.@preenche_matriz.@for_0.@for_1.main.@preenche_matriz.@for_0.@for_1.j : _V7
  62. main.@preenche_matriz.@for_0.@for_1.CM1 : _V5
  63. main.@preenche_matriz.@for_0.@for_1.value : _V8
  64. main.@preenche_matriz.@for_0.LIN : 4
  65. _V1 : main.@preenche_matriz.w
  66. _V3 : main.@preenche_matriz.LM1
  67. _V6 : main.@preenche_matriz.@for_0.i
  68. _V5 : main.@preenche_matriz.CM1
  69. main.@preenche_matriz.@for_0.i : _V6
  70. _V8 : main.@preenche_matriz.@for_0.@for_1.value
  71. _V7 : main.@preenche_matriz.@for_0.@for_1.j
  72. _G18 : main.main.origin
  73. main.@preenche_matriz.@for_0.@for_1.i : _V6
  74. main.@preenche_matriz.CM1 : _V5
  75. main.@preenche_matriz.LIN : 4
  76. main.@preenche_matriz.main.@preenche_matriz.CM1 : _V5
  77. main.@preenche_matriz.COL : 4
  78. main.@preenche_matriz.main.@preenche_matriz.w : _V1
  79. main.@preenche_matriz.@for_0.@for_1.origin : _G18
  80. main.main.origin : _G18
  81. _G90 : main.main.result
  82. main.@preenche_matriz.@for_0.@for_1.w : _V1
  83. main.@preenche_matriz.LM1 : _V3
  84. main.@preenche_matriz.@for_0.@for_1.j : _V7
  85. 4 : main.@laplaciano.LIN
  86. main.@laplaciano.LIN : 4
  87. main.@laplaciano.COL : 4
  88. _V22 : main.@laplaciano.CM1
  89. main.@laplaciano.CM1 : _V22
  90. main.@laplaciano.main.@laplaciano.CM1 : _V22
  91. main.@laplaciano.@for_3.@for_4.CM1 : _V22
  92. _V20 : main.@laplaciano.LM1
  93. main.@laplaciano.LM1 : _V20
  94. main.@laplaciano.@for_3.LM1 : _V20
  95. main.@laplaciano.main.@laplaciano.LM1 : _V20
  96. main.@laplaciano.@for_3.i : _V23
  97. _V23 : main.@laplaciano.@for_3.i
  98. main.@laplaciano.@for_3.@for_4.i : _V23
  99. main.@laplaciano.@for_3.main.@laplaciano.@for_3.i : _V23
  100. main.@laplaciano.main.@laplaciano.l : _V36
  101. main.@laplaciano.@for_3.@for_4.l : _V36
  102. _V36 : main.@laplaciano.@for_3.@for_4.l
  103. _V24 : main.@laplaciano.@for_3.@for_4.j
  104. main.@laplaciano.@for_3.@for_4.j : _V24
  105. main.@laplaciano.@for_3.@for_4.main.@laplaciano.@for_3.@for_4.j : _V24
  106. main.@laplaciano.@for_3.@for_4.origin : _G18
  107. main.@laplaciano.@for_3.@for_4.result : _G90
  108. <laplaciano>:
  109. 16c: 0666763244 addiu sp,sp,-20 -- prolog| push stack frame
  110. 170: 0001962017 addu fp,zero,sp -- prolog|copy fp ← sp
  111. 174: 0605028355 addiu s0,zero,3 .0 -- copy _V20 ← 3
  112. 178: 2949644288 sw s0,fp,0 .1 -- store content of s0 in _V20
  113. 17c: 0605093891 addiu s1,zero,3 .2 -- copy _V22 ← 3
  114. 180: 2949709828 sw s1,fp,4 .3 -- store content of s1 in _V22
  115. 184: 0605159425 addiu s2,zero,1 .4 -- copy _V23 ← 1
  116. 188: 2949775368 sw s2,fp,8 .5 -- store content of s2 in _V23
  117. 18c: 0134217958 j 398 <laplaciano+0x22c> .6 -- jump to laplaciano+_i20
  118. 190: 0000000000 sll zero,zero,0 .6 -- Nop
  119. 194: 0605224961 addiu s3,zero,1 .7 -- copy _V24 ← 1
  120. 198: 2949840908 sw s3,fp,12 .8 -- store content of s3 in _V24
  121. 19c: 0134217948 j 370 <laplaciano+0x204> .9 -- jump to laplaciano+_i24
  122. 1a0: 0000000000 sll zero,zero,0 .9 -- Nop
  123. 1a4: 2413035528 lw s4,fp,8 .10 -- load content from _V23 in s4
  124. 1a8: 0000000000 sll zero,zero,0 .10 -- Nop
  125. 1ac: 0646840319 addiu t5,s4,-1 .11 -- _T26 = _V23 - 1
  126. 1b0: 0000880768 sll t6,t5,2 .12 -- _T27 = _T26 << 2
  127. 1b4: 2413101068 lw s5,fp,12 .13 -- load content from _V24 in s5
  128. 1b8: 0000000000 sll zero,zero,0 .13 -- Nop
  129. 1bc: 0001407009 addu t7,zero,s5 .14 -- copy _T29 ← _V24
  130. 1c0: 0030371873 addu t6,t6,t7 .15 -- _T27 = _T27 + _T29
  131. 1c4: 0000966784 sll t8,t6,2 .16 -- _T33 = _T27 << 2
  132. 1c8: 0060342305 addu t8,gp,t8 .17
  133. 1cc: 2400583680 lw s6,t8,0 .17
  134. 1d0: 0000000000 sll zero,zero,0 .17 -- Nop
  135. 1d4: 0001488929 addu s7,zero,s6 .17 -- copy s7 ← s6
  136. 1d8: 2950103056 sw s7,fp,16 .18 -- store content of s7 in _V36
  137. 1dc: 2413035528 lw s4,fp,8 .19 -- load content from _V23 in s4
  138. 1e0: 0000000000 sll zero,zero,0 .19 -- Nop
  139. 1e4: 0001327137 addu t0,zero,s4 .20 -- copy _T37 ← _V23
  140. 1e8: 0000542848 sll t1,t0,2 .21 -- _T38 = _T37 << 2
  141. 1ec: 2413101068 lw s5,fp,12 .22 -- load content from _V24 in s5
  142. 1f0: 0000000000 sll zero,zero,0 .22 -- Nop
  143. 1f4: 0648806399 addiu t3,s5,-1 .23 -- _T41 = _V24 - 1
  144. 1f8: 0019613729 addu t1,t1,t3 .24 -- _T38 = _T38 + _T41
  145. 1fc: 0000614528 sll t4,t1,2 .25 -- _T45 = _T38 << 2
  146. 200: 0059531297 addu t4,gp,t4 .26
  147. 204: 2374828032 lw t5,t4,0 .26
  148. 208: 2413232144 lw s7,fp,16 .27 -- load content from _V36 in s7
  149. 20c: 0000000000 sll zero,zero,0 .27 -- Nop
  150. 210: 0049133601 addu s7,s7,t5 .28 -- _V36 = _V36 + _T47
  151. 214: 2950103056 sw s7,fp,16 .29 -- store content of s7 in _V36
  152. 218: 2413035528 lw s4,fp,8 .30 -- load content from _V23 in s4
  153. 21c: 0000000000 sll zero,zero,0 .30 -- Nop
  154. 220: 0001341473 addu t7,zero,s4 .31 -- copy _T48 ← _V23
  155. 224: 0001011840 sll t6,t7,2 .32 -- _T49 = _T48 << 2
  156. 228: 2413101068 lw s5,fp,12 .33 -- load content from _V24 in s5
  157. 22c: 0000000000 sll zero,zero,0 .33 -- Nop
  158. 230: 0648544257 addiu t0,s5,1 .34 -- _T52 = _V24 + 1
  159. 234: 0029913121 addu t6,t6,t0 .35 -- _T49 = _T49 + _T52
  160. 238: 0000938112 sll t2,t6,2 .36 -- _T56 = _T49 << 2
  161. 23c: 0059396129 addu t2,gp,t2 .37
  162. 240: 2370502656 lw t3,t2,0 .37
  163. 244: 2413232144 lw s7,fp,16 .38 -- load content from _V36 in s7
  164. 248: 0000000000 sll zero,zero,0 .38 -- Nop
  165. 24c: 0049002529 addu s7,s7,t3 .39 -- _V36 = _V36 + _T58
  166. 250: 2950103056 sw s7,fp,16 .40 -- store content of s7 in _V36
  167. 254: 2413035528 lw s4,fp,8 .41 -- load content from _V23 in s4
  168. 258: 0000000000 sll zero,zero,0 .41 -- Nop
  169. 25c: 0646709249 addiu t4,s4,1 .42 -- _T60 = _V23 + 1
  170. 260: 0000813184 sll t5,t4,2 .43 -- _T61 = _T60 << 2
  171. 264: 2413101068 lw s5,fp,12 .44 -- load content from _V24 in s5
  172. 268: 0000000000 sll zero,zero,0 .44 -- Nop
  173. 26c: 0001407009 addu t7,zero,s5 .45 -- copy _T63 ← _V24
  174. 270: 0028272673 addu t5,t5,t7 .46 -- _T61 = _T61 + _T63
  175. 274: 0000901248 sll t8,t5,2 .47 -- _T67 = _T61 << 2
  176. 278: 0060342305 addu t8,gp,t8 .48
  177. 27c: 2399666176 lw t0,t8,0 .48
  178. 280: 2413232144 lw s7,fp,16 .49 -- load content from _V36 in s7
  179. 284: 0000000000 sll zero,zero,0 .49 -- Nop
  180. 288: 0048805921 addu s7,s7,t0 .50 -- _V36 = _V36 + _T69
  181. 28c: 2950103056 sw s7,fp,16 .51 -- store content of s7 in _V36
  182. 290: 2413035528 lw s4,fp,8 .52 -- load content from _V23 in s4
  183. 294: 0000000000 sll zero,zero,0 .52 -- Nop
  184. 298: 0001339425 addu t6,zero,s4 .53 -- copy _T70 ← _V23
  185. 29c: 0000938112 sll t2,t6,2 .54 -- _T71 = _T70 << 2
  186. 2a0: 2413101068 lw s5,fp,12 .55 -- load content from _V24 in s5
  187. 2a4: 0000000000 sll zero,zero,0 .55 -- Nop
  188. 2a8: 0001398817 addu t3,zero,s5 .56 -- copy _T73 ← _V24
  189. 2ac: 0021712929 addu t2,t2,t3 .57 -- _T71 = _T71 + _T73
  190. 2b0: 0000673920 sll t1,t2,2 .58 -- _T77 = _T71 << 2
  191. 2b4: 0059328545 addu t1,gp,t1 .59
  192. 2b8: 2368929792 lw s3,t1,0 .59
  193. 2bc: 0000000000 sll zero,zero,0 .59 -- Nop
  194. 2c0: 0001269793 addu t4,zero,s3 .59 -- copy t4 ← s3
  195. 2c4: 0604962820 addiu t7,zero,4 .60
  196. 2c8: 0026175512 mult t4,t7 .60 -- _T80 = _T79 * 4
  197. 2cc: 0000026642 mflo t5 .60
  198. 2d0: 2413232144 lw s7,fp,16 .61 -- load content from _V36 in s7
  199. 2d4: 0000000000 sll zero,zero,0 .61 -- Nop
  200. 2d8: 0049133601 addu s7,s7,t5 .62 -- _V36 = _V36 + _T80
  201. 2dc: 2950103056 sw s7,fp,16 .63 -- store content of s7 in _V36
  202. 2e0: 2413232144 lw s7,fp,16 .64 -- load content from _V36 in s7
  203. 2e4: 0000000000 sll zero,zero,0 .64 -- Nop
  204. 2e8: 0605552895 addiu t8,zero,255 .65
  205. 2ec: 0049811491 subu v0,s7,t8 .65
  206. 2f0: 0406847493 blez v0,308 <laplaciano+0x19c> .65 -- branch if register <= 0
  207. 2f4: 0000000000 sll zero,zero,0 .65 -- Nop
  208. 2f8: 0605421823 addiu s6,zero,255 .66 -- copy _V36 ← 255
  209. 2fc: 2950037520 sw s6,fp,16 .67 -- store content of s6 in _V36
  210. 300: 0134217931 j 32c <laplaciano+0x1c0> .68 -- jump to laplaciano+_i25
  211. 304: 0000000000 sll zero,zero,0 .68 -- Nop
  212. 308: 2412773392 lw s0,fp,16 .69 -- load content from _V36 in s0
  213. 30c: 0000000000 sll zero,zero,0 .69 -- Nop
  214. 310: 0033558563 subu v0,s0,zero .70
  215. 314: 0071303173 bgez v0,32c <laplaciano+0x1c0> .70 -- branch if register >= 0
  216. 318: 0000000000 sll zero,zero,0 .70 -- Nop
  217. 31c: 0605093888 addiu s1,zero,0 .71 -- copy _V36 ← 0
  218. 320: 2949709840 sw s1,fp,16 .72 -- store content of s1 in _V36
  219. 324: 0134217931 j 32c <laplaciano+0x1c0> .73 -- jump to laplaciano+_i25
  220. 328: 0000000000 sll zero,zero,0 .73 -- Nop
  221. 32c: 2412904456 lw s2,fp,8 .74 -- load content from _V23 in s2
  222. 330: 0000000000 sll zero,zero,0 .74 -- Nop
  223. 334: 0001200161 addu t2,zero,s2 .75 -- copy _T81 ← _V23
  224. 338: 0000673920 sll t1,t2,2 .76 -- _T82 = _T81 << 2
  225. 33c: 2413035532 lw s4,fp,12 .77 -- load content from _V24 in s4
  226. 340: 0000000000 sll zero,zero,0 .77 -- Nop
  227. 344: 0001335329 addu t4,zero,s4 .78 -- copy _T84 ← _V24
  228. 348: 0019679265 addu t1,t1,t4 .79 -- _T82 = _T82 + _T84
  229. 34c: 0000620672 sll t7,t1,2 .80 -- _T88 = _T82 << 2
  230. 350: 2413101072 lw s5,fp,16 .81 -- load content from _V36 in s5
  231. 354: 0000000000 sll zero,zero,0 .81 -- Nop
  232. 358: 0059734049 addu t7,gp,t7 .82
  233. 35c: 2918514752 sw s5,t7,64 .82 -- store content of t7 in _G90[_T88]
  234. 360: 2413232140 lw s7,fp,12 .83 -- load content from _V24 in s7
  235. 364: 0000000000 sll zero,zero,0 .83 -- Nop
  236. 368: 0653721601 addiu s7,s7,1 .84 -- _V24 = _V24 + 1
  237. 36c: 2950103052 sw s7,fp,12 .85 -- store content of s7 in _V24
  238. 370: 2413166604 lw s6,fp,12 .86 -- load content from _V24 in s6
  239. 374: 2412773380 lw s0,fp,4 .87 -- load content from _V22 in s0
  240. 378: 0000000000 sll zero,zero,0 .87 -- Nop
  241. 37c: 0047190051 subu v0,s6,s0 .88
  242. 380: 0071368584 bltz v0,1a4 <laplaciano+0x38> .88 -- branch if register < 0
  243. 384: 0000000000 sll zero,zero,0 .88 -- Nop
  244. 388: 2412838920 lw s1,fp,8 .89 -- load content from _V23 in s1
  245. 38c: 0000000000 sll zero,zero,0 .89 -- Nop
  246. 390: 0640745473 addiu s1,s1,1 .90 -- _V23 = _V23 + 1
  247. 394: 2949709832 sw s1,fp,8 .91 -- store content of s1 in _V23
  248. 398: 2412904456 lw s2,fp,8 .92 -- load content from _V23 in s2
  249. 39c: 2413035520 lw s4,fp,0 .93 -- load content from _V20 in s4
  250. 3a0: 0000000000 sll zero,zero,0 .93 -- Nop
  251. 3a4: 0039063587 subu v0,s2,s4 .94
  252. 3a8: 0071368570 bltz v0,194 <laplaciano+0x28> .94 -- branch if register < 0
  253. 3ac: 0000000000 sll zero,zero,0 .94 -- Nop
  254. 3b0: 0666697748 addiu sp,sp,20 -- epilog| pop stack frame
  255. 3b4: 0001962017 addu fp,zero,sp -- epilog| pop stack frame
  256. 3b8: 0065011720 jr ra -- epilog| return
  257. load (int32) _V36 T< load >
  258. 120: 65: if _V36 <= 255 goto <laplaciano+_i26> T< branch >
  259. <laplaciano+_i27>:
  260. 121: 66: _V36 := 255 T< copy >
  261. 122: 67: store (int32) _V36 T< store >
  262. 123: 68: goto <laplaciano+_i25> T< jump >
  263. <laplaciano+_i26>:
  264. 124: 69: load (int32) _V36 T< load >
  265. 125: 70: if _V36 >= 0 goto <laplaciano+_i28> T< branch >
  266. <laplaciano+_i29>:
  267. 126: 71: _V36 := 0 T< copy >
  268. 127: 72: store (int32) _V36 T< store >
  269. 128: 73: goto <laplaciano+_i25> T< jump >
  270. <laplaciano+_i28>:
  271. <laplaciano+_i25>:
  272. */