This commit is contained in:
parent
dba883e300
commit
5cf638c74a
|
@ -15,4 +15,5 @@ jobs:
|
||||||
with:
|
with:
|
||||||
save-if: ${{ github.ref == 'refs/heads/master' }}
|
save-if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
- run: cargo test
|
- run: cargo test
|
||||||
|
- run: cargo test --features=unstable-doc
|
||||||
- run: cargo doc --features=unstable-doc
|
- run: cargo doc --features=unstable-doc
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! # Module Function Bodies
|
//! # Module Function Bodies
|
||||||
//!
|
//!
|
||||||
//! The `#[hdl_module]` attribute lets you have statements/expressions with `#[hdl]` annotations
|
//! The `#[hdl_module]` attribute lets you have statements/expressions with `#[hdl]` annotations
|
||||||
//! and `_hdl`-suffixed literals in the module function's body
|
//! and `_hdl`-suffixed literals in the module function's body.
|
||||||
|
|
||||||
pub mod hdl_array_expressions;
|
pub mod hdl_array_expressions;
|
||||||
pub mod hdl_if_statements;
|
pub mod hdl_if_statements;
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
//! m.connect(
|
//! m.connect(
|
||||||
//! w,
|
//! w,
|
||||||
//! #[hdl]
|
//! #[hdl]
|
||||||
//! [4_hdl_u8, v, 3_hdl_u8, v + 7_hdl_u8] // you can make an array like this
|
//! [4_hdl_u8, v, 3_hdl_u8, (v + 7_hdl_u8).cast()] // you can make an array like this
|
||||||
//! );
|
//! );
|
||||||
//! m.connect(
|
//! m.connect(
|
||||||
//! w,
|
//! w,
|
||||||
//! #[hdl]
|
//! #[hdl]
|
||||||
//! [v + 1_hdl_u8; 4] // or you can make an array repeat like this
|
//! [(v + 1_hdl_u8).cast(); 4] // or you can make an array repeat like this
|
||||||
//! );
|
//! );
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
|
@ -4,11 +4,12 @@
|
||||||
//! so you should read it.
|
//! so you should read it.
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! # use fayalite::{hdl_module, int::UInt, array::Array};
|
//! # use fayalite::{hdl_module, int::UInt, expr::Expr, array::Array};
|
||||||
//! # #[hdl_module]
|
//! # #[hdl_module]
|
||||||
//! # fn module() {
|
//! # fn module() {
|
||||||
//! #[hdl]
|
//! #[hdl]
|
||||||
//! let my_input: UInt<10> = m.input();
|
//! let my_input: UInt<10> = m.input();
|
||||||
|
//! let _: Expr<UInt<10>> = my_input; // my_input has type Expr<UInt<10>>
|
||||||
//! #[hdl]
|
//! #[hdl]
|
||||||
//! let my_output: Array<[UInt<10>; 3]> = m.output();
|
//! let my_output: Array<[UInt<10>; 3]> = m.output();
|
||||||
//! # }
|
//! # }
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
//! ```
|
//! ```
|
||||||
//! # use fayalite::{hdl_module, int::UInt, array::Array, ty::Value};
|
//! # use fayalite::{hdl_module, int::UInt, array::Array, ty::Value};
|
||||||
//! #[derive(Value, Clone, PartialEq, Eq, Hash, Debug)]
|
//! #[derive(Value, Clone, PartialEq, Eq, Hash, Debug)]
|
||||||
|
//! #[hdl(fixed_type)]
|
||||||
//! pub struct MyStruct {
|
//! pub struct MyStruct {
|
||||||
//! pub a: UInt<8>,
|
//! pub a: UInt<8>,
|
||||||
//! pub b: UInt<16>,
|
//! pub b: UInt<16>,
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
//! Connection Semantics Example:
|
//! Connection Semantics Example:
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! # use fayalite::module_hdl;
|
//! # use fayalite::{hdl_module, int::UInt};
|
||||||
//! # #[module_hdl]
|
//! # #[hdl_module]
|
||||||
//! # fn module() {
|
//! # fn module() {
|
||||||
//! #[hdl]
|
//! #[hdl]
|
||||||
//! let a: UInt<8> = m.wire();
|
//! let a: UInt<8> = m.wire();
|
||||||
|
@ -43,8 +43,8 @@
|
||||||
//! # Conditional Connection Semantics
|
//! # Conditional Connection Semantics
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! # use fayalite::module_hdl;
|
//! # use fayalite::{hdl_module, int::UInt};
|
||||||
//! # #[module_hdl]
|
//! # #[hdl_module]
|
||||||
//! # fn module() {
|
//! # fn module() {
|
||||||
//! #[hdl]
|
//! #[hdl]
|
||||||
//! let cond: UInt<1> = m.input();
|
//! let cond: UInt<1> = m.input();
|
||||||
|
|
Loading…
Reference in a new issue