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
//! Fsm

use super::*;

/// Fsm
///
/// It contains the interface endpoint from which the fsm starts, the interface endpoint to which it goes,
#[derive(Debug, Clone)]
pub(crate) struct Fsm<'tcx> {
    /// Module Signature
    pub(crate) sig: ModuleSig<'tcx>,
    /// Module name.
    pub(crate) module_name: String,
    /// Init value
    pub(crate) init_value: ExprId,
    /// Fsm logic
    pub(crate) fsm_logic: FunctionBuilder<'tcx>,
}

impl<'tcx> PrimitiveModule for Fsm<'tcx> {
    fn get_module_name(&self) -> String {
        self.module_name.clone()
    }

    fn input_interface_typ(&self) -> InterfaceTyp {
        self.sig.input_interface_typ()
    }

    fn output_interface_typ(&self) -> InterfaceTyp {
        self.sig.output_interface_typ()
    }
}