fayalite/
_docs.rs

1// SPDX-License-Identifier: LGPL-3.0-or-later
2// See Notices.txt for copyright information
3#![doc = include_str!("../README.md")]
4
5//!
6//! # Organization
7//!
8//! All Fayalite-based designs are organized as one or more [modules][`module::Module`]
9//! -- modules are created by writing a Rust function with the
10//! [`#[hdl_module]` attribute][hdl_module].  You can then invoke the function to create a module.
11//! You use the implicitly-added [`m: ModuleBuilder`][`module::ModuleBuilder`] variable in that
12//! function to add inputs/outputs and other components to that module.
13//!
14//! ```
15//! # use fayalite::prelude::*;
16//! #
17//! #[hdl_module]
18//! pub fn example_module() {
19//!     #[hdl]
20//!     let an_input: UInt<10> = m.input(); // create an input that is a 10-bit unsigned integer
21//!     #[hdl]
22//!     let some_output: UInt<10> = m.output();
23//!     connect(some_output, an_input); // assigns the value of `an_input` to `some_output`
24//! }
25//! ```
26
27pub mod modules;
28pub mod semantics;
29
30#[allow(unused)]
31use crate::{hdl_module, module};