8
8
#include < memory>
9
9
#include < nlohmann/json.hpp>
10
10
#include < unordered_map>
11
- #include < unordered_set>
12
11
13
12
using json = nlohmann::json;
14
13
@@ -33,21 +32,25 @@ class J2IDes {
33
32
static J2IDesPtr New ();
34
33
35
34
// ------------------------- METHODS -------------------------------------- //
35
+ // / Deserialize Sort from JSON.
36
+ SortPtr DesSort (const json& j_sort);
37
+ // / Deserialize Func from JSON.
38
+ FuncPtr DesFunc (const json& j_func);
36
39
// / \brief Deserialize Expr from JSON.
37
- ExprPtr DesExpr (const json& j_expr, const InstrLvlAbsPtr& i_host );
40
+ ExprPtr DesExpr (const json& j_expr);
38
41
// / \brief Deserialize Instr from JSON.
39
42
InstrPtr DesInstr (const json& j_instr, const InstrLvlAbsPtr& i_host) const ;
40
43
// / \brief Deserialize InstrLvlAbs from JSON.
41
- InstrLvlAbsPtr DesInstrLvlAbs (const json& j_ila );
44
+ InstrLvlAbsPtr DesInstrLvlAbs (const json& j_global );
42
45
43
46
private:
44
47
// ------------------------- MEMBERS -------------------------------------- //
45
- // / A mapping from id to expressions .
48
+ // / A mapping from id to expression .
46
49
std::unordered_map<size_t , ExprPtr> id_expr_map_;
47
- // / The set of state variables .
48
- std::unordered_set <size_t > state_id_set_ ;
49
- // / The set of input variables .
50
- std::unordered_set< size_t > input_id_set_ ;
50
+ // / A mapping from id to function .
51
+ std::unordered_map <size_t , FuncPtr> id_func_map_ ;
52
+ // / The mapping from ila name to pointer .
53
+ std::unordered_map<std::string, const InstrLvlAbsPtr> ila_name_ptr_map_ ;
51
54
52
55
// ------------------------- METHODS -------------------------------------- //
53
56
// / Deserialize ExprVar into state from JSON.
@@ -61,6 +64,22 @@ class J2IDes {
61
64
// / Deserialize ExprOp from JSON.
62
65
ExprPtr DesExprOp (const unsigned & ast_expr_op_uid, const json& j_arg_arr,
63
66
const json& j_param_arr) const ;
67
+ // / Deserialize ExprOpAppFunc from JSON.
68
+ ExprPtr DesExprOpAppFunc (const json& j_func_id, const json& j_arg_arr) const ;
69
+
70
+ // / Deserialize state/input variables. Note: the ILA model will be
71
+ // / constructed on-the-fly.
72
+ void DesVarUnit (const json& j_ila, const json& j_ast_list,
73
+ const InstrLvlAbsPtr& i_parent);
74
+ // / Deserialize state/input variables hierarchically. Note: ILA model will be
75
+ // / constructed on-the-fly.
76
+ void DesVarHier (const json& j_ila, const json& j_ast_list,
77
+ const InstrLvlAbsPtr& i_parent);
78
+
79
+ // / Deserialize ILA info, e.g., fetch, valid, instructions, etc.
80
+ void DesIlaUnit (const json& j_ila);
81
+ // / Deserialize ILA info hierarchically.
82
+ void DesIlaHier (const json& j_ila);
64
83
65
84
}; // class J2IDes
66
85
0 commit comments