target/riscv: tt-ascalon: Add Tenstorrent mvendorid
PATCH 1/1 target/riscv: tt-ascalon: Add Tenstorrent mvendorid
JEP106 has two vendor IDs for Tenstorrent. We will use Bank 16, hex 0xa1:
((16 - 1) << 7) | (0xa1 & ~0x80) = 0x7a1
Add it to the Ascalon CPU definition as the mvendorid CSR.
---
This stands alone from the atlantis series and can go in asap.
target/riscv/cpu_vendorid.h | 2 ++ target/riscv/cpu.c | 2 ++ 2 files changed, 4 insertions(+)
target/riscv/cpu_vendorid.h +2 -0
@@ -8,4 +8,6 @@#define VEYRON_V1_MIMPID 0x111#define VEYRON_V1_MVENDORID 0x61f +#define TENSTORRENT_VENDOR_ID 0x7a1 +#endif /* TARGET_RISCV_CPU_VENDORID_H */
target/riscv/cpu.c +2 -0
@@ -3190,6 +3190,8 @@ static const TypeInfo riscv_cpu_type_infos[] = { .cfg.ext_svnapot = true, .cfg.ext_svpbmt = true, + .cfg.mvendorid = TENSTORRENT_VENDOR_ID, + .cfg.max_satp_mode = VM_1_10_SV57, ),
Signature · 1 line
2.47.3
Quoted 8 lines · Joel Stanley
JEP106 has two vendor IDs for Tenstorrent. We will use Bank 16, hex
0xa1:((16 - 1) << 7) | (
0xa1& ~0x80) =0x7a1Add it to the Ascalon CPU definition as the mvendorid CSR.
Signed-off-by Joel Stanley <[email protected]>---
Quoted 30 lines
This stands alone from the atlantis series and can go in asap.
target/riscv/cpu_vendorid.h | 2 ++ target/riscv/cpu.c | 2 ++ 2 files changed, 4 insertions(+)target/riscv/cpu_vendorid.h +2
-0@@ -8,4 +8,6 @@#define VEYRON_V1_MIMPID 0x111#define VEYRON_V1_MVENDORID 0x61f +#define TENSTORRENT_VENDOR_ID 0x7a1 +#endif /* TARGET_RISCV_CPU_VENDORID_H */ target/riscv/cpu.c +2
-0@@ -3190,6 +3190,8 @@ static const TypeInfo riscv_cpu_type_infos[] = { .cfg.ext_svnapot = true, .cfg.ext_svpbmt = true, + .cfg.mvendorid = TENSTORRENT_VENDOR_ID, + .cfg.max_satp_mode = VM_1_10_SV57, ),
Quoted 4 lines · Joel Stanley
JEP106 has two vendor IDs for Tenstorrent. We will use Bank 16, hex
0xa1:((16 - 1) << 7) | (
0xa1& ~0x80) =0x7a1
The value LGTM, it matches JEP106BM, and matches the Tenstorrent documentation I have.
I would probably say that it's company 33. Which is 0xa1 with the parity bit added, but the parity bit isn't used in the calculation, ie:
((16 - 1) << 7) | 33 = 0x7a1
Mentioning that it's company 33 (0x21) would make it a little easier to match it up with other public sources, eg openocd:
Quoted 3 lines
Add it to the Ascalon CPU definition as the mvendorid CSR.
Signed-off-by Joel Stanley <[email protected]>
cheers
Quoted 27 lines
target/riscv/cpu_vendorid.h +2
-0@@ -8,4 +8,6 @@#define VEYRON_V1_MIMPID 0x111#define VEYRON_V1_MVENDORID 0x61f +#define TENSTORRENT_VENDOR_ID 0x7a1 +#endif /* TARGET_RISCV_CPU_VENDORID_H */ target/riscv/cpu.c +2
-1@@ -3190,6 +3190,8 @@ static const TypeInfo riscv_cpu_type_infos[] = { .cfg.ext_svnapot = true, .cfg.ext_svpbmt = true, + .cfg.mvendorid = TENSTORRENT_VENDOR_ID, + .cfg.max_satp_mode = VM_1_10_SV57, ), --2.47.3