ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
vtarget_gen_inv_abc.h
1 // ---Hongce Zhang
8 
9 #ifndef VTARGET_GEN_INV_ABC_H__
10 #define VTARGET_GEN_INV_ABC_H__
11 
12 #include <ilang/config.h>
13 #ifdef INVSYN_INTERFACE
14 
16 #include <ilang/vtarget-out/vlg_mod.h>
17 #include <ilang/vtarget-out/vtarget_gen_impl.h>
18 #include <iostream>
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 namespace ilang {
24 
25 class VlgSglTgtGen_Abc;
26 
28 class Abc_problem {
29  friend class VlgSglTgtGen_Abc;
31  typedef std::vector<std::string> prop_t;
34  typedef struct {
35  // the name in [??]
36  // std::string problem_name;
38  prop_t exprs;
39  } problem_t;
41  typedef std::map<std::string, problem_t> problemset_t;
42 
43 protected:
45  problemset_t assumptions;
47  problemset_t assertions;
48 
49 }; // Abc_problem
50 
52 class VlgSglTgtGen_Abc : public VlgSglTgtGen {
53 
54 public:
56  using target_type_t = VlgSglTgtGen::target_type_t;
58  using info_t = VerilogModifier::info_t;
60  using fn_l_map_t = VerilogModifier::fn_l_map_t;
62  using advanced_parameters_t = VlgVerifTgtGenBase::advanced_parameters_t;
64  using _chc_target_t = VlgVerifTgtGenBase::_chc_target_t;
65 
66 public:
67  // --------------------- CONSTRUCTOR ---------------------------- //
81  VlgSglTgtGen_Abc(
82  const std::string& output_path, // will be a sub directory of the
83  // output_path of its parent
84  const InstrPtr& instr_ptr, // which could be an empty pointer, and it will
85  // be used to verify invariants
86  const InstrLvlAbsPtr& ila_ptr,
87  const VerilogGenerator::VlgGenConfig& config, nlohmann::json& _rf_vmap,
88  nlohmann::json& _rf_cond, VlgTgtSupplementaryInfo& _sup_info,
89  VerilogInfo* _vlg_info_ptr, const std::string& vlg_mod_inst_name,
90  const std::string& ila_mod_inst_name, const std::string& wrapper_name,
91  const std::vector<std::string>& implementation_srcs,
92  const std::vector<std::string>& include_dirs,
93  const vtg_config_t& vtg_config, backend_selector vbackend,
94  synthesis_backend_selector sbackend, const target_type_t& target_tp,
95  advanced_parameters_t* adv_ptr, bool generate_proof,
96  _chc_target_t Abc_target, bool useGLA, bool useCORR, bool useAIGER);
97 
98  // --------------------- Destructor ---------------------------- //
100  virtual ~VlgSglTgtGen_Abc();
101 
102 protected:
104  Abc_problem _problems;
106  std::string blif_fname;
109  std::string aiger_fname;
111  std::string abc_run_script_name;
113  std::vector<std::string> vlg_mod_inv_vec;
115  synthesis_backend_selector s_backend;
117  bool generate_proof;
119  bool has_cex;
121  _chc_target_t chc_target;
123  const bool useGla;
125  const bool useCorr;
127  const bool useAiger;
129  bool disallowGla;
130 
131 protected:
133  virtual void add_a_direct_assumption(const std::string& aspt,
134  const std::string& dspt) override;
136  virtual void add_a_direct_assertion(const std::string& asst,
137  const std::string& dspt) override;
138 
140  void virtual PreExportProcess() override;
142  virtual void Export_script(const std::string& script_name) override;
144  virtual void Export_problem(const std::string& extra_name) override;
148  virtual void Export_mem(const std::string& mem_name) override;
150  virtual void Export_modify_verilog() override;
151 
152 private:
154  void generate_blif(const std::string& blif_name,
155  const std::string& ys_script_name);
157  void generate_aiger(const std::string& blif_name,
158  const std::string& aiger_name,
159  const std::string& map_name,
160  const std::string& ys_script_name);
161 
162 public:
164  void virtual ExportAll(const std::string& wrapper_name,
165  const std::string& ila_vlg_name,
166  const std::string& script_name,
167  const std::string& extra_name,
168  const std::string& mem_name) override;
169 
171  virtual void do_not_instantiate(void) override{};
172 
173 }; // class VlgVerifTgtGenAbc
174 
175 }; // namespace ilang
176 
177 #endif // INVSYN_INTERFACE
178 
179 #endif // VTARGET_GEN_INV_ABC_H__
std::tuple< long, std::string, bool > info_t
a tuple to store all related info for modification
Definition: vlg_mod.h:29
struct ilang::VlgVerifTgtGenBase::_adv_parameters advanced_parameters_t
Instr::InstrPtr InstrPtr
Pointer type for normal use of Instr.
Definition: instr.h:132
target_type_t
Type of the target.
Definition: vtarget_gen_impl.h:40
VerilogGeneratorBase::VlgGenConfig VlgGenConfig
the structure to configure the verilog generator
Definition: verilog_gen.h:421
std::map< std::string, std::vector< info_t > > fn_l_map_t
filename -&gt; (lineno, varname, is_port_sig) vec
Definition: vlg_mod.h:33
InstrLvlAbs::InstrLvlAbsPtr InstrLvlAbsPtr
Pointer type for normal use of InstrLvlAbs.
Definition: instr_lvl_abs.h:326
_chc_target_t
Type of the chc target.
Definition: vtarget_gen.h:53