Inst Asm

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

// --------------------------------------------------

// Init integer
0 : addi x1, x0, 4 x1 = 4 = 0004h
4 : addi x2, x0, 16 x2 = 16 = 0010h
8 : addi x3, x0, 3004 x3 = 4,294,966,204 = -1092 = FFFF_FBBCh
12 : addi x4, x0, -625 x4 = -625 = FFFF_FD8Fh
16 : addi x5, x0, 69 x5 = 69 = 0045h
20 : addi x6, x0, -16 x6 = -16 = FFFF_FFF0h
24 : addi x7, x0, -1975 x7 = -1975 = FFFF_F849h
28 : slli x8, x3, 20 x8 = 3,149,922,304 = -1,145,044,992 =
BBC0_0000h

// --------------------------------------------------
// Init float
32 : fcvt.s.w f1, x1 x1 = 4.0 = 4080_0000h
36 : fcvt.s.w f2, x2 x2 = 16.0 = 4180_0000h
40 : fcvt.s.w f3, x3 x3 = -1092.0 = C488_8000h
44 : fcvt.s.w f4, x4 x4 = -625.0 = C41C_4000h
48 : fcvt.s.w f5, x5 x5 = 69.0 = 428A_0000h
52 : fcvt.s.w f6, x6 x6 = -16.0 = C180_0000h
56 : fcvt.s.w f7, x8 x7 = -4,194,304.0.0 = CA80_0000h
// convert float to int: effect only 23-bit low value, FFFF_F849h = -1975 (normal),
= 8,386,633 (23-bit low value, the rest of bit are ignore)
60 : fcvt.s.wu x8, x8 x8 = 4,194,304.0 = 4A80_0000h

// --------------------------------------------------
// Init data_mem
64 : sw x1, 2000 (x0) [500] = 0004h
68 : sw x2, 2004 (x0) [501] = 0010h
72 : sw x3, 2008 (x0) [502] = FFFF_FBBCh
76 : sw x4, 2012 (x0) [503] = FFFF_FD8Fh
80 : sw x5, 2016 (x0) [504] = 0045h
84 : sw x6, 2020 (x0) [505] = FFFF_FFF0h
88 : sw x7, 2024 (x0) [506] = FFFF_F849h
92 : sw x8, 2028 (x0) [507] = BBC0_0000h
96 : fsw f1, 2032 (x0) [508] = 4080_0000h
100: fsw f2, 2036 (x0) [509] = 4180_0000h
104: fsw f3, 2040 (x0) [510] = C488_8000h
108: fsw f4, 2044 (x0) [511] = C41C_4000h
112: fsw f5, 2048 (x0) [512] = 428A_0000h
116: fsw f6, 2052 (x0) [513] = C180_0000h
120: fsw f7, 2056 (x0) [514] = CA80_0000h
124: fsw f8, 2060 (x0) [515] = 4A80_0000h
128: sw x1, 2064 (x0) [516] = 0004h
132: sw x2, 2068 (x0) [517] = 0010h
136: sw x3, 2072 (x0) [518] = FFFF_FBBCh
140: sw x4, 2076 (x0) [519] = FFFF_FD8Fh
144: sw x5, 2080 (x0) [520] = 0045h
148: sw x6, 2084 (x0) [521] = FFFF_FFF0h
152: sw x7, 2088 (x0) [522] = FFFF_F849h
156: sw x8, 2092 (x0) [523] = 0000h
160: fsw f1, 2096 (x0) [524] = 4080_0000h
164: fsw f2, 2100 (x0) [525] = 4180_0000h
168: fsw f3, 2104 (x0) [526] = C488_8000h
172: fsw f4, 2108 (x0) [527] = C41C_4000h
176: fsw f5, 2112 (x0) [528] = 428A_0000h
180: fsw f6, 2116 (x0) [529] = C180_0000h
184: fsw f7, 2120 (x0) [530] = CA80_0000h
188: fsw f8, 2124 (x0) [531] = 4A80_0000h
// --------------------------------------------------
// Init D_Cache
192: lw x19, 2000 (x0) [500] = 0004h
196: lw x19, 2004 (x0) [501] = 0010h
200: lw x19, 2008 (x0) [502] = FFFF_FBBCh
204: lw x19, 2012 (x0) [503] = FFFF_FD8Fh
208: lw x19, 2016 (x0) [504] = 0045h
212: lw x19, 2020 (x0) [505] = FFFF_FFF0h
216: lw x19, 2024 (x0) [506] = FFFF_F849h
220: lw x19, 2028 (x0) [507] = BBC0_0000h
224: flw f19, 2032 (x0) [508] = 4080_0000h
228: flw f19, 2036 (x0) [509] = 4180_0000h
232: flw f19, 2040 (x0) [510] = C488_8000h
236: flw f19, 2044 (x0) [511] = C41C_4000h
240: flw f19, 2048 (x0) [512] = 428A_0000h
244: flw f19, 2052 (x0) [513] = C180_0000h
248: flw f19, 2056 (x0) [514] = CA80_0000h
252: flw f19, 2060 (x0) [515] = 4A80_0000h
256: lw x19, 2064 (x0) [516] = 0004h
260: lw x19, 2068 (x0) [517] = 0010h
264: lw x19, 2072 (x0) [518] = FFFF_FBBCh
268: lw x19, 2076 (x0) [519] = FFFF_FD8Fh
272: lw x19, 2080 (x0) [520] = 0045h
276: lw x19, 2084 (x0) [521] = FFFF_FFF0h
280: lw x19, 2088 (x0) [522] = FFFF_F849h
284: lw x19, 2092 (x0) [523] = BBC0_0000h
288: flw f19, 2096 (x0) [524] = 4080_0000h
292: flw f19, 2100 (x0) [525] = 4180_0000h
296: flw f19, 2104 (x0) [526] = 453B_C000h
300: flw f19, 2108 (x0) [527] = C41C_4000h
304: flw f19, 2112 (x0) [528] = 428A_0000h
308: flw f19, 2116 (x0) [529] = C180_0000h
312: flw f19, 2120 (x0) [530] = CA80_0000h
316: flw f19, 2124 (x0) [531] = 4A80_0000h

// --------------------------------------------------
// Base integer calculate (non-hazard)
320: add x10, x1, x2 x10 = 20
324: sub x11, x3, x2 x11 = -1108
328: sll x12, x4, x1 x12 = -10,000
332: slt x13, x4, x5 x13 = 1
336: sltu x14, x4, x5 x14 = 0
340: xor x15, x3, x5 x15 = -1031
344: srl x16, x3, x1 x16 = 268,435,387
348: sra x17, x4, x1 x17 = -40
352: or x18, x3, x5 x18 = -1027
356: and x19, x3, x5 x19 = 4

// Base integer calculate (hazard)


360: add x20, x1, x2 x20 = 20
364: sub x21, x20, x3 x21 = 1112
368: sll x22, x21, x1 x22 = 17,792
372: slt x23, x22, x20 x23 = 0
376: sltu x24, x22, x21 x24 = 0
380: xor x25, x22, x20 x25 = 17,812
384: srl x26, x25, x20 x26 = 0
388: sra x27, x24, x1 x27 = 0
392: or x28, x25, x26 x28 = 17,812
396: and x29, x25, x27 x29 = 0

// --------------------------------------------------
// Base integer imm (non-hazard)
400: addi x10, x3, -94 x10 = -1186
404: slti x11, x2, -17 x11 = 0
408: sltiu x12, x2, -17 x12 = 1
412: xori x13, x4, 1234 x13 = -1,699
416: ori x14, x7, 209 x14 = -1831
420: andi x15, x8, 1950 x15 = 0
424: slli x16, x2, 10 x16 = 16,384
428: srli x17, x4, 4 x17 = 268,435,416 = 0FFF_FFD8h
432: srai x18, x4, 4 x18 = -40 = FFFF_FFD8h
436: lui x19, 8192 x19 = 200_0000h
440: auipc x9, 8192 x9 = 200_01B8h

// Base integer imm (hazard)


444: addi x20, x3, -94 x20 = -1186
448: slti x21, x20, -2009 x21 = 0
452: sltiu x22, x20, -2009 x22 = 0
456: xori x23, x20, 1234 x23 = -116
460: ori x24, x23, 302 x24 = -82
464: andi x25, x23, 2006 x25 = 1924
468: slli x26, x25, 2 x26 = 7696
472: srli x27, x25, 4 x27 = 120
476: srai x28, x26, 5 x28 = 240

// --------------------------------------------------
// Branch (non-hazard)
480: beq x10, x11, 12 not jump to 492
484: beq x10, x20, 12 jump to 496
488: 0x0000_0000h
492: 0x0000_0000h
496: bne x10, x20, 8 not jump to 504
500: bne x10, x11, 8 jump to 508
504: 0x0000_0000h
508: blt x0, x10, 12 not jump to 520
512: blt x10, x0, 12 jump to 524
516: 0x0000_0000h
520: 0x0000_0000h
524: bge x20, x0, 12 not jump to 536
528: bge x0, x20, 16 jump to 544
532: 0x0000_0000h
536: 0x0000_0000h
540: 0x0000_0000h
544: bltu x18, x0, 8 not jump to 552
548: bltu x10, x18, 8 jump to 556
552: 0x0000_0000h
556: bgeu x0, x18, 12 not jump to 568
560: bgeu x18, x10, 12 jump to 572
564: 0x0000_0000h
568: 0x0000_0000h

// Branch (hazard)
572: addi x30, x0, 123 x30 = 123
576: addi x31, x0, 123 x31 = 123
580: beq x30, x0, 18 not jump to 588
584: beq x30, x31, 12 jump to 596
588: jal x29, 52 jump to 640, x29 = 592
592: jalr x29, x31, 652 jump to 668, x29 = 596
596: addi x30, x0, 456 x30 = 456
600: addi x31, x0, 456 x31 = 456
604: bne x31, x30, 8 not jump to 612
608: bne x0, x31, 8 jump to 616
612: 0x0000_0000h
616: addi x30, x0, 123 x30 = 123
620: addi x31, x0, 789 x31 = 789
624: blt x31, x30, 12 not jump to 636
628: blt x30, x31, -40 jump to 588
632: 0x0000_0000h
636: 0x0000_0000h
640: addi x30, x0, 61 x30 = 61
644: addi x31, x0, 16 x31 = 16
648: bge x31, x30, 12 not jump to 660
652: bge x30, x31, -60 jump to 592
656: jalr x19, x29, 20 jump to 684, x19 = 660
660: jal x29, -4 jump to 656, x29 = 664
664: 0x0000_0000h
668: addi x30, x0, -16 x30 = -16
672: addi x31, x0, -4 x31 = -4
676: bltu x31, x30, 16 not jump to 692
680: bltu x30, x31, -20 jump to 660
684: bgeu x19, x29, 8 not jump to 692
688: bgeu x29, x19, 8 jump to 696
692: 0x0000_0000h

// --------------------------------------------------
// Load, store integer (non-hazard)
696: lb x10, 2024 (x0) x10 = 49h ([506] = FFFF_F849h)
700: lh x11, 2024 (x0) x11 = FFFF_F849h
704: lw x12, 2024 (x0) x12 = FFFF_F849h
708: lbu x13, 2024 (x0) x13 = 49h
712: lhu x14, 2024 (x0) x14 = FFFF_F849h
716: sb x7, 2128 (x0) [532] = 49h (x7 = FFFF_F849h)
720: sh x7, 2132 (x0) [533] = FFFF_F849h
724: sw x7, 2136 (x0) [534] = FFFF_F849h

// Load, store integer (hazard offset)


728: addi x29, x0, 4 x29 = 4
732: lb x20, 2020 (x29) x20 = 49h ([506] = FFFF_F849h)
736: lh x21, 2020 (x29) x21 = FFFF_F849h
740: lw x22, 2020 (x29) x22 = FFFF_F849h
744: addi x19, x0, 8 x19 = 8
748: sb x7, 2132 (x19) [535] = 49h
752: sh x7, 2136 (x19) [536] = FFFF_F849h
756: sw x7, 2140 (x19) [537] = FFFF_F849h

// Store integer (hazard data)


760: addi x19, x0, 12 x19 = 12
764: add x9, x7, x0 x9 = -1975 = FFFF_F849h
768: sb x9, 2140 (x19) [538] = 49h
772: sh x9, 2144 (x19) [539] = FFFF_F849h
776: sw x9, 2148 (x19) [540] = FFFF_F849h

// Store and load at the same address


780: addi x19, x0, 16 x19 = 16
784: add x29, x7, x0 x29 = -1975 = FFFF_F849h
788: sw x29, 2148 (x19) [541] = FFFF_F849h
792: lw x9, 2148 (x19) x9 = [541]
796: addi x30, x9, 0 x30 = -1975 = FFFF_F849h
800: addi x31, x9, 0 x31 = -1975 = FFFF_F849h

// --------------------------------------------------
// Base float (non-hazard)
804: fmadd.s f10, f1, f2, f6 x10 = 48.0 = 4240_0000h
808: fmsub.s f11, f1, f2, f6 x11 = 80.0 = 42A0_0000h
812: fnmadd.s f12, f1, f2, f6 x12 = -80.0 = C2A0_0000h
816: fnmsub.s f13, f1, f2, f6 f13 = -48.0 = C240_0000h
820: fadd.s f14, f2, f5 f14 = 85.0 = 42AA_0000h
824: fsub.s f15, f2, f5 f15 = -53.0 = C254_0000h
828: fmul.s f16, f5, f2 f16 = 1104.0 = 448a_0000h
832: fdiv.s f17, f5, f2 f17 = 4.3125 = 4089_FFDBh
836: fsqrt.s f18, f2 f18 = 4 = 4080_0003h
840: fsgnj.s f19, f6, f1 f19 = 16 = 4180_0000h
844: fsgnjn.s f20, f6, f1 f20 = -16 = C180_0000h
848: fsgnjx.s f21, f6, f1 f21 = -16 = C180_0000h
852: fmin.s f22, f1, f6 f22 = -16 = C180_0000h
856: fmax.s f23, f1, f6 x23 = 4 = 4080_0000h
860: feq.s x24, f2, f6 x24 = 0
864: flt.s x25, f2, f6 x25 = 0
868: fle.s x26, f2, f6 x26 = 0

// Base float (hazard)


872: fadd.s f9, f1, f2 f9 = 20.0 = 41A0_0000h
876: fmadd.s f10, f1, f9, f6 f10 = 64.0 = 4280_0000h
880: fmsub.s f11, f9, f2, f10 f11 = 256.0 = 4380_0000h
884: fnmadd.s f12, f10, f9, f11 f12 = -1024.0 = C480_0000h
888: fnmsub.s f13, f11, f9, f10 f13 = -5184.0 = C5A2_0000h
892: fadd.s f14, f11, f12 f14 = -768.0 = C440_0000h
896: fsub.s f15, f12, f13 f15 = 4160.0 = 4582_0000h
900: fmul.s f16, f14, f9 f16 = -15,360.0 = C670_0000h
904: fdiv.s f17, f15, f14 f17 = -5.416 = C0AD_54DAh
908: fsqrt.s f18, f15 f18 = 64.498 = 4280_FEF7h
912: fsgnj.s f19, f6, f17 f19 = -16 = C180_0000h
916: fsgnjn.s f20, f6, f17 f20 = 16 = 4180_0000h
920: fsgnjx.s f21, f18, f6 f21 = -64.498 = C280_FEF7h
924: fmin.s f22, f20, f21 f22 = -64.498 = C280_FEF7h
928: fmaf.s f23, f20, f22 f23 = 16 = 4180_0000h
932: feq.s x24, f21, f22 f24 = 1
936: flt.s x25, f22, f23 x25 = 1
940: fle.s x26, f24, f25 x26 = 1

// --------------------------------------------------
// Load, store float (hazard offset)
944: addi x9, x0, 4 x9 = 4
948: fsw f9, 2164 (x9) [542] = 20.0 = 41A0_0000h
952: flw f10, 2164 (x9) x10 = [542]

// Store float (hazard data)


956: addi x19, x0, 8 x19 = 8
960: fadd.s f27, f4, f0 x27 = -625.0 = C41C_4000h
964: fsw f27, 2164 (x19) [543] = C41C_4000h

// Store and load float at the same address


968: addi x19, x0, 4 x19 = 4
972: fadd.s f27, f5, f0 x27 = 69.0 = 428A_0000h
976: fsw f27, 2180 (x19) [546] = 69.0
980: flw f28, 2180 (x19) x28 = [546]
984: fadd.s f29, f28, f0 x29 = 69.0
988: fadd.s f30, f28, f0 x30 = 69.0

// --------------------------------------------------
// Structural Hazard
992: lw x16, 2000 (x0) x16 = 4
996: lw x17, 2004 (x0) x17 = 16
1000:add x18, x16, x17 x18 = 20

// --------------------------------------------------
// D-Cache operation
1004:lw x16, 2068 (x0) x16 = [517]
1008:lw x16, 2196 (x0) x16 = [549]
1012:sw x8, 2036 (x0) [509] = BBC0_0000h
1016:lw x16, 2196 (x0) x16 = [549]
1020:lw x16, 2004 (x0) x16 = [501]
1024:lw x16, 2228 (x0) x16 = [557]
1028:sw x8, 2256 (x0)

// --------------------------------------------------
// TRNG
1032 0000_0000
1036 0000_0000
1040 0000_0000
1044 0000_0000
1048 0000_0000
1052 0000_0000
1056 0000_0000
1060 0000_0000
1060:lw x31, 4084 (x0)
1064:lw x30, 4084 (x0)
1068:lw x29, 4080 (x0)
1072:lw x28, 4084 (x0)

You might also like