Skip to content
lovely-errorPublic

Repository files navigation

DDL (Dataflow Description Language)

CI License

DDL is a compiler that translates high-level dataflow specifications into synthesizable Verilog-2005.

Why DDL?

DDL came from dissatisfaction with existing methods of creating designs for FPGAs. You can read more details here.

Documentation

  • Language Overview & Reference Manual: Comprehensive reference covering core declarations (sequence, process, fun, graph, extern, wire), channels (buffer), Show-Ahead FIFOs, type system, memories, and scoping rules.

Practical Usage Guides

Architecture Deep Dives

How to use

Get the Compiler

Build from sources

DDL requires a nightly Rust toolchain, pinned via rust-toolchain.toml:

cargo build --release

Download compiled executable

Compiled standalone binaries for Linux (x86_64, ARM64), Windows (x64), and macOS (Apple Silicon) are automatically built by GitHub Actions.

You can also download versioned releases and nightly packages directly from the Releases page.

Alternatively, you can download the artifact directly using the GitHub CLI:

# Download and extract the artifact for your operating system
gh run download --name x86_64-pc-windows-msvc

Compile DDL to Verilog

ddl build examples/mul3.ddl -o examples/mul3.v

Use the --check flag to verify that an existing output file matches what the compiler would emit without modifying it:

ddl build examples/mul3.ddl -o examples/mul3.v --check

Tooling

Editor Support

Syntax highlighting for Visual Studio Code is available in editors/vscode/:

cp -r editors/vscode ~/.vscode/extensions/ddl

Graph Visualization

Export Graphviz DOT graphs to visualize module connectivity and stage partitions:

ddl build examples/pipeline_graph.ddl --emit=dot | dot -Tsvg > pipeline.svg

Repository Layout

src/
├── main.rs         CLI entry point and command-line parsing
├── lib.rs          Compiler library interface
├── driver.rs       Pipeline driver coordinating compiler passes
├── source.rs       Source file manager and import resolution
├── lex.rs          Lexer and token definitions
├── parse.rs        Recursive-descent parser and AST representation
├── symbols.rs      Symbol table and lexical scope resolution
├── ty.rs           Type inference, validation, and width checking
├── ir.rs           Typed Static Single Assignment (SSA) intermediate representation
├── ir_pipe.rs      Lowers sequence declarations into pipeline stages
├── ir_fsm.rs       Lowers process declarations into finite state machines
├── ir_graph.rs     Lowers graph declarations into structural instance netlists
├── ir_adapt.rs     Generates Show-Ahead FIFO boundary adapter modules
├── ir_export.rs    Discovers export targets, resolves use graphs, and builds wrappers
├── ir_comb.rs      Generates hardware for @merge and @split combinators
├── ir_match.rs     Lowers match expressions into case statements
├── verilog.rs      Synthesizable Verilog-2005 code generator
└── diag.rs         Source diagnostics and caret rendering

License

Licensed under the Apache License, Version 2.0.

Releases

Packages

Used by

Contributors

Languages