From 3669d8a02d26d9d8d251bb578b03e154e7ad0b34 Mon Sep 17 00:00:00 2001 From: Benjamin Kyd Date: Mon, 22 May 2023 19:52:12 +0100 Subject: [PATCH] test --- src/main.rs | 21 +++++++++++---------- test/test | Bin 0 -> 5032 bytes test/test.bin | Bin 0 -> 16 bytes test/test.s | 22 ++++++++++++++++++++++ 4 files changed, 33 insertions(+), 10 deletions(-) create mode 100755 test/test create mode 100755 test/test.bin create mode 100644 test/test.s diff --git a/src/main.rs b/src/main.rs index 44c72ca..c8b2e5d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ -use std::io::Read; -use std::io::BufReader; use std::fs::File; +use std::io::BufReader; +use std::io::Read; const XLEN: usize = 32; @@ -40,13 +40,13 @@ impl Default for Bus { } struct Instruction { - opcode: u8, - rd: u8, - rs1: u8, - rs2: u8, - funct3: u8, - funct7: u8, - imm: u32, + opcode: Byte, + rd: Byte, + rs1: Byte, + rs2: Byte, + funct3: Byte, + funct7: Byte, + imm: Word, } struct VMRV32I { @@ -98,6 +98,7 @@ fn main() { println!("VM Starting Up"); let mut cpu = VMRV32I::new(); - cpu.load_prog("test.bin"); + cpu.load_prog("./test/test.bin"); cpu.init_cpu(); } + diff --git a/test/test b/test/test new file mode 100755 index 0000000000000000000000000000000000000000..46c25ad3529ece157aa820c9f45d9d7a7446ff92 GIT binary patch literal 5032 zcmeHLJ5R$f5We&!kdO#4@Emw_V2Xeu#DvSsHhkSrle0K2h#PzV=V0^` z#}@)XObI60RgSY+L)5k~P_d7?7DWNH09O)oiR%EL=CbH4z?1x|6#O9tH&bvs1&4N< z-gn>Vt>!>+5Q=R(jthi5+K!>y#C5D5HN7Gtty<--LaOzP%O)WhS6eMoZ`K0e@O|P_ z-J^(4)69-ebs%Q1gUa}?U8)