Crates.io | kaze |
lib.rs | kaze |
version | 0.1.19 |
source | src |
created_at | 2020-01-25 13:26:33.982054 |
updated_at | 2021-03-14 18:08:42.251761 |
description | An HDL embedded in Rust |
homepage | |
repository | https://github.com/yupferris/kaze |
max_upload_size | |
id | 201884 |
size | 309,124 |
kaze provides an API to describe Module
s composed of Signal
s, which can then be used to generate Rust simulator code or Verilog modules.
kaze's API is designed to be as minimal as possible while still being expressive. It's designed to prevent the user from being able to describe buggy or incorrect hardware as much as possible. This enables a user to hack on designs fearlessly, while the API and generators ensure that these designs are sound.
[dependencies]
kaze = "0.1"
use kaze::*;
fn main() -> std::io::Result<()> {
// Create a context, which will contain our module(s)
let c = Context::new();
// Create a module
let inverter = c.module("Inverter");
let i = inverter.input("i", 1); // 1-bit input
inverter.output("o", !i); // Output inverted input
// Generate Rust simulator code
sim::generate(inverter, sim::GenerationOptions::default(), std::io::stdout())?;
// Generate Verilog code
verilog::generate(inverter, std::io::stdout())?;
Ok(())
}
See changelog for release information.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.