Skip to content

New architecture extension mechanism

Latest
Compare
Choose a tag to compare
@nathan-TT nathan-TT released this 22 Nov 18:11
· 5 commits to main since this release

New RiscV-compliant architecture extension mechanism

Warning: incompatible command options and elf numbers

This release replaces the adhoc RiscV architecture flags and options with the more usual scheme. Command line options have changed -- there was no way to keep compatibility. But the good news is you do not have to specify things twice and risk doing that inconsistently.

  1. Tenstorrent has reserved tt as an architecture extension prefix -- see https://github.com/riscv-non-isa/riscv-toolchain-conventions/blob/main/src/toolchain-conventions.adoc

  2. There are 3 new RiscV architecture extension attributes: xttgs, xttwh & xttbh for Grayskull, Wormhole & Blackhole respectively. These replace the non-standard y, w & l letters. These extensions remain mutually incompatible -- you can only select at most one of them. This means a lack of binary compatibility with old object files and executables (as the attributes are embedded in .riscv_attributes sections).

  3. The non-standard ELF machine numbers for the 3 ISAs are removed. All object files are marked with the conventional EM_RISCV (243) machine number. Thus a regular RiscV toolchain will be able to examine binaries, but not disassemble the new instructions. This means a lack of binary compatibility with old object files and executables.

  4. The -mgrayskull, -mwormhole, -mblackhole command line options are removed from both compiler and assembler.

  5. It is sufficient to use -march=rv32i_xttgs, -march=rv32im_xttwh or -march=rv32im_xttbh to select a variant. See below about a simpler mechanism available in the compiler.

  6. The grayskull, wormhole & blackhole cpus have been renamed to tt-gs, tt-wh & tt-bh, which is consistent with other vendors' cpu names.

  7. The compiler defines __riscv_tt_grayskull, __riscv_tt_wormhole or __riscv_tt_blackhole #defines when one of the architecture extensions is targetted.

  8. A number of assembler & disassembler bugs have been fixed.

The simplest way to drive the compiler is to specify a cpu, e.g. -mcpu=tt-bh, rather than the previously-required combination of -march=rv32iml -mblackhole -mtune=rvtt-b1.