fayalite 0.2.0

Hardware Description Language embedded in Rust, using FIRRTL's semantics
Documentation
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
//! # `#[hdl]` Struct/Variant Expressions
//!
//! Note: Structs are also known as [Bundles] when used in Fayalite, the Bundle name comes from [FIRRTL].
//!
//! [Bundles]: crate::bundle::BundleType
//! [FIRRTL]: https://github.com/chipsalliance/firrtl-spec
//!
//! `#[hdl]` can be used on Struct Expressions to construct a value of that
//! struct's type. They can also be used on tuples.
//!
//! ```
//! # use fayalite::prelude::*;
//! #[hdl]
//! pub struct MyStruct {
//!     pub a: UInt<8>,
//!     pub b: UInt<16>,
//! }
//!
//! #[hdl]
//! pub enum MyEnum {
//!     A,
//!     B(UInt<32>),
//! }
//!
//! # #[hdl_module]
//! # fn module() {
//! #[hdl]
//! let v: UInt<8> = m.input();
//! #[hdl]
//! let my_struct: MyStruct = wire();
//! connect(
//!     my_struct,
//!     #[hdl]
//!     MyStruct {
//!         a: v,
//!         b: 1234_hdl_u16,
//!     },
//! );
//! #[hdl]
//! let my_enum: MyEnum = wire();
//! connect(
//!     my_enum,
//!     MyEnum.B(12345678_hdl_u32),
//! );
//! #[hdl]
//! let some_tuple: (UInt<4>, UInt<12>) = wire();
//! connect(
//!     some_tuple,
//!     #[hdl]
//!     (12_hdl_u4, 3421_hdl_u12),
//! );
//! # }
//! ```

#[allow(unused)]
use crate::prelude::*;