MCPcopy Index your code
hub / github.com/chipsalliance/riscv-dv

github.com/chipsalliance/riscv-dv @v0.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.8 ↗ · + Follow
598 symbols 1,367 edges 39 files 102 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Overview

RISCV-DV is a SV/UVM based open-source instruction generator for RISC-V processor verification. It currently supports the following features:

  • Supported instruction set: RV32IMAFDC, RV64IMAFDC
  • Supported privileged mode: machine mode, supervisor mode, user mode
  • Page table randomization and exception
  • Privileged CSR setup randomization
  • Privileged CSR test suite
  • Trap/interrupt handling
  • Test suite to stress test MMU
  • Sub-program generation and random program calls
  • Illegal instruction and HINT instruction generation
  • Random forward/backward branch instructions
  • Supports mixing directed instructions with random instruction stream
  • Debug mode support, with fully randomized debug ROM
  • Instruction generation coverage model
  • Handshake communication with testbench
  • Support handcoded assembly test
  • Co-simulation with multiple ISS : spike, riscv-ovpsim, whisper, sail-riscv

Getting Started

Prerequisites

To be able to run the instruction generator, you need to have an RTL simulator which supports SystemVerilog and UVM 1.2. This generator has been verified with Synopsys VCS, Cadence Incisive/Xcelium, Mentor Questa, and Aldec Riviera-PRO simulators. Please make sure the EDA tool environment is properly setup before running the generator.

Install RISCV-DV

Getting the source

git clone https://github.com/google/riscv-dv.git

There are two ways that you can run scripts from riscv-dv.

For developers which may work on multiple clones in parallel, using directly run by python3 script is highly recommended. Example:

pip3 install -r requirements.txt    # install dependencies (only once)
python3 run.py --help

For normal users, using the python package is recommended. First, cd to the directory where riscv-dv is cloned and run:

export PATH=$HOME/.local/bin/:$PATH  # add ~/.local/bin to the $PATH (only once)
pip3 install --user -e .

This installs riscv-dv in a mode where any changes within the repo are immediately available simply by running run/cov. There is no need to repeatedly run pip install . after each change. Example for running:

run --help
cov --help

Use below command to install Verible, which is the tool to check Verilog style

verilog_style/build-verible.sh

This is the command to run Verilog style check. It's recommended to run and clean up all the style violations before submit a PR

verilog_style/run.sh

Document

To understand how to setup and customize the generator, please check the full document under docs directory. You can use the makefile to generate the document. HTML preview. You can find the prebuilt document under docs/build/singlehtml/index.html

External contributions and collaborations

RISC-V DV is now contributed to CHIPS Alliance. We have regular meetings to discuss the issues, feature priorities, development progress etc. Please join the mail group for latest status.

Please refer to CONTRIBUTING.md for license related questions.

Supporting model

Please file an issue under this repository for any bug report / integration issue / feature request. We are looking forward to knowing your experience of using this flow and how we can make it better together.

Disclaimer

This is not an officially supported Google product.

Core symbols most depended-on inside this repo

DEFINE_INSTR
called by 54
pygen/pygen_src/riscv_defines.py
get_imm_hex_val
called by 31
scripts/deprecated/riscv_trace_csv.py
get_gpr_state
called by 26
pygen/pygen_src/isa/riscv_cov_instr.py
run_cmd
called by 23
scripts/lib.py
get_gpr
called by 22
pygen/pygen_src/isa/riscv_cov_instr.py
get_val
called by 20
pygen/pygen_src/riscv_instr_pkg.py
get
called by 19
run.py
get_label
called by 13
pygen/pygen_src/riscv_instr_pkg.py

Shape

Method 372
Class 126
Function 100

Languages

Python100%

Modules by API surface

pygen/pygen_src/riscv_instr_cover_group.py102 symbols
pygen/pygen_src/riscv_asm_program_gen.py53 symbols
pygen/pygen_src/riscv_instr_pkg.py49 symbols
pygen/experimental/riscv_directed_instr_lib.py43 symbols
pygen/experimental/riscv_load_store_instr_lib.py36 symbols
pygen/experimental/riscv_instr_base.py31 symbols
pygen/pygen_src/isa/riscv_instr.py29 symbols
pygen/pygen_src/isa/riscv_cov_instr.py26 symbols
run.py23 symbols
pygen/pygen_src/riscv_instr_stream.py17 symbols
pygen/experimental/riscv_asm_program_gen.py17 symbols
scripts/deprecated/ovpsim_log_to_trace_csv.py15 symbols

For agents

$ claude mcp add riscv-dv \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact