From f118d5f2d136627b6a1809da0abd6eaa6f285b82 Mon Sep 17 00:00:00 2001 From: Clo91eaf Date: Fri, 10 May 2024 12:34:05 +0800 Subject: [PATCH] [doc] update readme --- README.md | 31 +++++++++++++++++++++++++++---- src/emulator.rs | 3 ++- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8476c1a..da7d0ea 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,15 @@ To install HEMU, you will need to have Rust installed on your machine. You can d Once Rust is installed, you can clone the HEMU repository from Github: +```sh +git clone --recurse-submodules https://github.com/Clo91eaf/hemu.git +``` + +or + ```sh git clone https://github.com/Clo91eaf/hemu.git -cd hemu +git submodule update --init --recursive ``` ### Runing @@ -32,7 +38,23 @@ cargo run -- -k Where `` is the path to the binary file that you want to run. For example: ```sh -cargo run -- -k ./resources/am-tests/add-riscv64-nemu.bin +cargo run -- -k ./dependencies/tests/bin/am-tests/add +``` + +#### Difftest + +if you want to run difftest, you can use the following command: + +```sh +cargo run -- -k ./dependencies/tests/bin/am-tests/add --diff +``` + +#### Difftest With Tui + +if you want to run difftest with TUI, you can use the following command: + +```sh +cargo run -- -k ./dependencies/tests/bin/am-tests/add --diff --tui ``` #### Run opensbi @@ -85,10 +107,11 @@ There are several potential benefits to using Rust to rewrite Nemus's logic: - [x] Pass am-tests - [x] RISCV64IMAZicsr instruction set architecture - [x] Pass riscv-tests -- [ ] Support for opensbi +- [x] Support for opensbi +- [x] Add TUI for debugging - [ ] Support for Linux -- [ ] Add TUI for debugging +- [ ] LA32 instruction set architecture - [ ] MIPS32 instruction set architecture - [ ] Added support for peripherals. - [ ] Added interrupt handling mechanisms. diff --git a/src/emulator.rs b/src/emulator.rs index 4ea2861..39b5db9 100644 --- a/src/emulator.rs +++ b/src/emulator.rs @@ -6,7 +6,7 @@ use tracing::{error, info, trace}; use crate::cpu::Cpu; use crate::dut::Dut; use crate::exception::Trap; -use crate::tui::{UI, Tui}; +use crate::tui::{Tui, UI}; use crossterm::event::{self, Event, KeyCode, KeyEvent, KeyEventKind}; use ratatui::{ prelude::*, @@ -213,6 +213,7 @@ impl Emulator { Ok(()) } + /// Start executing the emulator without difftest. pub fn start(&mut self) { loop { let pc = self.cpu.pc;