Skip to content

Add unified core configuration generator with CLI and GUI interfaces#27

Merged
helium729 merged 4 commits intomainfrom
copilot/fix-26
Jun 16, 2025
Merged

Add unified core configuration generator with CLI and GUI interfaces#27
helium729 merged 4 commits intomainfrom
copilot/fix-26

Conversation

Copy link
Contributor

Copilot AI commented Jun 15, 2025

This PR implements a comprehensive configuration generator tool for the VIGNA RISC-V processor, addressing the need for a unified way to generate processor configurations with desired features.

🚀 Features Added

Configuration Generator Tool (tools/vigna_config_generator.py)

  • CLI Interface: Full command-line interface with comprehensive options
  • GUI Interface: Cross-platform tkinter-based graphical interface
  • Configuration Parsing: Parse and modify existing .vh configuration files
  • Validation: Automatic dependency checking and conflict resolution
  • Predefined Configurations: Support for all 7 standard RISC-V variants

Supported Configurations

Configuration Extensions Description
rv32i Base Minimal RISC-V base configuration
rv32e E Embedded configuration (16 registers)
rv32im I + M Base + Multiply/Divide extension
rv32ic I + C Base + Compressed instructions
rv32imc I + M + C Base + Multiply/Divide + Compressed
rv32im_zicsr I + M + Zicsr Base + Multiply/Divide + CSR
rv32imc_zicsr I + M + C + Zicsr Full featured configuration

🛠️ Usage Examples

CLI Interface

# List all predefined configurations
python3 tools/vigna_config_generator.py --list

# Generate RV32IMC configuration
python3 tools/vigna_config_generator.py --config rv32imc --output vigna_conf.vh

# Custom configuration with specific features
python3 tools/vigna_config_generator.py --config rv32i --enable-m-extension --enable-c-extension --output custom.vh

# Parse existing config and modify
python3 tools/vigna_config_generator.py --parse vigna_conf.vh --enable-interrupt --output updated.vh

# Validate configuration
python3 tools/vigna_config_generator.py --enable-m-extension --validate

GUI Interface

# Launch cross-platform GUI
python3 tools/vigna_config_generator.py --gui

🔧 Technical Details

Configuration Features Supported

  • RISC-V Extensions: M (multiply/divide), C (compressed), E (embedded), Zicsr (CSR)
  • Performance Options: Two-stage shift, preload negative, alignment checks
  • Memory Configuration: Reset addresses, stack pointer initialization
  • Bus Architecture: Unified vs separate instruction/data buses, AXI4-Lite support
  • Interrupt Support: Machine-level interrupts with CSR integration

Validation & Safety

  • Dependency checking (e.g., m_fpga_fast requires m_extension)
  • Conflict resolution between incompatible options
  • Comprehensive error reporting with actionable messages

🧪 Testing

Added comprehensive test suite (tests/test_config_generator.py):

  • ✅ All predefined configurations generate successfully
  • ✅ All existing configuration files parse correctly
  • ✅ CLI interface functionality verified
  • ✅ Configuration validation works properly
  • ✅ 100% test pass rate

📚 Documentation Updates

Updated README.md with:

  • Complete usage examples for both CLI and GUI
  • Configuration table showing all supported variants
  • Feature descriptions and integration instructions
  • Quick start guide for the new tool

🔄 Backward Compatibility

  • Maintains full compatibility with existing configuration system
  • Uses same .vh file format and define directives
  • Works with existing Makefile and build targets
  • Manual configuration editing still supported

🌐 Cross-Platform Support

  • Pure Python 3 implementation
  • Uses standard tkinter (no external dependencies)
  • Works on Windows, macOS, and Linux
  • Easy deployment and installation

Fixes #26.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 3 commits June 15, 2025 16:44
Co-authored-by: helium729 <30749877+helium729@users.noreply.github.com>
Co-authored-by: helium729 <30749877+helium729@users.noreply.github.com>
Co-authored-by: helium729 <30749877+helium729@users.noreply.github.com>
Copilot AI changed the title [WIP] General core generator Add unified core configuration generator with CLI and GUI interfaces Jun 15, 2025
Copilot AI requested a review from helium729 June 15, 2025 16:48
@helium729 helium729 marked this pull request as ready for review June 16, 2025 03:38
Copilot AI review requested due to automatic review settings June 16, 2025 03:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a unified core configuration generator tool with both CLI and GUI interfaces for the VIGNA RISC-V processor, enabling streamlined generation, parsing, and validation of core configurations. Key changes include:

  • Implementation of the configuration generator tool (CLI and GUI) in tools/vigna_config_generator.py.
  • A comprehensive test suite in tests/test_config_generator.py for generating, parsing, and validating configurations.
  • Updated documentation in README.md outlining usage examples, directory structure, and feature support.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
tests/test_config_generator.py New tests covering predefined configurations, parsing, CLI, and validation functionality.
README.md Updated documentation with usage examples, interface instructions, and project layout revisions.
Comments suppressed due to low confidence (1)

README.md:103

  • Ensure that the updated directory structure in the README matches the actual project layout and that each tool (e.g., bin_to_verilog_mem.py) is briefly described for clarity.
├── tools/                   # 🛠️ Utility scripts

with open(temp_file, 'r') as f:
content = f.read()

if '`ifndef VIGNA_CONF_VH' not in content:
Copy link

Copilot AI Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify that the expected header check in the generated configuration file is correctly specified. If the intended header is '#ifndef VIGNA_CONF_VH', update the check to match it exactly.

Suggested change
if '`ifndef VIGNA_CONF_VH' not in content:
if '#ifndef VIGNA_CONF_VH' not in content:

Copilot uses AI. Check for mistakes.
@helium729 helium729 merged commit afae737 into main Jun 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

General core generator

2 participants