Get RHDL installed on your system. This guide covers the minimum setup needed to design, simulate, and export your first hardware circuit.
Prerequisites
- Ruby 3.1 or later
- Bundler gem for dependency management
- Git for version control
Install RHDL
gem install rhdlOr add it to your project’s Gemfile:
gem 'rhdl'Then run:
bundle installVerify the Installation
rhdl --helpYou should see the available commands:
| Command | Description |
|---|---|
tui | Launch interactive TUI debugger |
diagram | Generate circuit diagrams |
export | Export components to Verilog |
gates | Gate-level synthesis |
apple2 | Apple II emulator and ROM tools |
Quick Smoke Test
Create a simple AND gate and simulate it in IRB:
require 'rhdl'
and_gate = RHDL::HDL::AndGate.new("my_and")
and_gate.set_input(:a0, 1)
and_gate.set_input(:a1, 1)
and_gate.propagate
puts and_gate.get_output(:y) # => 1List Available Components
RHDL ships with a full library of pre-built components. To see them all:
rhdl tui --listThis lists components across all categories — gates, sequential, arithmetic, combinational, memory, and CPU.
Next Steps
- Development Environment Setup — configure your editor, toolchain, and project structure
- Your First Circuit — build a working design from scratch