FPGA開発日記

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

自作CPUにベクトル命令を追加する実装検討 (29. ベクトル命令のキャッシュ境界を超えるアクセスの対応)

msyksphinz.hatenablog.com

この話の続き。上記の仕様をとりあえずマイクロ・アーキテクチャに突っ込んで実装した。 一応うまく動いているっぽいが、シンプルなテストがとりあえず通ったに過ぎない。

101 / 121 : vle16_v_misalign : PASS                                                                                                                                                          
105 / 121 : vle64_v_misalign : PASS                                                                                                                                                          
114 / 121 : vle32_v_misalign : PASS                                                                                                                                                          
116 / 121 : vle8_v_misalign  : PASS                                                                                                                                                          

さらに、とりあえず前にトライしたriscv-vector-testsを試行することにした。

+    { "name": "vadd.vi-2"           , "group" : ["rvv"], "elf": "../../../tests/rvv/riscv-vector-tests/v512x64machine/vadd.vi-2", "xlen": 64},
+    { "name": "vadd.vv-0"           , "group" : ["rvv"], "elf": "../../../tests/rvv/riscv-vector-tests/v512x64machine/vadd.vv-0", "xlen": 64},
+    { "name": "vadd.vx-0"           , "group" : ["rvv"], "elf": "../../../tests/rvv/riscv-vector-tests/v512x64machine/vadd.vx-0", "xlen": 64},
+    { "name": "vadd.vx-1"           , "group" : ["rvv"], "elf": "../../../tests/rvv/riscv-vector-tests/v512x64machine/vadd.vx-1", "xlen": 64},
+    { "name": "vadd.vx-2"           , "group" : ["rvv"], "elf": "../../../tests/rvv/riscv-vector-tests/v512x64machine/vadd.vx-2", "xlen": 64},
+    { "name": "vadd.vx-3"           , "group" : ["rvv"], "elf": "../../../tests/rvv/riscv-vector-tests/v512x64machine/vadd.vx-3", "xlen": 64},
+    { "name": "vand.vi-0"           , "group" : ["rvv"], "elf": "../../../tests/rvv/riscv-vector-tests/v512x64machine/vand.vi-0", "xlen": 64},

ベクトル命令もとりあえず動き出したっぽい。

87615 : 92 : PC=[0000000080000168] (U,35,16) 0000953e c.add   a0, a5
GPR[10](173) <= 0000000080039240
350466 : L1D Load-In     : 800392c0(01611) : 000f0200_ff000107_0008000f_0200ff00_01070008_000f0200_ff000107_0008000f_0200ff00_01070008_000f0200_ff000107_0008000f_0200ff00_01070008_000f0200
350466 : Load ISS Check  : 800392c0        : 000f0200_ff000107_0008000f_0200ff00_01070008_000f0200_ff000107_0008000f_0200ff00_01070008_000f0200_ff000107_0008000f_0200ff00_01070008_000f0200
87616 : 93 : PC=[000000008000016a] (U,36,01) 000052fd c.li    t0, -1
GPR[05](61) <= ffffffffffffffff
87617 : 94 : PC=[000000008000016c] (U,37,01) 0c02f357 vsetvli t1, t0, e8, m1, ta, ma
GPR[06](62) <= 0000000000000040
87619 : 95 : PC=[0000000080000170] (U,38,01) 02050087 vle8.v  v1, (a0)
VPR[01](41) <= 95ac07ab_9782429d_c4a084ed_bf56393e_61469ed5_14bc5f46_4288f52f_fbe4a1a1_d85c8fb0_1105cf9f_69bf4fbf_aea7314e_314fa087_633823c6_504d40c0_ef52c34e_
87619 : 96 : PC=[0000000080000174] (U,38,02) 00039517 auipc   a0, 0x39
GPR[10](59) <= 0000000080039174
87619 : 97 : PC=[0000000080000178] (U,38,04) 08c50513 addi    a0, a0, 140
GPR[10](83) <= 0000000080039200