This document is a quick guide for people who want to work on this repo (core RTL, sim, drivers, or docs).
It's a summary of existing practices from AGENTS.md and the docs.
# Install dependencies (Ubuntu/Debian)
sudo apt-get install verilator libsdl2-dev libsdl2-ttf-dev build-essential cmake python3
# Run full development cycle
./scripts/hydra_dev_loop.sh
# Or step by step:
make sim # Build Verilator sim
make test # Run frame regression test
make sdk-setup # Build SDK tools
# See available targets:
make helpFor detailed instructions, continue reading below.
On a Debian/Ubuntu-like system:
sudo apt-get update
sudo apt-get install -y \
verilator libsdl2-dev libsdl2-ttf-dev build-essential cmake ninja-build python3Optional (for RTL benches and cocotb experiments):
sudo apt-get install -y iverilogFrom the repo root:
./scripts/hydra_dev_loop.shThis will:
- Build the Verilator+SDL sim and run the frame regression (
make -C sim test_frame). - Build the SDK tools (libhydra, blitter smoketest, DMA+blit demo).
- Optionally run RTL benches (if
iverilog/vvpare installed). - Optionally run the QEMU PCI stub smoke test if you have QEMU + a prepared guest image configured.
Re-run this script after making changes to ensure you haven’t broken the basic flows.
- RTL changes: touch files under
rtl/and rebuild via./scripts/hydra_dev_loop.shormake -C sim. - Sim harness/backends: touch
sim/(C++ SDL/GL/Vulkan/etc.) and rerun the sim (cd sim && ./sim_voxel). - Drivers/libhydra: touch
drivers/and rebuild SDK via./scripts/setup_sdk.sh(or the dev loop). - Docs: update
docs/*.mdand, if relevant, the release notes.
Some useful targeted commands:
- Visual regression only:
make -C sim test_frame
- SDK + userspace tools only:
./scripts/setup_sdk.sh
- RTL benches (if iverilog/vvp installed):
chmod +x sim/tests/run_rtl_tests.sh sim/tests/run_rtl_tests.sh
- QEMU PCI stub smoke (requires a QEMU build with
hydra-pciand a prepared guest image):QEMU_BIN=qemu-system-x86_64 HYDRA_QEMU_GUEST_IMG=/path/to/guest.qcow2 \ sim/tests/qemu_stub/qemu_hydra_smoke.sh
- C++ (sim and tools):
- 4-space indents, snake_case locals, minimal globals.
- Order includes: standard library, then third-party, then project headers.
- Favor small helpers over macros in SDL/Verilator setup code.
- SystemVerilog (RTL):
- Snake_case for signals/modules, with logical prefixes (e.g.,
cam_,cfg_,sel_,dbg_). - Keep combinational and sequential blocks separate; add light comments where behavior is subtle.
- Snake_case for signals/modules, with logical prefixes (e.g.,
- Keep diffs tight; avoid reformatting unrelated code.
rtl/– core voxel framebuffer and shell RTL. Top isvoxel_framebuffer_top.sv.sim/– Verilator+SDL viewer and platform backends; main issim/viewer.cpp.drivers/– Linux/FreeBSD/Windows/macOS driver stubs anddrivers/libhydrauserspace helper lib.scripts/– helper tools (frame diffing, SDK build, QEMU smoke, etc.).docs/– spec, driver integration, platform backends, hardware test plan, release plans.
- Keep PRs focused; short, imperative commit messages (e.g.,
Clamp camera bounds,Wire RTL benches into CI). - Describe what changed, how you validated it (commands you ran), and any new dependencies.
- Link related issues and mention known limitations or TODOs you deferred.
For more detailed project notes, see AGENTS.md, docs/component_status.md, and docs/hardware_test_plan.md.