omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / seed / tensix / rv32im.tbl
| 1 | ; rv32im.tbl -- the RV32IM instruction table for asm2 (rung 2, unchanged), readable text, for the |
| 2 | ; Tenstorrent "baby" RISC-V cores (Wormhole B0 and Blackhole A0 Tensix tiles: RISCV B, NC, T0, T1, T2). |
| 3 | ; Same format as rung2/table.s2: = name 0xBASE field... |
| 4 | ; Fields: iP.W = unsigned number at bit P, W bits wide; sP.W = signed (two's complement, range checked). |
| 5 | ; Registers are written as numbers 0..31 (x0 = 0, ra = 1, sp = 2, t0..t2 = 5..7, a0..a7 = 10..17, |
| 6 | ; t3..t6 = 28..31), never as asm2's ARM names (asm2 reads "xzr"/"sp" as 31, which is t6 on RISC-V). |
| 7 | ; Operand order on a listing line is the order of the fields below: |
| 8 | ; R-type name rd rs1 rs2 |
| 9 | ; I-type name rd rs1 imm (loads too: lw rd rs1 imm means rd = mem[rs1+imm]) |
| 10 | ; shifts name rd rs1 shamt |
| 11 | ; S-type name rs2 rs1 imm[11:5] imm[4:0] (signed high part, unsigned low part) |
| 12 | ; B-type name rs1 rs2 imm[12] imm[10:5] imm[4:1] imm[11] (offset in bytes, split as the word holds it) |
| 13 | ; U-type name rd imm[31:12] |
| 14 | ; J-type name rd imm[20] imm[10:1] imm[11] imm[19:12] (offset in bytes, split as the word holds it) |
| 15 | ; Every number is written as the bits hold it; asm2's labels count 32-bit words and cannot scatter |
| 16 | ; the RISC-V branch bits, so branch and jump distances are written as their pieces (README.md). |
| 17 | ; Source of every base word and field: The RISC-V Instruction Set Manual, Volume I: Unprivileged ISA, |
| 18 | ; Version 20191213, chapter 2 (RV32I base, instruction formats), chapter 7 ("M" Standard Extension) and |
| 19 | ; chapter 24 ("RV32/64G Instruction Set Listings"), https://riscv.org/technical/specifications/ ; written |
| 20 | ; from the format layout, then checked word by word by two independent disassemblers (edges.s2 below). |
| 21 | ; Tenstorrent states the baby cores implement RV32I 2.1 + M 2.0 (tt-isa-documentation |
| 22 | ; WormholeB0/TensixTile/BabyRISCV/README.md, BlackholeA0/TensixTile/BabyRISCV/InstructionSet.md, |
| 23 | ; be833101, read 2026-10-26). Referee: riscv64-unknown-elf-objdump and llvm-objdump (gate-tensix.sh). |
| 24 | ; |
| 25 | ; ---- U-type (opcode 0110111 LUI, 0010111 AUIPC) ---- |
| 26 | = lui 0x00000037 i7.5 i12.20 |
| 27 | = auipc 0x00000017 i7.5 i12.20 |
| 28 | ; ---- J-type (opcode 1101111) and JALR (I-type, opcode 1100111, funct3 000) ---- |
| 29 | = jal 0x0000006f i7.5 s31.1 i21.10 i20.1 i12.8 |
| 30 | = jalr 0x00000067 i7.5 i15.5 s20.12 |
| 31 | ; ---- B-type (opcode 1100011), funct3 at bit 12 ---- |
| 32 | = beq 0x00000063 i15.5 i20.5 s31.1 i25.6 i8.4 i7.1 |
| 33 | = bne 0x00001063 i15.5 i20.5 s31.1 i25.6 i8.4 i7.1 |
| 34 | = blt 0x00004063 i15.5 i20.5 s31.1 i25.6 i8.4 i7.1 |
| 35 | = bge 0x00005063 i15.5 i20.5 s31.1 i25.6 i8.4 i7.1 |
| 36 | = bltu 0x00006063 i15.5 i20.5 s31.1 i25.6 i8.4 i7.1 |
| 37 | = bgeu 0x00007063 i15.5 i20.5 s31.1 i25.6 i8.4 i7.1 |
| 38 | ; ---- loads (I-type, opcode 0000011) ---- |
| 39 | = lb 0x00000003 i7.5 i15.5 s20.12 |
| 40 | = lh 0x00001003 i7.5 i15.5 s20.12 |
| 41 | = lw 0x00002003 i7.5 i15.5 s20.12 |
| 42 | = lbu 0x00004003 i7.5 i15.5 s20.12 |
| 43 | = lhu 0x00005003 i7.5 i15.5 s20.12 |
| 44 | ; ---- stores (S-type, opcode 0100011) ---- |
| 45 | = sb 0x00000023 i20.5 i15.5 s25.7 i7.5 |
| 46 | = sh 0x00001023 i20.5 i15.5 s25.7 i7.5 |
| 47 | = sw 0x00002023 i20.5 i15.5 s25.7 i7.5 |
| 48 | ; ---- OP-IMM (I-type, opcode 0010011) ---- |
| 49 | = addi 0x00000013 i7.5 i15.5 s20.12 |
| 50 | = slti 0x00002013 i7.5 i15.5 s20.12 |
| 51 | = sltiu 0x00003013 i7.5 i15.5 s20.12 |
| 52 | = xori 0x00004013 i7.5 i15.5 s20.12 |
| 53 | = ori 0x00006013 i7.5 i15.5 s20.12 |
| 54 | = andi 0x00007013 i7.5 i15.5 s20.12 |
| 55 | = slli 0x00001013 i7.5 i15.5 i20.5 |
| 56 | = srli 0x00005013 i7.5 i15.5 i20.5 |
| 57 | = srai 0x40005013 i7.5 i15.5 i20.5 |
| 58 | ; ---- OP (R-type, opcode 0110011), funct7 at bit 25 ---- |
| 59 | = add 0x00000033 i7.5 i15.5 i20.5 |
| 60 | = sub 0x40000033 i7.5 i15.5 i20.5 |
| 61 | = sll 0x00001033 i7.5 i15.5 i20.5 |
| 62 | = slt 0x00002033 i7.5 i15.5 i20.5 |
| 63 | = sltu 0x00003033 i7.5 i15.5 i20.5 |
| 64 | = xor 0x00004033 i7.5 i15.5 i20.5 |
| 65 | = srl 0x00005033 i7.5 i15.5 i20.5 |
| 66 | = sra 0x40005033 i7.5 i15.5 i20.5 |
| 67 | = or 0x00006033 i7.5 i15.5 i20.5 |
| 68 | = and 0x00007033 i7.5 i15.5 i20.5 |
| 69 | ; ---- MISC-MEM and SYSTEM ---- |
| 70 | = fence 0x0000000f i24.4 i20.4 ; fence pred succ (Tenstorrent: executes as a nop on WH) |
| 71 | = ecall 0x00000073 |
| 72 | = ebreak 0x00100073 ; on the baby cores: debug pause |
| 73 | ; ---- "M" extension (R-type, opcode 0110011, funct7 0000001) ---- |
| 74 | = mul 0x02000033 i7.5 i15.5 i20.5 |
| 75 | = mulh 0x02001033 i7.5 i15.5 i20.5 |
| 76 | = mulhsu 0x02002033 i7.5 i15.5 i20.5 |
| 77 | = mulhu 0x02003033 i7.5 i15.5 i20.5 |
| 78 | = div 0x02004033 i7.5 i15.5 i20.5 |
| 79 | = divu 0x02005033 i7.5 i15.5 i20.5 |
| 80 | = rem 0x02006033 i7.5 i15.5 i20.5 |
| 81 | = remu 0x02007033 i7.5 i15.5 i20.5 |