From 8d61b9750394dde2d04e6c464ff780b5f2b79514 Mon Sep 17 00:00:00 2001 From: inixyz Date: Sat, 14 Oct 2023 14:34:52 +0300 Subject: [PATCH 1/2] tests --- test.bin | Bin 4 -> 28 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/test.bin b/test.bin index abd647727d66ff661fbba4aa2236b3a20037756d..73256dcf5396c4a17ec44d981ed2c9d90e8c2f1e 100644 GIT binary patch literal 28 kcmbQt&|oLr$WS|(vGJgA6JzsarY1Y{!)xyeGk<;u0F0>%BLDyZ literal 4 LcmWe;`0yV911|yt From 62b94902eadd8606f0f28412866f54933d474a3b Mon Sep 17 00:00:00 2001 From: inixyz Date: Sat, 14 Oct 2023 21:55:45 +0300 Subject: [PATCH 2/2] new file --- tinyriscv.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tinyriscv.h diff --git a/tinyriscv.h b/tinyriscv.h new file mode 100644 index 0000000..ece731a --- /dev/null +++ b/tinyriscv.h @@ -0,0 +1,36 @@ +#ifndef TINYRISCV_H +#define TINYRISCV_H + +#include + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; + +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; + +void tinyriscv_step(){ + + switch(opcode){ + case /*R-type*/ 0x33: + switch(func3){ + case /*ADD*/ 0x0: x[rd] = x[rs1] + x[rs2]; break; + #ifdef TINYRISCV_VERBOSE + printf("add rd, rs1, rs2\n"); + #endif + } + break; + } +} + + + + +case ADD: x[rd] = x[rs1] + x[rs2]; break; + + + + +#endif //TINYRISCV_H \ No newline at end of file