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 rhdl

Or add it to your project’s Gemfile:

gem 'rhdl'

Then run:

bundle install

Verify the Installation

rhdl --help

You should see the available commands:

CommandDescription
tuiLaunch interactive TUI debugger
diagramGenerate circuit diagrams
exportExport components to Verilog
gatesGate-level synthesis
apple2Apple 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)  # => 1

List Available Components

RHDL ships with a full library of pre-built components. To see them all:

rhdl tui --list

This lists components across all categories — gates, sequential, arithmetic, combinational, memory, and CPU.

Next Steps