reda_sp/model/control/
mod.rs1mod sim;
2mod meas;
3
4use reda_unit::Temperature;
5pub use sim::*;
6pub use meas::*;
7
8use super::ToSpice;
9
10pub struct IncludeCommand(pub String);
11
12pub struct TemperatureCommand(pub Temperature);
13
14impl ToSpice for IncludeCommand {
15 fn to_spice(&self) -> String {
16 format!(".include \"{}\"", self.0)
17 }
18}
19
20impl ToSpice for TemperatureCommand {
21 fn to_spice(&self) -> String {
22 format!(".TEMP {}", self.0)
23 }
24}
25
26#[cfg(test)]
27mod test {
28 use crate::{IncludeCommand, ToSpice};
29
30 #[test]
31 fn test_include() {
32 println!("{}", IncludeCommand("bitcell.sp".into()).to_spice())
33 }
34}