1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! # hdl-cat
//!
//! A hardware description library re-architected around
//! [`comp_cat_rs`](https://github.com/MavenRain/comp-cat-rs)'s
//! categorical effect system.
//!
//! This umbrella crate re-exports the full workspace so a single
//! `use hdl_cat::*;` (or a trimmed [`prelude`]) is enough to get
//! going.
//!
//! ## Layers
//!
//! | Concept | Crate |
//! |---|---|
//! | Errors | `hdl_cat_error` |
//! | Bit-precise ints | `hdl_cat_bits` |
//! | Hardware-typable types | `hdl_cat_kind` |
//! | Domain-indexed signals | `hdl_cat_signal` |
//! | IR (free-category graph) | `hdl_cat_ir` |
//! | Circuit category | `hdl_cat_circuit` |
//! | Sync machines | `hdl_cat_sync` |
//! | Simulator | `hdl_cat_sim` |
//! | Verilog emitter | `hdl_cat_verilog` |
//! | Standard components | `hdl_cat_std` |
//!
//! ## End-to-end example — stateful counter
//!
//! Build → simulate → emit Verilog.
//!
//! ```
//! # fn main() -> Result<(), hdl_cat::Error> {
//! use hdl_cat::prelude::*;
//! use hdl_cat_kind::BitSeq;
//!
//! let c = std_lib::counter::<4>()?;
//! let inputs: Vec<BitSeq> = (0..4).map(|_| BitSeq::new()).collect();
//! let samples = Testbench::new(c).run(inputs).run()?;
//! let values: Vec<u128> = samples
//! .iter()
//! .map(|s| Bits::<4>::from_bits_seq(s.value()).map(Bits::to_u128))
//! .collect::<Result<Vec<_>, _>>()?;
//! assert_eq!(values, vec![0, 1, 2, 3]);
//!
//! let c = std_lib::counter::<4>()?;
//! let module = verilog::emit_sync_graph(
//! c.graph(), "counter4",
//! c.state_wire_count(), c.input_wires(), c.output_wires(),
//! c.initial_state(),
//! ).run()?;
//! let text = module.render().run()?;
//! assert!(text.contains("always_ff @(posedge clk)"));
//! # Ok(()) }
//! ```
//!
//! ## End-to-end example — combinational half-adder
//!
//! ```
//! # fn main() -> Result<(), hdl_cat::Error> {
//! use hdl_cat::prelude::*;
//!
//! let ha = std_lib::half_adder()?;
//! let module = verilog::emit_graph(
//! ha.graph(),
//! "half_adder",
//! ha.inputs(),
//! ha.outputs(),
//! ).run()?;
//! let text = module.render().run()?;
//! assert!(text.contains("module half_adder"));
//! assert!(text.contains("assign"));
//! # Ok(()) }
//! ```
pub use hdl_cat_bits as bits;
pub use kernel;
pub use hdl_cat_circuit as circuit;
pub use ;
pub use hdl_cat_ir as ir;
pub use hdl_cat_kind as kind;
pub use hdl_cat_sim as sim;
pub use hdl_cat_signal as signal;
pub use hdl_cat_std as std_lib;
pub use hdl_cat_sync as sync;
pub use hdl_cat_verilog as verilog;
/// Curated re-exports for quick imports.