用 Ruby 设计硬件
A powerful Ruby DSL for digital circuit design with fast Rust-powered simulation, synthesizable Verilog export, and gate-level synthesis.
From high-level Ruby to synthesizable gates, CIRCT provides a complete hardware design pipeline.
Design hardware using Ruby's expressive syntax and metaprogramming. Familiar language, powerful abstractions.
Gates, flip-flops, registers, ALU, memory modules, and more. Build complex designs from proven primitives.
Import existing Verilog and VHDL designs into RHDL. Integrate legacy IP, vendor cores, and third-party modules.
RTL and gate-level simulation powered by a Rust backend. WASM support enables in-browser testing.
Generate clean, synthesizable Verilog HDL from your Ruby designs. Ready for FPGA synthesis and ASIC flows.
Automatic lowering to primitive gates: AND, OR, XOR, NOT, MUX, and DFF. Full gate-level netlist generation.
Multi-level circuit visualization in SVG, PNG, and DOT formats. See your hardware at any abstraction level.
Direct input-to-output mapping with expressions and case statements
Clock-driven components with synchronous reset and enable signals
Synchronous write, asynchronous read RAM with configurable depth and width
FSM with transition conditions, timed states, and output logic
RHDL lowers to CIRCT IR. Verilog and VHDL import to it. Multiple execution backends fan out from this central representation.
Ruby HDL lowering
Import existing HDL
Central representation
Normalized Verilog
Arc simulation
Native execution
Familiar Ruby syntax with powerful hardware abstractions. No arcane HDL knowledge required.
class SimpleALU < RHDL::Sim::Component
input :a, width: 8
input :b, width: 8
input :op, width: 2
output :result, width: 8
behavior do
result <= case_select(op, {
0 => a + b,
1 => a - b,
2 => a & b,
3 => a | b
}, default: 0)
end
end
module SimpleALU (
input [7:0] a,
input [7:0] b,
input [1:0] op,
output reg [7:0] result
);
always @(*) begin
case (op)
2'b00: result = a + b;
2'b01: result = a - b;
2'b10: result = a & b;
2'b11: result = a | b;
default: result = 8'b0;
endcase
end
endmodule
Complete CPU and system implementations that prove CIRCT's capabilities at scale.
Complete 8-bit processor with all 56 instructions, 13 addressing modes, BCD arithmetic, and a 26-state control unit FSM.
Full system emulation with 6502 CPU, 48KB RAM, text and graphics video modes, Disk II controller, keyboard, and speaker.
Nintendo handheld emulation with SM83 CPU at 4.19MHz, PPU with sprites and windows, timer/counter, and 4-channel APU.
Modern 32-bit RISC-V processor with single-cycle and 5-stage pipelined implementations, full instruction decoder, ALU, and memory hierarchy.
Start building digital circuits today with CIRCT's powerful Ruby DSL.