# 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 Given the information available, it appears that the repository contains a mix of C, Python, and possibly other resource files. The primary components include an RISC-V simulator written in C (`RV-Sim.c`), a Python script (`isp.py`), and supporting files such as a test program in binary and C form (`test_program.bin`, `test_program.c`). There is also an Excel file (`RISC-V-RV32I.xlsx`) which may contain documentation or configuration details. Since no detailed code content could be retrieved, the README will be generated based on the filenames and typical structures observed. --- # RV-Sim - RISC-V Instruction Set Simulator ## 简介 `RV-Sim` 是一个基于 RISC-V RV32I 指令集的指令模拟器,使用 C 语言编写,旨在帮助开发者理解 RISC-V 架构的底层运行机制。该项目还包含辅助脚本和测试程序,便于快速上手和验证功能。 ## 项目结构 - `RV-Sim.c` - 模拟器核心代码,包含 CPU 结构体定义、指令执行逻辑等。 - `RV-Sim.exe` - Windows 平台下的可执行文件(编译后生成)。 - `test_program.c` - 用于测试模拟器的简单测试程序。 - `test_program.bin` - 编译后的测试程序二进制文件。 - `isp.py` - Python 脚本,可能用于烧录程序或与模拟器交互。 - `RISC-V-RV32I.xlsx` - 可能包含指令集说明或寄存器配置信息。 ## 功能特性 - 支持 RV32I 基础指令集模拟。 - 提供寄存器和内存状态查看功能。 - 支持从二进制文件加载程序并执行。 - 跨平台支持(通过编译源码可在不同系统上运行)。 ## 使用方法 ### 编译模拟器 确保已安装 C 编译器(如 GCC),然后执行以下命令: ```bash gcc -o RV-Sim RV-Sim.c ``` ### 运行测试程序 1. 编译测试程序(如需要): ```bash gcc -o test_program.bin test_program.c ``` 2. 运行模拟器并加载测试程序: ```bash ./RV-Sim test_program.bin ``` ### 使用 Python 脚本 如果 `isp.py` 用于程序烧录或交互,请参考其内部注释或执行帮助信息: ```bash python isp.py --help ``` ## 注意事项 - `RISC-V-RV32I.xlsx` 文件可能包含关键的指令集文档,建议查看以理解模拟器支持的指令。 - `RV-Sim.exe` 是 Windows 可执行文件,仅适用于 Windows 平台。 ## 贡献指南 欢迎提交 Issue 和 Pull Request。请确保代码风格与现有代码保持一致,并提供清晰的提交信息。 ## 许可证 本项目采用 MIT License,请参阅 `LICENSE` 文件获取详细信息。 --- 如需进一步帮助,请查看项目 Wiki 或联系项目维护者。