FPGA開発日記

カテゴリ別記事インデックス https://msyksphinz.github.io/github_pages , English Version https://fpgadevdiary.hatenadiary.com/

RISC-Vのランダムテストジェネレータ AAPGを試す (11. AAPGを使ったデバッグ)

自作RISC-Vコアの実装がかなり安定してきたので、AAPGでさらなるテストを流している。

gitlab.com

前回はFRMの問題を修正して再度ランダムテストをすべて流した。600本程度テストを流して、落ちたのは以下。25本程度。

check_all_202310200609/result.json:    "error": 7,
check_csr_202310200612/result.json:    "error": 9,
iclass_rv64imafdc_bringup_202310192349/result.json:    "error": 1,
iclass_rv64imafdc_hazards_202310190043/result.json:    "error": 1,
iclass_rv64imafdc_recursion_branch_202310200213/result.json:    "error": 1,
iclass_rv64imafdc_test_all2_202310190220/result.json:    "error": 3,
iclass_rv64imafdc_while_test_202310190811/result.json:    "error": 1,
  1. FPUの計算結果がおかしい?
    106 GPR[13](81) <= 0000000000000000
    107 1104916 : 295841 : PC=[00000000800372fe] (M,03,02) c21d78d3 fcvt.wu.d a7, fs10
    108 ==========================================
    109 Wrong GPR[17](104): RTL = 0000000000000000, ISS = ffffffffffffffff

    126 FPR[16](19) <= ffffffff4d3254f5
    127 37932 : 5466 : PC=[00000000800054ea] (M,13,04) 21082e53 fsgnjx.s ft8, fa6, fa6
    128 ==========================================
    129 Wrong FPR[28](102): RTL = ffffffff30bfa000, ISS = ffffffff4d3254f5
  1. ロード命令の結果がおかしい?
      6 525039 : 207070 : PC=[00000000800002e6] (M,19,08) 000072a2 c.ldsp  t0, 40(sp)
      7 MR8(0x000000008009d960)=>00000000800001e0
      8 ==========================================
      9 Wrong GPR[05](125): RTL = 0000000c800001e0, ISS = 00000000800001e0

     31 43875 : 14482 : PC=[00000000800002e2] (M,50,02) 000061e2 c.ldsp  gp, 24(sp)
     32 MR8(0x00000000900016c0)=>0000000000000000
     33 ==========================================
     34 Wrong GPR[03](182): RTL = 000000000001f000, ISS = 0000000000000000

    101 396086 : 101843 : PC=[0000000080000318] (M,44,02) 000073e2 c.ldsp  t2, 56(sp)
    102 MR8(0x0000000080095ab0)=>662d0be9aab6c673
    103 ==========================================
    104 Wrong GPR[07](34): RTL = 59ae1150f0eaf9f3, ISS = 662d0be9aab6c673

    111 220373 : 72490 : PC=[00000000800002e2] (M,33,02) 000061e2 c.ldsp  gp, 24(sp)
    112 MR8(0x0000000080093a88)=>4e9ea06fd98cba15
    113 ==========================================
    114 Wrong GPR[03](78): RTL = 8000a1fa80093ab0, ISS = 4e9ea06fd98cba15

    116 293150 : 98162 : PC=[00000000800002e8] (M,13,01) 00007342 c.ldsp  t1, 48(sp)
    117 MR8(0x0000000080096328)=>00000000000065d8
    118 ==========================================
    119 Wrong GPR[06](96): RTL = 0000000000000000, ISS = 00000000000065d8

    121 392043 : 141247 : PC=[00000000800002f2] (M,35,02) 000065e6 c.ldsp  a1, 88(sp)
    122 MR8(0x0000000080090ae0)=>0000000000000000
    123 ==========================================
    124 Wrong GPR[11](15): RTL = 0000000012c47f3e, ISS = 0000000000000000
  1. hpmcounterの実装が適当になっている。
     11 8149 : RTL(61,1) Exception Cause = CSR Update Flush(27) PC=0000800004a4, Inst=c1bad7f3, csrrwi  a5, hpmcounter27, 21
     12 8149 : 646 : PC=[00000000800004a4] (M,61,01) c1bad7f3 csrrwi  a5, hpmcounter27, 21
     13 ==========================================
     14 Wrong PC: RTL = 00000000800004a4, ISS = 00000000800001e0

     16 44509 : RTL(42,1) Exception Cause = CSR Update Flush(27) PC=00008000115a, Inst=c16d3c73, csrrc   s8, hpmcounter22, s10
     17 44509 : 14922 : PC=[000000008000115a] (M,42,01) c16d3c73 csrrc   s8, hpmcounter22, s10
     18 ==========================================
     19 Wrong PC: RTL = 000000008000115a, ISS = 00000000800001e0

     21 7607 : RTL(22,1) Exception Cause = CSR Update Flush(27) PC=000080000424, Inst=c12f17f3, csrrw   a5, hpmcounter18, t5
     22 7607 : 516 : PC=[0000000080000424] (U,22,01) c12f17f3 csrrw   a5, hpmcounter18, t5
     23 ==========================================
     24 Wrong PC: RTL = 0000000080000424, ISS = 00000000800001e0

     26 14840 : RTL(59,1) Exception Cause = CSR Update Flush(27) PC=0000800007e2, Inst=c059d873, csrrwi  a6, hpmcounter5, 19
     27 14840 : 3256 : PC=[00000000800007e2] (U,59,01) c059d873 csrrwi  a6, hpmcounter5, 19
     28 ==========================================
     29 Wrong PC: RTL = 00000000800007e2, ISS = 00000000800001e0

     36 31272 : RTL(29,1) Exception Cause = CSR Update Flush(27) PC=000080000f04, Inst=c0c6a873, csrrs   a6, hpmcounter12, a3
     37 31272 : 9335 : PC=[0000000080000f04] (U,29,01) c0c6a873 csrrs   a6, hpmcounter12, a3
     38 ==========================================
     39 Wrong PC: RTL = 0000000080000f04, ISS = 00000000800001e0

     46 13117 : RTL(41,1) Exception Cause = CSR Update Flush(27) PC=0000800007d4, Inst=c17a1773, csrrw   a4, hpmcounter23, s4
     47 13117 : 2892 : PC=[00000000800007d4] (M,41,01) c17a1773 csrrw   a4, hpmcounter23, s4
     48 ==========================================
     49 Wrong PC: RTL = 00000000800007d4, ISS = 0000000080000298

     61 34027 : RTL(18,1) Exception Cause = CSR Update Flush(27) PC=000080001446, Inst=c12a2673, csrrs   a2, hpmcounter18, s4
     62 34027 : 10219 : PC=[0000000080001446] (M,18,01) c12a2673 csrrs   a2, hpmcounter18, s4
     63 ==========================================
     64 Wrong PC: RTL = 0000000080001446, ISS = 0000000080000298

     61 34027 : RTL(18,1) Exception Cause = CSR Update Flush(27) PC=000080001446, Inst=c12a2673, csrrs   a2, hpmcounter18, s4
     62 34027 : 10219 : PC=[0000000080001446] (M,18,01) c12a2673 csrrs   a2, hpmcounter18, s4
     63 ==========================================
     64 Wrong PC: RTL = 0000000080001446, ISS = 0000000080000298

    76 8037 : RTL(40,1) Exception Cause = CSR Update Flush(27) PC=00008000050c, Inst=c086d673, csrrwi  a2, hpmcounter8, 13
     77 8037 : 986 : PC=[000000008000050c] (M,40,01) c086d673 csrrwi  a2, hpmcounter8, 13
     78 ==========================================
     79 Wrong PC: RTL = 000000008000050c, ISS = 0000000080000298
  1. Atomic命令の動作バグ?
1358810 : 394064 : PC=[00000000800520d8] (M,50,16) 81e1382f amomin.d a6, t5, (sp)
MR8(0x0000000080094338)=>0000000000000000
MW8(0x0000000080094338)=>0000000000000000
==========================================
Wrong GPR[16](45): RTL = 6ea4a50cfffffda2, ISS = 0000000000000000
==========================================
  1. CSR実装の細かいところ?
     41 6539 : RTL(35,1) Exception Cause = CSR Update Flush(27) PC=000080000372, Inst=044de773, csrrsi  a4, uip, 27
     42 6539 : 112 : PC=[0000000080000372] (U,35,01) 044de773 csrrsi  a4, uip, 27
     43 ==========================================
     44 Wrong PC: RTL = 0000000080000372, ISS = 00000000800001e0

     51 15457 : RTL(40,1) Exception Cause = CSR Update Flush(27) PC=00008000090c, Inst=5a837d73, csrrci  s10, unknown_5a8, 6
     52 15457 : 3523 : PC=[000000008000090c] (M,40,01) 5a837d73 csrrci  s10, unknown_5a8, 6
     53 ==========================================
     54 Wrong PC: RTL = 000000008000090c, ISS = 0000000080000298

     56 6783 : RTL(25,1) Exception Cause = CSR Update Flush(27) PC=000080000470, Inst=24332573, csrrs   a0, vstval, t1
     57 6783 : 559 : PC=[0000000080000470] (M,25,01) 24332573 csrrs   a0, vstval, t1
     58 ==========================================
     59 Wrong PC: RTL = 0000000080000470, ISS = 0000000080000298

     71 9754 : RTL(58,1) Exception Cause = CSR Update Flush(27) PC=0000800005c6, Inst=3806fff3, csrrci  t6, unknown_380, 13
     72 9754 : 1662 : PC=[00000000800005c6] (M,58,01) 3806fff3 csrrci  t6, unknown_380, 13
     73 ==========================================
     74 Wrong PC: RTL = 00000000800005c6, ISS = 0000000080000298

     81 33539 : RTL(3,1) Exception Cause = CSR Update Flush(27) PC=0000800011bc, Inst=04453073, csrc    uip, a0
     82 33539 : 10589 : PC=[00000000800011bc] (M,03,01) 04453073 csrc    uip, a0
     83 ==========================================
     84 Wrong PC: RTL = 00000000800011bc, ISS = 0000000080000298

     86 12025 : RTL(6,1) Exception Cause = CSR Update Flush(27) PC=00008000076c, Inst=f1329ff3, csrrw   t6, mimpid, t0
     87 12025 : 2316 : PC=[000000008000076c] (M,06,01) f1329ff3 csrrw   t6, mimpid, t0
     88 ==========================================
     89 Wrong PC: RTL = 000000008000076c, ISS = 0000000080000298
Generated Thumbnail by ChapGPT DALL-E 3