FPGA開発日記

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

自作CPUのVIPTキャッシュポリシ導入検討 (8. AAPGでのランダムテスト)

自作CPUのVIPT化について,テストを強化してAAPGで実行してみようと思う.

AAPGの実行方法はかなり昔に確立した.以下のようなコマンドで,AAPGのランダムテストの生成からパタンの実行まで行ってくれる.

for config in `ls -1 ../tests/aapg/configs/core_configs/`
do
../scripts/run_aapg.py -y ../tests/aapg/configs/core_configs/${config} -j$(nproc) -n $(nproc)
done

実行してみると,数本テストが落ちるようだ:

なんかこういうのとか普通にバグっぽい気がする.

MR8(0x0000000080092da8,P0x0000000080092da8)=>0000000000000000
GPR[14](25) <= 0000000000000000
1124693 : 241910 : PC=[0000000080000328] (M,54,02) 000077e6 c.ldsp  a5, 120(sp)
MR8(0x0000000080092db0,P0x0000000080092db0)=>0000000080096ba0
GPR[15](72) <= 0000000080096ba0
1124693 : 241911 : PC=[000000008000032a] (M,54,04) 0000680a c.ldsp  a6, 128(sp)
MR8(0x0000000080092db8,P0x0000000080092db8)=>000000000000000b
GPR[16](73) <= 000000000000000b
1124693 : 241912 : PC=[000000008000032c] (M,54,08) 000068aa c.ldsp  a7, 136(sp)
MR8(0x0000000080092dc0,P0x0000000080092dc0)=>ffffffff80096c0c
GPR[17](43) <= ffffffff80096c0c
1124697 : 241913 : PC=[000000008000032e] (M,55,01) 0000694a c.ldsp  s2, 144(sp)
MR8(0x0000000080092dc8,P0x0000000080092dc8)=>0000000000000000
==========================================
Wrong GPR[18](126): RTL = 0000000080092e58, ISS = 0000000000000000
==========================================
===============================
SIMULATION FINISH : FAIL (CODE=100)
RUNNING TIME : 1124697
===============================
GPR[15](14) <= ffffffff0000000a
1995523 : 445763 : PC=[000000008000032a] (M,31,02) 0000680a c.ldsp  a6, 128(sp)
MR8(0x0000000080090cc0,P0x0000000080090cc0)=>0001800000000000
GPR[16](150) <= 0001800000000000
1995523 : 445764 : PC=[000000008000032c] (M,31,04) 000068aa c.ldsp  a7, 136(sp)
MR8(0x0000000080090cc8,P0x0000000080090cc8)=>000000000000000c
GPR[17](97) <= 000000000000000c
1995523 : 445765 : PC=[000000008000032e] (M,31,08) 0000694a c.ldsp  s2, 144(sp)
MR8(0x0000000080090cd0,P0x0000000080090cd0)=>000000000000000c
GPR[18](154) <= 000000000000000c
1995527 : 445766 : PC=[0000000080000330] (M,32,01) 000069ea c.ldsp  s3, 152(sp)
MR8(0x0000000080090cd8,P0x0000000080090cd8)=>0000000000000000
==========================================
Wrong GPR[19](39): RTL = 000000000000000a, ISS = 0000000000000000
==========================================

全部流し切ってみると,レジスタ,PCの不一致で落ちたのは以下だった.ほとんどがc.ldspで落ちている.ロード命令の動作を要確認だな.

1124697 : 241913 : PC=[000000008000032e] (M,55,01) 0000694a c.ldsp  s2, 144(sp)
Wrong GPR[18](126): RTL = 0000000080092e58, ISS = 0000000000000000
1995527 : 445766 : PC=[0000000080000330] (M,32,01) 000069ea c.ldsp  s3, 152(sp)
Wrong GPR[19](39): RTL = 000000000000000a, ISS = 0000000000000000
1393204 : 323371 : PC=[0000000080000324] (M,23,04) 000076a6 c.ldsp  a3, 104(sp)
Wrong GPR[13](85): RTL = 410f3342e0f960d1, ISS = 3b8827db2861a53e
1516280 : 347327 : PC=[000000008000032e] (M,48,01) 0000694a c.ldsp  s2, 144(sp)
Wrong GPR[18](79): RTL = 32ec14feb29c2965, ISS = 00000000e9f7f0e1
1424647 : 300517 : PC=[000000008000032c] (M,25,04) 000068aa c.ldsp  a7, 136(sp)
Wrong GPR[17](25): RTL = 0000000000001000, ISS = 0000000000000001
1925654 : 428643 : PC=[0000000080000332] (M,02,04) 00007a0a c.ldsp  s4, 160(sp)
Wrong GPR[20](50): RTL = 0000000000000000, ISS = ffffffffffffffff
1052740 : 223400 : PC=[0000000080000332] (M,12,02) 00007a0a c.ldsp  s4, 160(sp)
Wrong GPR[20](85): RTL = ffffffffffffffff, ISS = 0000000000000000
610305 : 116434 : PC=[0000000080000324] (M,33,08) 000076a6 c.ldsp  a3, 104(sp)
Wrong GPR[13](1): RTL = 7fffffff7ff6499e, ISS = 0000000000000000
330006 : 99173 : PC=[00000000800002f4] (M,40,04) 00007606 c.ldsp  a2, 96(sp)
Wrong GPR[12](60): RTL = 4bc90c6179fc93c3, ISS = ffffffffffffffff
441226 : 139453 : PC=[0000000080006fbc] (M,32,01) c024f753 fcvt.l.s a4, fs1
Wrong PC: RTL = 0000000080006fbc, ISS = 00000000800001e0
928947 : 184388 : PC=[0000000080000326] (M,14,01) 00007746 c.ldsp  a4, 112(sp)
Wrong GPR[14](159): RTL = 00000000000030f8, ISS = 0000000067600000
510489 : 94662 : PC=[000000008000032a] (M,48,04) 0000680a c.ldsp  a6, 128(sp)
Wrong GPR[16](154): RTL = ffffffffb40967e9, ISS = 0000000000000000
1136819 : 243312 : PC=[0000000080000322] (M,11,04) 00007606 c.ldsp  a2, 96(sp)
Wrong GPR[12](51): RTL = 0000000080026388, ISS = 000000005f6e959b
2156672 : 488764 : PC=[000000008000032e] (M,08,01) 0000694a c.ldsp  s2, 144(sp)
Wrong GPR[18](74): RTL = 0000000080000298, ISS = 000000000000000b
1277258 : 283535 : PC=[00000000800001ae] (M,41,08) 000068aa c.ldsp  a7, 136(sp)
Wrong GPR[17](16): RTL = 0000000080000000, ISS = 0000000000800000
586110 : 120397 : PC=[000000008000032a] (M,41,02) 0000680a c.ldsp  a6, 128(sp)
Wrong GPR[16](120): RTL = 3e706937f23ff08a, ISS = 9d30e4abcc7301d4
145068 : 13644 : PC=[0000000080000328] (M,57,01) 000077e6 c.ldsp  a5, 120(sp)
Wrong GPR[15](81): RTL = 07b34556854b581c, ISS = ffffffffd00f8eff
881316 : 184856 : PC=[000000008002c360] (U,06,04) cb811a03 lh      s4, -840(sp)
Wrong GPR[20](154): RTL = 00000000800902a0, ISS = ffffffffffffffff
512588 : 107352 : PC=[0000000080000324] (M,40,08) 000076a6 c.ldsp  a3, 104(sp)
Wrong GPR[13](77): RTL = 4facb992ea3d9d46, ISS = 7fb1235231b9300a
651610 : 136874 : PC=[0000000080000332] (M,57,04) 00007a0a c.ldsp  s4, 160(sp)
Wrong GPR[20](126): RTL = 0000000a00000800, ISS = 000000000012f628
1534262 : 332030 : PC=[0000000080000324] (M,41,08) 000076a6 c.ldsp  a3, 104(sp)
Wrong GPR[13](69): RTL = 0000000000000001, ISS = 00000000000000ff
1986619 : 442633 : PC=[0000000080000330] (M,32,02) 000069ea c.ldsp  s3, 152(sp)
Wrong GPR[19](91): RTL = ffffffff00000000, ISS = 00000000ffffffff
958543 : 201973 : PC=[0000000080023a8a] (M,14,01) 58057553 fsqrt.s fa0, fa0
Wrong PC: RTL = 0000000080023a8a, ISS = 0000000080000298
1615631 : 354725 : PC=[0000000080000328] (M,61,02) 000077e6 c.ldsp  a5, 120(sp)
Wrong GPR[15](32): RTL = 0000000000000000, ISS = 0000000080091e8b
1672061 : 368674 : PC=[0000000080044e6c] (M,30,08) 00005bd6 c.lwsp  s7, 116(sp)
Wrong GPR[23](60): RTL = 00000000987366ee, ISS = 0000000000000000
1150200 : 252882 : PC=[0000000080000326] (M,33,01) 00007746 c.ldsp  a4, 112(sp)
Wrong GPR[14](152): RTL = 0000000000000000, ISS = 0000000000000001
610098 : 200314 : PC=[0000000080008f08] (U,09,01) b083031b addiw   t1, t1, -1272
610098 : 200315 : PC=[0000000080008f0c] (U,09,02) 0000911a c.add   sp, t1
Wrong GPR[02](147): RTL = 0000000000009b08, ISS = 0000000080099b08
405413 : 122335 : PC=[0000000080006b7c] (U,19,01) d225f7d3 fcvt.d.l fa5, a1
Wrong PC: RTL = 0000000080006b7c, ISS = 00000000800001e0
690245 : 234751 : PC=[0000000080009ede] (U,16,01) 0ff0000f fence   iorw,iorw
690271 : 234751 : PC=[0000000080009ee2] (U,42,01) 0000bc32 c.fsdsp fa2, 56(sp)
Wrong PC: RTL = 0000000080009ee2, ISS = 00000000800001e0
1175288 : 246810 : PC=[000000008000032e] (M,47,08) 0000694a c.ldsp  s2, 144(sp)
Wrong GPR[18](66): RTL = 000000000000000c, ISS = ffffffffee69d6f3
609145 : 112577 : PC=[0000000080000328] (M,42,02) 000077e6 c.ldsp  a5, 120(sp)
Wrong GPR[15](99): RTL = 00000000188990d7, ISS = ffffffff8001a800
371765 : 57036 : PC=[000000008000032a] (M,34,02) 0000680a c.ldsp  a6, 128(sp)
Wrong GPR[16](11): RTL = 06932c2ce46c91d4, ISS = 0000000000000000

DEADLOCKしているのは以下.これはいろいろなので要解析かな.

==> cclass_rv64imafdc_bringup_20240623004744/out_cclass_rv64imafdc_bringup_00011.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_illegal_20240623023135/out_cclass_rv64imafdc_illegal_00001.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_illegal_20240623023135/out_cclass_rv64imafdc_illegal_00010.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_illegal_s_20240623024828/out_cclass_rv64imafdc_illegal_s_00002.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_illegal_s_20240623024828/out_cclass_rv64imafdc_illegal_s_00008.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_illegal_s_20240623024828/out_cclass_rv64imafdc_illegal_s_00009.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_recurse_low_20240623031933/out_cclass_rv64imafdc_recurse_low_00007.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_recurse_low_20240623031933/out_cclass_rv64imafdc_recurse_low_00011.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_recurse_med_20240623032144/out_cclass_rv64imafdc_recurse_med_00001.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_recurse_med_20240623032144/out_cclass_rv64imafdc_recurse_med_00002.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_recurse_med_20240623032144/out_cclass_rv64imafdc_recurse_med_00010.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_recurse_med_20240623032144/out_cclass_rv64imafdc_recurse_med_00014.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_s_recursion_20240623034555/out_cclass_rv64imafdc_s_recursion_00014.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_test_all2_20240623035628/out_cclass_rv64imafdc_test_all2_00010.rv64imafdc.standard.log <==
==> cclass_rv64imafdc_user_u_20240623043509/out_cclass_rv64imafdc_user_u_00003.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_branches1_20240623045136/out_class_rv64imafdc_branches1_00011.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_branches1_u_20240623053038/out_class_rv64imafdc_branches1_u_00010.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_bringup_u_20240623060722/out_class_rv64imafdc_bringup_u_00002.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_bringup_u_20240623060722/out_class_rv64imafdc_bringup_u_00007.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_exceptions_s_20240623063914/out_class_rv64imafdc_exceptions_s_00003.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_hazards_20240623065954/out_class_rv64imafdc_hazards_00014.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_hazards_s_20240623071017/out_class_rv64imafdc_hazards_s_00007.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_illegal_s_20240623074934/out_class_rv64imafdc_illegal_s_00008.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_illegal_u_20240623080556/out_class_rv64imafdc_illegal_u_00009.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_recurse_low_20240623082155/out_class_rv64imafdc_recurse_low_00004.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_recurse_low_20240623082155/out_class_rv64imafdc_recurse_low_00009.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_recurse_med_20240623082410/out_class_rv64imafdc_recurse_med_00005.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_recurse_med_20240623082410/out_class_rv64imafdc_recurse_med_00011.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_test_all2_20240623085814/out_class_rv64imafdc_test_all2_00000.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_test_all2_20240623085814/out_class_rv64imafdc_test_all2_00007.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_test_all2_20240623085814/out_class_rv64imafdc_test_all2_00010.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_test_all2_20240623085814/out_class_rv64imafdc_test_all2_00015.rv64imafdc.standard.log <==
==> iclass_rv64imafdc_user_s_20240623092006/out_class_rv64imafdc_user_s_00011.rv64imafdc.standard.log <==