X Tutup
Skip to content

IIITM-Jay/opval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

OpVal: A Metadata-Based Validation Framework for RISC-V Opcodes and Traces

...An upcoming open tool for validating, tracing, and debugging RISC-V opcode specifications with CI support. The project is currently in its initial phase of research and exploration, focusing on understanding existing tools and frameworks, studying historical efforts, and identifying gaps to address.


🧱 Foundational Work & Upstream Contributions

This project builds on significant prior work and contributions that I have made to the riscv-opcodes repository, which forms the foundational groundwork for OpVal.

🔧 Contributions include:

  • Refactored and optimized parser logic for opcode ingestion.
  • Introduced shared utilities and YAML artifact-generation scripts.
  • Enhanced the CI/CD pipeline for faster, more reliable builds.
  • Reduced lines of code (LOC) to improve readability and maintainability.
  • Optimized the Makefile for streamlined execution and testing.
  • Reviewed, fixed, and merged PRs from the wider community.
  • Provided best-practice recommendations for structure and maintainability.
  • Resolved a multi-extension dependency bug by relocating hinval.vvma and hinval.gvma to rv_svinval_h, ensuring instruction legality when both Svinval and H extensions are used. Also fixed a related parser error affecting output generation.

📌 Notable Pull Requests & Commits:

These contributions reflect a deep engagement with the RISC-V ecosystem and directly inform the design of OpVal.


Overview

As RISC-V adoption increases globally—especially within European initiatives like EPI, CHIPS JU, and RISE—ensuring correctness and trust in custom opcodes, ISA extensions, and trace encodings is critical. OpVal addresses the lack of early validation tooling in the open-source chip toolchain by providing:

  • A metadata-based validation engine for opcode definitions.
  • Trace log analyzers for verifying architectural correctness.
  • CI-friendly integration through command-line tools and GitHub Actions.

OpVal aims to improve developer confidence, reduce ISA-level bugs, and speed up RISC-V processor design and verification pipelines in both academia and industry.

Key Features

  • Validate RISC-V opcode encodings (bit overlap, value fit, syntax correctness)
  • Detect argument mismatches in opcode metadata vs. argument lookup tables
  • Check representability of constants based on encoding width
  • Validate trace logs against expected execution patterns (planned)
  • Command-line and CI (GitHub Actions) support
  • Modular design to support custom instruction extensions

Why OpVal?

Current RISC-V tools such as riscv-opcodes, spike, and simulators focus on instruction decoding and execution, but lack formal, early-stage validation of opcode metadata and trace analysis. OpVal fills this gap by:

  • Offering standalone validation outside simulation
  • Enabling detection of design-time encoding conflicts
  • Supporting continuous integration for ISA development workflows

Project Roadmap

Project status and details for Phase0 - Research & Exploartion

Phase Focus Area Key Deliverables
Phase 0: Exploration & Research Landscape review & gap analysis Study existing tools (e.g., riscv-opcodes, spike, Sail), identify missing validation layers, define test cases
Phase 1: Foundations Project setup & metadata parser Initialize repository, parse RISC-V YAML opcode metadata, set up base infrastructure
Phase 2: Core Validation Encoding validation engine Implement bitfield overlap detection, field width checks, value representability, basic structural errors
Phase 3: Argument Checks Argument-table and semantics checks Validate mapping correctness, missing argument keys, malformed entries
Phase 4: Trace Analysis Trace format support & analysis tools Design trace log parser, compare trace semantics with defined encodings
Phase 5: CI Integration GitHub Actions & CLI utility Add command-line interface, GitHub Action integration, improve UX and error messaging
Phase 6: Public Release Documentation, examples & outreach Provide documentation, usage examples, package v1.0 release, outreach for adoption

Use Cases

  1. Validate opcode additions to riscv-opcodes or other YAML-based metadata repos
  2. Trace log checking for debugging and conformance validation
  3. Use in academic labs for teaching/custom ISA exploration
  4. Support for custom extensions in open hardware startups
  5. CI integration to enforce correctness in collaborative development

Getting Started

Note: Installation instructions will be updated after the initial release.

Prerequisites

  • Python 3.9+ (as earlier versions are depreacted. See more about python versions here
  • pyyaml, click (CLI framework), and optional dependencies for trace checking

Install

git clone https://github.com/IIITM-Jay/opval
cd opval
pip install -e .

About

An open source validation and trace analysis toolchain for RISC-V opcode definitions and encodings, designed to catch bit-level errors, ensure argument consistency, and support early error detection and CI integration for developers, researchers, and chip designers working on custom ISA extensions and hardware-software co-design.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

X Tutup