| Crates.io | nl-compiler |
| lib.rs | nl-compiler |
| version | 0.1.2 |
| created_at | 2026-01-15 05:26:08.945765+00 |
| updated_at | 2026-01-23 22:57:30.58553+00 |
| description | AIG and Verilog frontend compilers |
| homepage | https://matth2k.github.io/safety-net/ |
| repository | https://github.com/matth2k/nl-compiler |
| max_upload_size | |
| id | 2044652 |
| size | 99,178 |
nl-compiler: Frontend Compiler for Safety-NetBelow is a minimal example to get you started:
module and_test (
a,
b,
y
);
input a;
wire a;
input b;
wire b;
output y;
wire y;
AND _0_ (
.A(a),
.B(b),
.Y(y)
);
endmodule
Save the above file to and.v.
cargo run --example roundtrip -- and.v
Also, take a look at some of the tests:
#[test]
fn mux_lut() {
let src = "module lut_test (
a,
b,
c,
y
);
input a;
wire a;
input b;
wire b;
input c;
wire c;
output y;
wire y;
LUT3 #(
.INIT(8'b11001010)
) _0_ (
.I0(a),
.I1(b),
.I2(c),
.O(y)
);
endmodule
"
.to_string();
assert_verilog_eq!(src, roundtrip(&src).unwrap());
}