# RV-Sim **Repository Path**: Cation_git/rv-sim ## Basic Information - **Project Name**: RV-Sim - **Description**: 用C语言程序模拟一个RISC-V内核的芯片,并能够正确的运行由RV32编译出的bin文件 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-19 - **Last Updated**: 2025-08-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # RV-Sim - RISC-V Instruction Set Simulator ## Introduction `RV-Sim` is an instruction simulator based on the RISC-V RV32I instruction set, written in C. It aims to help developers understand the low-level operation of the RISC-V architecture. The project also includes auxiliary scripts and test programs to facilitate quick setup and functionality verification. ## Project Structure - `RV-Sim.c` - Core simulator code, including CPU structure definitions and instruction execution logic. - `RV-Sim.exe` - Executable file for the Windows platform (generated after compilation). - `test_program.c` - A simple test program used to verify the simulator. - `test_program.bin` - Compiled binary file of the test program. - `isp.py` - Python script, possibly used for programming the program or interacting with the simulator. - `RISC-V-RV32I.xlsx` - May contain instruction set documentation or register configuration details. ## Features - Supports simulation of the RV32I base instruction set. - Provides functionality to view register and memory states. - Supports loading and executing programs from binary files. - Cross-platform support (can run on different systems by compiling the source code). ## Usage ### Compile the Simulator Ensure that a C compiler (such as GCC) is installed, then run the following command: ```bash gcc -o RV-Sim RV-Sim.c ``` ### Run the Test Program 1. Compile the test program (if necessary): ```bash gcc -o test_program.bin test_program.c ``` 2. Run the simulator and load the test program: ```bash ./RV-Sim test_program.bin ``` ### Use the Python Script If `isp.py` is used for programming or interaction, refer to its internal comments or run the help command: ```bash python isp.py --help ``` ## Notes - The file `RISC-V-RV32I.xlsx` may contain important instruction set documentation. It is recommended to review it to understand which instructions are supported by the simulator. - `RV-Sim.exe` is a Windows executable file and is only compatible with the Windows platform. ## Contributing Feel free to open Issues and submit Pull Requests. Please ensure that your code style matches the existing codebase and provide clear commit messages. ## License This project is licensed under the MIT License. Please refer to the `LICENSE` file for more details. --- For further assistance, please consult the project Wiki or contact the project maintainers.