reda-v 0.1.0

Verilog file library
Documentation
  • Coverage
  • 7.59%
    11 out of 145 items documented0 out of 44 items with examples
  • Size
  • Source code size: 40.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 18.88 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 40s Average build duration of successful builds.
  • all releases: 39s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • MoleSir/reda-v
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MoleSir

reda-v

A verilog file library in Rust.

Features

  • Parse complete Verilog source files into a structured Verilog AST
  • Support for multiple modules within one file
  • Module parsing, including:
    • Ports (input, output, inout) with optional ranges
    • Parameters with constant expressions
    • Nets (wire, reg) with optional ranges
    • Continuous assignments (assign)
    • Always blocks with sensitivity lists (posedge, negedge, or *)
    • Instantiations of other modules
  • Statement parsing inside procedural blocks:
    • Blocking assignments (=)
    • Non-blocking assignments (<=)
    • if/else conditionals
    • Sequential begin ... end blocks
  • Hierarchical AST representation with structs like:
    • Verilog, Module
    • Port, Parameter, Net, Assign, Always, Instance
    • Stmt, Expr, Range, etc.

Examples

let source = r#"
module adder (a, b, sum);
    input [3:0] a;
    input [3:0] b;
    output [4:0] sum;
    assign sum = a + b;
endmodule
"#;

let verilog = Verilog::from_str(source).unwrap();
let adder = verilog.modules.get(0).unwrap();
for p in adder.ports.iter() {
    println!("{}", p.name);
}

LICENSE

MIT

References