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
//! Logical is a digital network simulator. It is named after the german word "Logical" which
//! describes a puzzle that follows the rules of logic.
//!
//! You can build arbitrary complex networks, which then can be simulated. It supports Ieee1164
//! conform values, like strong and weak drives, uninitialized, high impedance and don't care logic.
//! For more information about these take a look at [`Ieee1164`] Type
//!
//! It is also possible to generate tracefiles in various formats, see the the [`dump`] module.
//!
//! # Usage
//!
//! This crate will be on [crates.io](https://crates.io/crates/logical) and can be used by adding
//! `logical` to your dependencies in your projects `Cargo.toml`.
//!
//! ```toml
//! [dependencies]
//! logical = "0.1"
//! ```
//!
//! Afterwards you can use it in your 2018-rust-project
//!
//! ```rust
//! use logical;
//! ```
//!
//! # Example: connect one port to an other
//!
//! Normally you will connect one [`Port`] to one [`Signal`] as input and then connect an other port as
//! output to that same signal. On [`Updateable::update`] the value from the input will be transfered to
//! the output.
//!
//! ```rust
//! use logical::{Ieee1164, Port, Signal, Updateable};
//! use logical::direction::{Input, Output};
//!
//! let from = Port::<_, Output>::new(Ieee1164::from('1'));
//! let to = Port::<_, Input>::default();
//! let mut signal = Signal::new();
//!
//! signal.connect_as_input(&from);
//! signal.connect_as_output(&to);
//!
//! signal.update();
//!
//! assert_eq!(Ieee1164::from('1'), to.value());
//! ```
//!
//! # Example: multiple ports
//!
//! If you have more than one connector the value on the signal will be determined based on the
//! [`Resolve`] trait. In this case a high-impedance value will be overriden by the Strong zero
//! value and therefore result in 0.
//!
//! ```rust
//! use logical::{Ieee1164, Port, Signal, Updateable};
//! use logical::direction::{Input, Output};
//!
//! let from1 = Port::<_, Output>::new(Ieee1164::from('z'));
//! let from2 = Port::<_, Output>::new(Ieee1164::from('0'));
//! let to = Port::<_, Input>::default();
//! let mut signal = Signal::new();
//!
//! signal.connect_as_input(&from1);
//! signal.connect_as_input(&from2);
//! signal.connect_as_output(&to);
//!
//! signal.update();
//!
//! assert_eq!(Ieee1164::from('0'), to.value());
//! ```
pub
pub use Circuit;
pub use Integer;
pub use ;
pub use Port;
pub use Signal;