From b7c0f39aaafc1cbc65491920ac7ccfc2e9117146 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Mon, 19 Apr 2021 09:48:31 +0200 Subject: [PATCH] added documentation for RV32M --- docs/CPU.md | 0 docs/assembly.md | 27 ++++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) delete mode 100644 docs/CPU.md diff --git a/docs/CPU.md b/docs/CPU.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/assembly.md b/docs/assembly.md index 5e14806..0a10f57 100644 --- a/docs/assembly.md +++ b/docs/assembly.md @@ -3,18 +3,22 @@ Assembly tokenization should be working completely. It knows what instructions the CPU implementation supports and parses based on them. -## Instructions - * all loads/stores: `lb, lh, lw, lbu, lhu, sw, sh, sb` +## Instruction sets: +* RV32I + * all loads/stores: `lb, lh, lw, lbu, lhu, sw, sh, sb` * supported arg format is either `rd, imm(reg)` or `rd, reg, imm` - * all branch statements: `beq, bne, blt, bge, bltu, bgeu` - * all jumps `j, jal, jalr, ret` - * basic arithmetic: `add, addi, sub` (not `lui, auipc`) - * shifts: `sll, slli, srl, srli, sra, srai` - * `scall, ecall, sbreak, ebreak` (both `s` and `e` version are the same instruction) - * compares (non immediate): `slt, sltu` (not `slti, sltiu`) - * logical (non immediate): `and, or, xor` (not `andi, ori, xori`) - -All unimplemented instructions can be added quite easily + * all branch statements: `beq, bne, blt, bge, bltu, bgeu` + * all jumps `j, jal, jalr, ret` + * basic arithmetic: `add, addi, sub, lui, auipc`) + * shifts: `sll, slli, srl, srli, sra, srai` + * `scall, ecall, sbreak, ebreak` (both `s` and `e` version are the same instruction) + * compares (non immediate): `slt, sltu, slti, sltiu`) + * logical (non immediate): `and, or, xor, andi, ori, xori` + * Not implemented: `fence, fence.i, rdcycle, rdcycleh, rdtime, rdtimeh, rdinstret, rdinstreth` +* RV32M + * Multiplication: `mul, mulh`, not implemented yet are `mulhsu, mulhu` + * Division: `div, divu, rem, remu` + ## Pseudo-ops @@ -25,6 +29,7 @@ The following pseudo-ops are implemented as of yet: * `.section .` same as `.`, see sections * `.set , ` to create a const symbol with a given value * `.global ` mark symbol `` as a global symbol. It is available from all loaded programs +* `.align ` currently a nop as cpu does not care about alignment as of now ## Sections: Currently only these three sections are supported: