Contributions are welcome! This document provides guidelines for contributing to the Garuda RISC-V ML accelerator project.
- Use GitHub Issues to report bugs or request features
- Provide a clear description of the issue or feature request
- For bugs, include steps to reproduce and expected vs actual behavior
- For RTL issues, include testbench code that demonstrates the problem
-
Clone the repository:
git clone https://github.com/certainly-param/garuda-accelerator.git cd garuda-accelerator git submodule update --init --recursive -
Install dependencies:
- Icarus Verilog (for basic simulations)
- Ubuntu/Debian:
sudo apt-get install iverilog - macOS:
brew install icarus-verilog
- Ubuntu/Debian:
- Verilator (for advanced verification)
- Ubuntu/Debian:
sudo apt-get install verilator
- Ubuntu/Debian:
- Yosys (for synthesis)
- Ubuntu/Debian:
sudo apt-get install yosys
- Ubuntu/Debian:
- Python 3.7+ (for scripts and Cocotb tests)
- Make (for build automation)
- Icarus Verilog (for basic simulations)
-
Verify setup:
# Run a quick test iverilog -g2012 -o sim_test.vvp garuda/tb/tb_register_rename_table.sv garuda/rtl/register_rename_table.sv vvp sim_test.vvp
- SystemVerilog: Follow SystemVerilog 2012 standard
- Naming conventions:
- Module names:
snake_case(e.g.,int8_mac_unit) - Signals:
snake_casewith suffix indicating direction (_ifor input,_ofor output,_qfor registered) - Constants:
UPPER_SNAKE_CASE
- Module names:
- Code organization: One module per file, file name matches module name
- Comments: Document all modules, parameters, and non-obvious logic
- Icarus compatibility: Code must compile with Icarus Verilog (avoid advanced SystemVerilog features not supported by Icarus)
- All new RTL modules must include a testbench
- Testbenches should be self-verifying (use
$displayor assertions) - Testbenches should run with Icarus Verilog:
iverilog -g2012 - Add new testbenches to
ci/run_iverilog_sims.shfor CI integration
-
Fork the repository and create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Write or modify RTL modules
- Add testbenches for new functionality
- Update documentation as needed
-
Test your changes:
# Run all simulations bash ci/run_iverilog_sims.sh -
Commit with clear messages:
git commit -m "Add feature: brief description" -
Push and create a Pull Request:
- Ensure CI passes (all testbenches run successfully)
- Describe your changes in the PR description
- Reference any related issues
- Performance optimizations
- Area/power reductions
- New instruction implementations
- Bug fixes
- Additional testbenches
- Coverage improvements
- Integration tests
- Formal verification
- Code comments and module documentation
- Architecture diagrams
- Tutorial examples
- Use case documentation
- Compiler support for custom instructions
- Benchmark suites
- Performance analysis tools
- FPGA/ASIC synthesis scripts
- Timing closure improvements
- Area optimizations
garuda-accelerator/
├── garuda/
│ ├── rtl/ # RTL source files
│ ├── tb/ # Testbenches
│ ├── dv/ # Cocotb verification
│ └── synth/ # Synthesis scripts
├── integration/ # CVA6 integration
│ ├── system_top.sv # System integration
│ └── Makefile.commercial # Multi-simulator build
├── ci/ # CI helper scripts
└── .github/ # GitHub Actions workflows
- All PRs require review before merging
- Reviewers will check:
- Code quality and adherence to standards
- Test coverage
- Documentation completeness
- CI test results
Before submitting a PR, ensure:
-
All testbenches pass:
bash ci/run_iverilog_sims.sh
-
Verilator tests pass (if applicable):
bash ci/run_verilator_sims.sh
-
Cocotb tests pass (if applicable):
cd garuda/dv make -
CI passes: GitHub Actions will automatically run all tests
By contributing, you agree that your contributions will be licensed under the Apache License 2.0, the same license as the project.
- Open a GitHub Issue for questions
- Check existing issues and discussions
- Review the main README.md for project overview
Thank you for contributing to Garuda!