10 #ifndef ILANG_VTARGET_OUT_VLG_MOD_H__
11 #define ILANG_VTARGET_OUT_VLG_MOD_H__
17 #include <ilang/verilog-in/verilog_analysis_wrapper.h>
26 typedef std::tuple<long,
31 typedef std::map<std::string,
35 typedef std::tuple<long,
42 typedef std::tuple<long,
49 typedef std::tuple<long,
56 typedef std::tuple<long,
61 typedef std::map<std::string,
62 std::vector<mod_decl_item_t>>
66 typedef std::map<std::string,
67 std::vector<mod_inst_item_t>>
71 typedef std::map<std::string,
72 std::vector<assign_item_t>>
76 typedef std::map<std::string,
77 std::vector<add_stmt_t>>
92 const std::map<std::string, int>& _sup_width_info);
105 const std::string& suffix =
"");
108 const std::string& mod_instance_name);
133 static std::string add_keep_to_port(
const std::string& line_in,
134 const std::string& vname);
135 static std::string add_keep_to_a_line(
const std::string& line_in,
136 const std::string& vname);
138 add_assign_wire_to_this_line(
const std::string& line_in,
139 const std::string& vname,
unsigned width,
140 const std::string& short_name);
141 bool add_mod_decl_wire_to_this_line(
const std::string& line_in,
142 std::string& line_out,
143 const std::string& vname,
unsigned width);
144 bool add_mod_inst_wire_to_this_line(
const std::string& line_in,
145 std::string& line_out,
146 const std::string& vname,
unsigned width);
152 #endif // ILANG_VTARGET_OUT_VLG_MOD_H__
fn_l_map_t fn_l_map
the record of where to insert keep
Definition: vlg_mod.h:113
VerilogInfo * vlg_info_ptr
The pointer object so we can get verilog information of the implementation.
Definition: vlg_mod.h:123
void RecordKeepSignalName(const std::string &vname)
record the name to add a keep there
bool _add_keep_or_not
whether to add keep
Definition: vlg_mod.h:127
std::tuple< long, std::string, bool > info_t
a tuple to store all related info for modification
Definition: vlg_mod.h:29
mod_decl_map_t mod_decl_map
decl modification record
Definition: vlg_mod.h:115
port_decl_style_t
The style or port declaration.
Definition: vlg_mod.h:84
std::map< std::string, std::vector< assign_item_t > > assign_map_t
type of an wire assignment modification record
Definition: vlg_mod.h:73
port_decl_style_t _port_decl_style
cache the style
Definition: vlg_mod.h:125
~VerilogModifier()
Destructor:
assign_map_t assign_map
an wire assignment modification record
Definition: vlg_mod.h:119
vlg_sig_t RecordConnectSigName(const std::string &vlg_sig_name, const std::string &suffix="")
record the name to add related wires
VerilogModifier(VerilogInfo *_vlg_info_ptr, port_decl_style_t port_decl_style, bool add_keep_or_not, const std::map< std::string, int > &_sup_width_info)
Constructor:
std::map< std::string, std::vector< add_stmt_t > > add_stmt_map_t
type of additional stmt modification record
Definition: vlg_mod.h:78
void FinishRecording()
do some work (sorting)
the class for modification to verilog
Definition: vlg_mod.h:22
std::tuple< long, std::string, unsigned, std::string > assign_item_t
type of an wire assignment modification item
Definition: vlg_mod.h:53
std::map< std::string, std::vector< info_t > > fn_l_map_t
filename -> (lineno, varname, is_port_sig) vec
Definition: vlg_mod.h:33
std::map< std::string, std::vector< mod_decl_item_t > > mod_decl_map_t
type of decl modification record
Definition: vlg_mod.h:63
mod_inst_map_t mod_inst_map
a module inst modification record
Definition: vlg_mod.h:117
void ReadModifyWrite(const std::string &filename, std::istream &fin, std::ostream &fout)
const std::map< std::string, int > & sup_width_info
the supplementary width info
Definition: vlg_mod.h:129
std::tuple< long, std::string, unsigned > mod_decl_item_t
type of a module decl modification item
Definition: vlg_mod.h:39
std::tuple< long, std::string > add_stmt_t
type of an additional statement of an module
Definition: vlg_mod.h:58
std::map< std::string, std::vector< mod_inst_item_t > > mod_inst_map_t
type of a module inst modification record
Definition: vlg_mod.h:68
add_stmt_map_t add_stmt_map
a additional stmt modification record
Definition: vlg_mod.h:121
The class that invoke the analyzer.
Definition: verilog_analysis_wrapper.h:173
std::tuple< long, std::string, unsigned > mod_inst_item_t
type of a module inst modification item
Definition: vlg_mod.h:46
std::pair< std::string, unsigned > vlg_sig_t
type of an wire name w. width
Definition: vlg_mod.h:81
void RecordAdditionalVlgModuleStmt(const std::string &stmt, const std::string &mod_instance_name)
record the stmt to be added to a module