Project Initialization Guide
The rr init command is the standard entry point for creating new FPGA projects
with the RouteRTL SDK. It enforces a consistent directory structure, sets up the
build system, and configures pre-commit hooks.
Quick Start
python3 -m venv .venv
source .venv/bin/activate
pip install routertl
rr init --template empty --name my_project -y
# or start from a working example:
rr init --template edge_counter --name my_project -y
Usage
rr init [OPTIONS]
Options
| Option | Description | Default |
|---|---|---|
--name | Project Name | my_fpga_project |
--template | Template to scaffold from (empty, edge_counter, counter, axi, zynq_spi, uart_loopback, polarfire, polarfire_soc_disco, polarfire_soc_rea_demo) | (interactive) |
--vendor | FPGA Vendor (xilinx, lattice, altera, microchip) | xilinx |
--part | FPGA Part Number | xc7z020clg400-1 |
-y | Non-interactive mode (accept defaults) | False |
--list-templates | List available (user-facing) templates and exit | — |
--all / --internal | With --list-templates, also show internal/repro fixtures | — |
If no arguments are provided, the script runs in interactive mode, prompting for all necessary configuration.
To repair an existing or broken project (regenerate
build_env.mk, patch Makefile include paths, or re-resolve dependencies), runrr workspace repairrather thanrr init.
Available Templates
| Template | Description |
|---|---|
empty | Blank scaffold: project.yml + empty hw/ tree (used by rr intro) |
edge_counter | Minimal: 1 SDK unit (edge_counter), 1 cocotb test |
counter | Intermediate: fifo_xpm_sync with XPM dependency |
axi | Protocol: AXI-Lite BFM verification with TbEnv |
zynq_spi | Intermediate: SPI sensor + UART debug on Zynq-7020 |
uart_loopback | UART RX/TX loopback with a self-checking cocotb test |
polarfire | Microchip PolarFire target scaffold (Libero/SmartHLS flow) |
polarfire_soc_disco | Fabric-only hello-world for Microchip PolarFire SoC Discovery Kit |
polarfire_soc_rea_demo | On-silicon REA capture via embedded FlashPro5 for PolarFire SoC Discovery Kit |
A template may declare that its HDL was LLM-emitted via an optional
template.yml sidecar at the template root; rr init then stamps
AI-provenance headers on the scaffolded VHDL. The manifest itself is never
copied into the project. Template authors: see "Authoring a template" in
examples/README.md. Internal regression fixtures set
visibility: internal in the same sidecar and stay out of the default list.
Generated Structure
The command creates the following file organization:
project_root/ ├── project.yml # Main configuration file (single source of truth) ├── Makefile # Build system entry point ├── VERSION # Semantic version tracking ├── .gitignore # Standard git ignore rules ├── src/ │ ├── pkg/ # VHDL/SV Packages │ └── units/ # RTL Units ├── sim/ │ └── cocotb/tests/ # Cocotb testbenches ├── xdc/ # Constraints └── verif/ # Verification artifacts
Next Steps
After initialization, you can immediately run:
rr doctor— Verify your environment and tools.rr lint— Smart hierarchical linting.rr sim— Discover and run tests (interactive selection).rr sim run --all— Run all tests.rr synth— Synthesize with configured vendor.rr workspace repair— Auto-fix common workspace issues (regenerate build_env.mk, Makefile paths, dependencies).