たとえば、次のアセンブラ ステートメントはオペコードに変換する必要があります。0x0000000b
custom0 0,0,0,0
古いバージョンの riscv-gnu-toolchain (6 月 4 日にビルド) では、これをアセンブルするのに -march= オプションは必要ありませんでした。ただし、今日のriscv-toolsの git head を使用すると、次のようになります。
$ /opt/riscv_new/bin/riscv64-unknown-elf-as -m32 test.s
test.s: Assembler messages:
test.s:1: Error: unrecognized opcode `custom0 0,0,0,0'
ソースコードを読んで、アーチXcustom
をツールに渡すとそれが修正されるはずだと思いますが、
$ /opt/riscv_new/bin/riscv64-unknown-elf-as -m32 -march=RV32IMXcustom test.s
test.s: Assembler messages:
test.s:1: Error: unrecognized opcode `custom0 0,0,0,0'
(現時点では、このため、PicoRV32 テスト ファームウェアは最新の riscv-gnu-toolchain でビルドされません。 )
編集: 私のために働く riscv-tools の最後のバージョンは、8 月 20 日のコミット 84a47e0b4e です。そのバージョンでは、-march=
オプションの有無にかかわらず、custom0 オペコードが認識されます。