Thank you for your interest in contributing! This project welcomes contributions from students, educators, and engineers.
- Fork the repository
- Clone your fork locally
- Create a branch for your feature
- Make changes following the coding standards below
- Test your changes in simulation
- Commit with clear messages
- Push and create a Pull Request
- M Extension: Multiply/Divide instructions
- C Extension: Compressed instructions (16-bit)
- Branch Prediction: Improve pipeline CPI
- Cache Implementation: Instruction and Data caches
- Tutorial improvements
- Video walkthroughs
- Example programs
- Additional testbenches
- Formal verification properties
- Compliance tests (riscv-tests)
| Element | Convention | Example |
|---|---|---|
| Modules | PascalCase or snake_case |
Control_Unit, hazard_unit |
| Signals | snake_case |
alu_result, pc_plus4 |
| Parameters | UPPER_CASE |
DATA_WIDTH, MEM_SIZE |
| Constants | UPPER_CASE |
OP_RTYPE, ALU_ADD |
// ============================================================================
// MODULE: Module Name
// Description: Brief description of purpose
// ============================================================================
module Module_Name #(
parameter WIDTH = 32
) (
input logic clk,
input logic reset,
input logic [WIDTH-1:0] input_signal,
output logic [WIDTH-1:0] output_signal
);
// ========================================
// Internal Signals
// ========================================
logic [WIDTH-1:0] internal_reg;
// ========================================
// Main Logic
// ========================================
always_ff @(posedge clk or posedge reset) begin
if (reset)
internal_reg <= '0;
else
internal_reg <= input_signal;
end
assign output_signal = internal_reg;
endmodule- Use
logicinstead ofwire/reg - Use
always_fffor sequential logic - Use
always_combfor combinational logic - Avoid latches (complete case/if statements)
- Add assertions where appropriate
- Comment non-obvious logic
feat: Add branch prediction unit
fix: Correct forwarding logic for load-use hazard
docs: Update pipeline walkthrough
test: Add testbench for M extension
refactor: Simplify control unit decode logic
Before submitting a PR:
-
Syntax Check: Ensure no compilation errors
iverilog -g2012 -o test *.sv
-
Simulation: Run existing testbenches
vvp test -
Lint Check (if available):
verilator --lint-only -Wall *.sv
When opening an issue, include:
- Title: Clear, descriptive summary
- Environment: OS, tool version (e.g., Vivado 2023.1)
- Description: What happened vs. what you expected
- Steps to Reproduce: Minimal example if possible
- Screenshots: Waveforms or error messages
By contributing, you agree that your contributions will be licensed under the project's MIT License.
Contributors will be acknowledged in the repository. Thank you for helping improve this educational resource!