Skip to main content

Project Initialization

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

OptionDescriptionDefault
--nameProject Namemy_fpga_project
--templateTemplate to scaffold from (empty, edge_counter, counter, axi, zynq_spi, uart_loopback, polarfire, polarfire_soc_disco, polarfire_soc_rea_demo)(interactive)
--vendorFPGA Vendor (xilinx, lattice, altera, microchip)xilinx
--partFPGA Part Numberxc7z020clg400-1
-yNon-interactive mode (accept defaults)False
--list-templatesList available (user-facing) templates and exit—
--all / --internalWith --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), run rr workspace repair rather than rr init.

Available Templates

TemplateDescription
emptyBlank scaffold: project.yml + empty hw/ tree (used by rr intro)
edge_counterMinimal: 1 SDK unit (edge_counter), 1 cocotb test
counterIntermediate: fifo_xpm_sync with XPM dependency
axiProtocol: AXI-Lite BFM verification with TbEnv
zynq_spiIntermediate: SPI sensor + UART debug on Zynq-7020
uart_loopbackUART RX/TX loopback with a self-checking cocotb test
polarfireMicrochip PolarFire target scaffold (Libero/SmartHLS flow)
polarfire_soc_discoFabric-only hello-world for Microchip PolarFire SoC Discovery Kit
polarfire_soc_rea_demoOn-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).