yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HierarchyPass Struct Reference
+ Inheritance diagram for HierarchyPass:
+ Collaboration diagram for HierarchyPass:

Public Member Functions

 HierarchyPass ()
 
virtual void help ()
 
virtual void execute (std::vector< std::string > args, RTLIL::Design *design)
 
pre_post_exec_state_t pre_execute ()
 
void post_execute (pre_post_exec_state_t state)
 
void cmd_log_args (const std::vector< std::string > &args)
 
void cmd_error (const std::vector< std::string > &args, size_t argidx, std::string msg)
 
void extra_args (std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
 
virtual void run_register ()
 

Static Public Member Functions

static void call (RTLIL::Design *design, std::string command)
 
static void call (RTLIL::Design *design, std::vector< std::string > args)
 
static void call_on_selection (RTLIL::Design *design, const RTLIL::Selection &selection, std::string command)
 
static void call_on_selection (RTLIL::Design *design, const RTLIL::Selection &selection, std::vector< std::string > args)
 
static void call_on_module (RTLIL::Design *design, RTLIL::Module *module, std::string command)
 
static void call_on_module (RTLIL::Design *design, RTLIL::Module *module, std::vector< std::string > args)
 
static void init_register ()
 
static void done_register ()
 

Data Fields

std::string pass_name
 
std::string short_help
 
int call_counter
 
int64_t runtime_ns
 
Passnext_queued_pass
 

Detailed Description

Definition at line 309 of file hierarchy.cc.

Constructor & Destructor Documentation

HierarchyPass::HierarchyPass ( )
inline

Definition at line 310 of file hierarchy.cc.

310 : Pass("hierarchy", "check, expand and clean up design hierarchy") { }
Pass(std::string name, std::string short_help="** document me **")
Definition: register.cc:40

Member Function Documentation

void Pass::call ( RTLIL::Design design,
std::string  command 
)
staticinherited

Definition at line 146 of file register.cc.

147 {
148  std::vector<std::string> args;
149 
150  std::string cmd_buf = command;
151  std::string tok = next_token(cmd_buf, " \t\r\n");
152 
153  if (tok.empty() || tok[0] == '#')
154  return;
155 
156  if (tok[0] == '!') {
157  cmd_buf = command.substr(command.find('!') + 1);
158  while (!cmd_buf.empty() && (cmd_buf.back() == ' ' || cmd_buf.back() == '\t' ||
159  cmd_buf.back() == '\r' || cmd_buf.back() == '\n'))
160  cmd_buf.resize(cmd_buf.size()-1);
161  log_header("Shell command: %s\n", cmd_buf.c_str());
162  int retCode = run_command(cmd_buf);
163  if (retCode != 0)
164  log_cmd_error("Shell command returned error code %d.\n", retCode);
165  return;
166  }
167 
168  while (!tok.empty()) {
169  if (tok == "#")
170  break;
171  if (tok.back() == ';') {
172  int num_semikolon = 0;
173  while (!tok.empty() && tok.back() == ';')
174  tok.resize(tok.size()-1), num_semikolon++;
175  if (!tok.empty())
176  args.push_back(tok);
177  call(design, args);
178  args.clear();
179  if (num_semikolon == 2)
180  call(design, "clean");
181  if (num_semikolon == 3)
182  call(design, "clean -purge");
183  } else
184  args.push_back(tok);
185  tok = next_token(cmd_buf, " \t\r\n");
186  }
187 
188  call(design, args);
189 }
static std::string next_token(bool pass_newline=false)
Definition: preproc.cc:96
void log_header(const char *format,...)
Definition: log.cc:188
int run_command(const std::string &command, std::function< void(const std::string &)> process_line)
Definition: yosys.cc:195
void log_cmd_error(const char *format,...)
Definition: log.cc:211
static void call(RTLIL::Design *design, std::string command)
Definition: register.cc:146

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Pass::call ( RTLIL::Design design,
std::vector< std::string >  args 
)
staticinherited

Definition at line 191 of file register.cc.

192 {
193  if (args.size() == 0 || args[0][0] == '#')
194  return;
195 
196  if (echo_mode) {
197  log("%s", create_prompt(design, 0));
198  for (size_t i = 0; i < args.size(); i++)
199  log("%s%s", i ? " " : "", args[i].c_str());
200  log("\n");
201  }
202 
203  if (pass_register.count(args[0]) == 0)
204  log_cmd_error("No such command: %s (type 'help' for a command overview)\n", args[0].c_str());
205 
206  size_t orig_sel_stack_pos = design->selection_stack.size();
207  auto state = pass_register[args[0]]->pre_execute();
208  pass_register[args[0]]->execute(args, design);
209  pass_register[args[0]]->post_execute(state);
210  while (design->selection_stack.size() > orig_sel_stack_pos)
211  design->selection_stack.pop_back();
212 
213  design->check();
214 }
bool echo_mode
Definition: register.cc:30
std::vector< RTLIL::Selection > selection_stack
Definition: rtlil.h:509
const char * create_prompt(RTLIL::Design *design, int recursion_counter)
Definition: yosys.cc:400
void check()
Definition: rtlil.cc:357
void log_cmd_error(const char *format,...)
Definition: log.cc:211
void log(const char *format,...)
Definition: log.cc:180
std::map< std::string, Pass * > pass_register
Definition: register.cc:35

+ Here is the call graph for this function:

void Pass::call_on_module ( RTLIL::Design design,
RTLIL::Module module,
std::string  command 
)
staticinherited

Definition at line 240 of file register.cc.

241 {
242  std::string backup_selected_active_module = design->selected_active_module;
243  design->selected_active_module = module->name.str();
244  design->selection_stack.push_back(RTLIL::Selection(false));
245  design->selection_stack.back().select(module);
246 
247  Pass::call(design, command);
248 
249  design->selection_stack.pop_back();
250  design->selected_active_module = backup_selected_active_module;
251 }
std::string str() const
Definition: rtlil.h:182
std::vector< RTLIL::Selection > selection_stack
Definition: rtlil.h:509
RTLIL::IdString name
Definition: rtlil.h:599
std::string selected_active_module
Definition: rtlil.h:511
static void call(RTLIL::Design *design, std::string command)
Definition: register.cc:146

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Pass::call_on_module ( RTLIL::Design design,
RTLIL::Module module,
std::vector< std::string >  args 
)
staticinherited

Definition at line 253 of file register.cc.

254 {
255  std::string backup_selected_active_module = design->selected_active_module;
256  design->selected_active_module = module->name.str();
257  design->selection_stack.push_back(RTLIL::Selection(false));
258  design->selection_stack.back().select(module);
259 
260  Pass::call(design, args);
261 
262  design->selection_stack.pop_back();
263  design->selected_active_module = backup_selected_active_module;
264 }
std::string str() const
Definition: rtlil.h:182
std::vector< RTLIL::Selection > selection_stack
Definition: rtlil.h:509
RTLIL::IdString name
Definition: rtlil.h:599
std::string selected_active_module
Definition: rtlil.h:511
static void call(RTLIL::Design *design, std::string command)
Definition: register.cc:146

+ Here is the call graph for this function:

void Pass::call_on_selection ( RTLIL::Design design,
const RTLIL::Selection selection,
std::string  command 
)
staticinherited

Definition at line 216 of file register.cc.

217 {
218  std::string backup_selected_active_module = design->selected_active_module;
219  design->selected_active_module.clear();
220  design->selection_stack.push_back(selection);
221 
222  Pass::call(design, command);
223 
224  design->selection_stack.pop_back();
225  design->selected_active_module = backup_selected_active_module;
226 }
std::vector< RTLIL::Selection > selection_stack
Definition: rtlil.h:509
std::string selected_active_module
Definition: rtlil.h:511
static void call(RTLIL::Design *design, std::string command)
Definition: register.cc:146

+ Here is the call graph for this function:

void Pass::call_on_selection ( RTLIL::Design design,
const RTLIL::Selection selection,
std::vector< std::string >  args 
)
staticinherited

Definition at line 228 of file register.cc.

229 {
230  std::string backup_selected_active_module = design->selected_active_module;
231  design->selected_active_module.clear();
232  design->selection_stack.push_back(selection);
233 
234  Pass::call(design, args);
235 
236  design->selection_stack.pop_back();
237  design->selected_active_module = backup_selected_active_module;
238 }
std::vector< RTLIL::Selection > selection_stack
Definition: rtlil.h:509
std::string selected_active_module
Definition: rtlil.h:511
static void call(RTLIL::Design *design, std::string command)
Definition: register.cc:146

+ Here is the call graph for this function:

void Pass::cmd_error ( const std::vector< std::string > &  args,
size_t  argidx,
std::string  msg 
)
inherited

Definition at line 110 of file register.cc.

111 {
112  std::string command_text;
113  int error_pos = 0;
114 
115  for (size_t i = 0; i < args.size(); i++) {
116  if (i < argidx)
117  error_pos += args[i].size() + 1;
118  command_text = command_text + (command_text.empty() ? "" : " ") + args[i];
119  }
120 
121  log("\nSyntax error in command `%s':\n", command_text.c_str());
122  help();
123 
124  log_cmd_error("Command syntax error: %s\n> %s\n> %*s^\n",
125  msg.c_str(), command_text.c_str(), error_pos, "");
126 }
virtual void help()
Definition: register.cc:93
void log_cmd_error(const char *format,...)
Definition: log.cc:211
void log(const char *format,...)
Definition: log.cc:180

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Pass::cmd_log_args ( const std::vector< std::string > &  args)
inherited

Definition at line 100 of file register.cc.

101 {
102  if (args.size() <= 1)
103  return;
104  log("Full command line:");
105  for (size_t i = 0; i < args.size(); i++)
106  log(" %s", args[i].c_str());
107  log("\n");
108 }
void log(const char *format,...)
Definition: log.cc:180

+ Here is the call graph for this function:

void Pass::done_register ( )
staticinherited

Definition at line 62 of file register.cc.

63 {
64  frontend_register.clear();
65  pass_register.clear();
66  backend_register.clear();
68 }
std::map< std::string, Frontend * > frontend_register
Definition: register.cc:34
Pass * first_queued_pass
Definition: register.cc:31
#define log_assert(_assert_expr_)
Definition: log.h:85
#define NULL
std::map< std::string, Pass * > pass_register
Definition: register.cc:35
std::map< std::string, Backend * > backend_register
Definition: register.cc:36

+ Here is the caller graph for this function:

virtual void HierarchyPass::execute ( std::vector< std::string >  args,
RTLIL::Design design 
)
inlinevirtual

Implements Pass.

Definition at line 370 of file hierarchy.cc.

371  {
372  log_header("Executing HIERARCHY pass (managing design hierarchy).\n");
373 
374  bool flag_check = false;
375  bool purge_lib = false;
376  RTLIL::Module *top_mod = NULL;
377  std::vector<std::string> libdirs;
378 
379  bool generate_mode = false;
380  bool keep_positionals = false;
381  bool nokeep_asserts = false;
382  std::vector<std::string> generate_cells;
383  std::vector<generate_port_decl_t> generate_ports;
384 
385  size_t argidx;
386  for (argidx = 1; argidx < args.size(); argidx++)
387  {
388  if (args[argidx] == "-generate" && !flag_check && !top_mod) {
389  generate_mode = true;
390  log("Entering generate mode.\n");
391  while (++argidx < args.size()) {
392  const char *p = args[argidx].c_str();
394  if (p[0] == 'i' && p[1] == 'o')
395  decl.input = true, decl.output = true, p += 2;
396  else if (*p == 'i')
397  decl.input = true, decl.output = false, p++;
398  else if (*p == 'o')
399  decl.input = false, decl.output = true, p++;
400  else
401  goto is_celltype;
402  if (*p == '@') {
403  char *endptr;
404  decl.index = strtol(++p, &endptr, 10);
405  if (decl.index < 1)
406  goto is_celltype;
407  p = endptr;
408  } else
409  decl.index = 0;
410  if (*(p++) != ':')
411  goto is_celltype;
412  if (*p == 0)
413  goto is_celltype;
414  decl.portname = p;
415  log("Port declaration: %s", decl.input ? decl.output ? "inout" : "input" : "output");
416  if (decl.index >= 1)
417  log(" [at position %d]", decl.index);
418  log(" %s\n", decl.portname.c_str());
419  generate_ports.push_back(decl);
420  continue;
421  is_celltype:
422  log("Celltype: %s\n", args[argidx].c_str());
423  generate_cells.push_back(RTLIL::unescape_id(args[argidx]));
424  }
425  continue;
426  }
427  if (args[argidx] == "-check") {
428  flag_check = true;
429  continue;
430  }
431  if (args[argidx] == "-purge_lib") {
432  purge_lib = true;
433  continue;
434  }
435  if (args[argidx] == "-keep_positionals") {
436  keep_positionals = true;
437  continue;
438  }
439  if (args[argidx] == "-nokeep_asserts") {
440  nokeep_asserts = true;
441  continue;
442  }
443  if (args[argidx] == "-libdir" && argidx+1 < args.size()) {
444  libdirs.push_back(args[++argidx]);
445  continue;
446  }
447  if (args[argidx] == "-top") {
448  if (++argidx >= args.size())
449  log_cmd_error("Option -top requires an additional argument!\n");
450  top_mod = design->modules_.count(RTLIL::escape_id(args[argidx])) ? design->modules_.at(RTLIL::escape_id(args[argidx])) : NULL;
451  if (top_mod == NULL && design->modules_.count("$abstract" + RTLIL::escape_id(args[argidx]))) {
452  std::map<RTLIL::IdString, RTLIL::Const> empty_parameters;
453  design->modules_.at("$abstract" + RTLIL::escape_id(args[argidx]))->derive(design, empty_parameters);
454  top_mod = design->modules_.count(RTLIL::escape_id(args[argidx])) ? design->modules_.at(RTLIL::escape_id(args[argidx])) : NULL;
455  }
456  if (top_mod == NULL)
457  log_cmd_error("Module `%s' not found!\n", args[argidx].c_str());
458  continue;
459  }
460  break;
461  }
462  extra_args(args, argidx, design, false);
463 
464  if (generate_mode) {
465  generate(design, generate_cells, generate_ports);
466  return;
467  }
468 
469  log_push();
470 
471  if (top_mod == NULL)
472  for (auto &mod_it : design->modules_)
473  if (mod_it.second->get_bool_attribute("\\top"))
474  top_mod = mod_it.second;
475 
476  if (top_mod != NULL)
477  hierarchy(design, top_mod, purge_lib, true);
478 
479  bool did_something = true;
480  bool did_something_once = false;
481  while (did_something) {
482  did_something = false;
483  std::vector<RTLIL::IdString> modnames;
484  modnames.reserve(design->modules_.size());
485  for (auto &mod_it : design->modules_)
486  modnames.push_back(mod_it.first);
487  for (auto &modname : modnames) {
488  if (design->modules_.count(modname) == 0)
489  continue;
490  if (expand_module(design, design->modules_[modname], flag_check, libdirs))
491  did_something = true;
492  }
493  if (did_something)
494  did_something_once = true;
495  }
496 
497  if (top_mod != NULL && did_something_once) {
498  log_header("Re-running hierarchy analysis..\n");
499  hierarchy(design, top_mod, purge_lib, false);
500  }
501 
502  if (top_mod != NULL) {
503  for (auto &mod_it : design->modules_)
504  if (mod_it.second == top_mod)
505  mod_it.second->attributes["\\top"] = RTLIL::Const(1);
506  else
507  mod_it.second->attributes.erase("\\top");
508  }
509 
510  if (!nokeep_asserts) {
511  std::map<RTLIL::Module*, bool> cache;
512  for (auto mod : design->modules())
513  if (set_keep_assert(cache, mod)) {
514  log("Module %s directly or indirectly contains $assert cells -> setting \"keep\" attribute.\n", log_id(mod));
515  mod->set_bool_attribute("\\keep");
516  }
517  }
518 
519  if (!keep_positionals)
520  {
521  std::set<RTLIL::Module*> pos_mods;
522  std::map<std::pair<RTLIL::Module*,int>, RTLIL::IdString> pos_map;
523  std::vector<std::pair<RTLIL::Module*,RTLIL::Cell*>> pos_work;
524 
525  for (auto &mod_it : design->modules_)
526  for (auto &cell_it : mod_it.second->cells_) {
527  RTLIL::Cell *cell = cell_it.second;
528  if (design->modules_.count(cell->type) == 0)
529  continue;
530  for (auto &conn : cell->connections())
531  if (conn.first[0] == '$' && '0' <= conn.first[1] && conn.first[1] <= '9') {
532  pos_mods.insert(design->modules_.at(cell->type));
533  pos_work.push_back(std::pair<RTLIL::Module*,RTLIL::Cell*>(mod_it.second, cell));
534  break;
535  }
536  }
537 
538  for (auto module : pos_mods)
539  for (auto &wire_it : module->wires_) {
540  RTLIL::Wire *wire = wire_it.second;
541  if (wire->port_id > 0)
542  pos_map[std::pair<RTLIL::Module*,int>(module, wire->port_id)] = wire->name;
543  }
544 
545  for (auto &work : pos_work) {
546  RTLIL::Module *module = work.first;
547  RTLIL::Cell *cell = work.second;
548  log("Mapping positional arguments of cell %s.%s (%s).\n",
549  RTLIL::id2cstr(module->name), RTLIL::id2cstr(cell->name), RTLIL::id2cstr(cell->type));
550  std::map<RTLIL::IdString, RTLIL::SigSpec> new_connections;
551  for (auto &conn : cell->connections())
552  if (conn.first[0] == '$' && '0' <= conn.first[1] && conn.first[1] <= '9') {
553  int id = atoi(conn.first.c_str()+1);
554  std::pair<RTLIL::Module*,int> key(design->modules_.at(cell->type), id);
555  if (pos_map.count(key) == 0) {
556  log(" Failed to map positional argument %d of cell %s.%s (%s).\n",
557  id, RTLIL::id2cstr(module->name), RTLIL::id2cstr(cell->name), RTLIL::id2cstr(cell->type));
558  new_connections[conn.first] = conn.second;
559  } else
560  new_connections[pos_map.at(key)] = conn.second;
561  } else
562  new_connections[conn.first] = conn.second;
563  cell->connections_ = new_connections;
564  }
565  }
566 
567  log_pop();
568  }
const char * c_str() const
Definition: rtlil.h:178
void log_header(const char *format,...)
Definition: log.cc:188
std::map< RTLIL::IdString, RTLIL::Wire * > wires_
Definition: rtlil.h:595
static std::string unescape_id(std::string str)
Definition: rtlil.h:257
RTLIL::IdString name
Definition: rtlil.h:853
RTLIL::IdString portname
Definition: hierarchy.cc:35
RTLIL::Module * module
Definition: abc.cc:94
int port_id
Definition: rtlil.h:826
RTLIL::IdString type
Definition: rtlil.h:854
void log_pop()
Definition: log.cc:237
if(!(yy_init))
Definition: ilang_lexer.cc:846
static std::string escape_id(std::string str)
Definition: rtlil.h:251
USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN bool did_something
Definition: opt_const.cc:32
bool set_keep_assert(std::map< RTLIL::Module *, bool > &cache, RTLIL::Module *mod)
Definition: hierarchy.cc:298
RTLIL::IdString name
Definition: rtlil.h:599
bool expand_module(RTLIL::Design *design, RTLIL::Module *module, bool flag_check, std::vector< std::string > &libdirs)
Definition: hierarchy.cc:141
RTLIL::IdString name
Definition: rtlil.h:825
static const char * id2cstr(const RTLIL::IdString &str)
Definition: rtlil.h:267
void log_cmd_error(const char *format,...)
Definition: log.cc:211
RTLIL::ObjRange< RTLIL::Module * > modules()
Definition: rtlil.cc:249
std::map< RTLIL::IdString, RTLIL::Module * > modules_
Definition: rtlil.h:507
#define NULL
void log(const char *format,...)
Definition: log.cc:180
void log_push()
Definition: log.cc:232
std::map< RTLIL::IdString, RTLIL::SigSpec > connections_
Definition: rtlil.h:855
std::string id(RTLIL::IdString internal_id, bool may_rename=true)
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
Definition: register.cc:128
const std::map< RTLIL::IdString, RTLIL::SigSpec > & connections() const
Definition: rtlil.cc:1814
void hierarchy(RTLIL::Design *design, RTLIL::Module *top, bool purge_lib, bool first_pass)
Definition: hierarchy.cc:275
const char * log_id(RTLIL::IdString str)
Definition: log.cc:283
void generate(RTLIL::Design *design, const std::vector< std::string > &celltypes, const std::vector< generate_port_decl_t > &portdecls)
Definition: hierarchy.cc:39

+ Here is the call graph for this function:

void Pass::extra_args ( std::vector< std::string >  args,
size_t  argidx,
RTLIL::Design design,
bool  select = true 
)
inherited

Definition at line 128 of file register.cc.

129 {
130  for (; argidx < args.size(); argidx++)
131  {
132  std::string arg = args[argidx];
133 
134  if (arg.substr(0, 1) == "-")
135  cmd_error(args, argidx, "Unknown option or option in arguments.");
136 
137  if (!select)
138  cmd_error(args, argidx, "Extra argument.");
139 
140  handle_extra_select_args(this, args, argidx, args.size(), design);
141  break;
142  }
143  // cmd_log_args(args);
144 }
void cmd_error(const std::vector< std::string > &args, size_t argidx, std::string msg)
Definition: register.cc:110
void handle_extra_select_args(Pass *pass, std::vector< std::string > args, size_t argidx, size_t args_size, RTLIL::Design *design)
Definition: select.cc:803

+ Here is the call graph for this function:

virtual void HierarchyPass::help ( )
inlinevirtual

Reimplemented from Pass.

Definition at line 311 of file hierarchy.cc.

312  {
313  // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
314  log("\n");
315  log(" hierarchy [-check] [-top <module>]\n");
316  log(" hierarchy -generate <cell-types> <port-decls>\n");
317  log("\n");
318  log("In parametric designs, a module might exists in several variations with\n");
319  log("different parameter values. This pass looks at all modules in the current\n");
320  log("design an re-runs the language frontends for the parametric modules as\n");
321  log("needed.\n");
322  log("\n");
323  log(" -check\n");
324  log(" also check the design hierarchy. this generates an error when\n");
325  log(" an unknown module is used as cell type.\n");
326  log("\n");
327  log(" -purge_lib\n");
328  log(" by default the hierarchy command will not remove library (blackbox)\n");
329  log(" module. use this options to also remove unused blackbox modules.\n");
330  log("\n");
331  log(" -libdir <directory>\n");
332  log(" search for files named <module_name>.v in the specified directory\n");
333  log(" for unknown modules and automatically run read_verilog for each\n");
334  log(" unknown module.\n");
335  log("\n");
336  log(" -keep_positionals\n");
337  log(" per default this pass also converts positional arguments in cells\n");
338  log(" to arguments using port names. this option disables this behavior.\n");
339  log("\n");
340  log(" -nokeep_asserts\n");
341  log(" per default this pass sets the \"keep\" attribute on all modules\n");
342  log(" that directly or indirectly contain one or more $assert cells. this\n");
343  log(" option disables this behavior.\n");
344  log("\n");
345  log(" -top <module>\n");
346  log(" use the specified top module to built a design hierarchy. modules\n");
347  log(" outside this tree (unused modules) are removed.\n");
348  log("\n");
349  log(" when the -top option is used, the 'top' attribute will be set on the\n");
350  log(" specified top module. otherwise a module with the 'top' attribute set\n");
351  log(" will implicitly be used as top module, if such a module exists.\n");
352  log("\n");
353  log("In -generate mode this pass generates blackbox modules for the given cell\n");
354  log("types (wildcards supported). For this the design is searched for cells that\n");
355  log("match the given types and then the given port declarations are used to\n");
356  log("determine the direction of the ports. The syntax for a port declaration is:\n");
357  log("\n");
358  log(" {i|o|io}[@<num>]:<portname>\n");
359  log("\n");
360  log("Input ports are specified with the 'i' prefix, output ports with the 'o'\n");
361  log("prefix and inout ports with the 'io' prefix. The optional <num> specifies\n");
362  log("the position of the port in the parameter list (needed when instanciated\n");
363  log("using positional arguments). When <num> is not specified, the <portname> can\n");
364  log("also contain wildcard characters.\n");
365  log("\n");
366  log("This pass ignores the current selection and always operates on all modules\n");
367  log("in the current design.\n");
368  log("\n");
369  }
void log(const char *format,...)
Definition: log.cc:180

+ Here is the call graph for this function:

void Pass::init_register ( )
staticinherited

Definition at line 54 of file register.cc.

55 {
56  while (first_queued_pass) {
59  }
60 }
Pass * first_queued_pass
Definition: register.cc:31
Pass * next_queued_pass
Definition: register.h:60
virtual void run_register()
Definition: register.cc:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Pass::post_execute ( Pass::pre_post_exec_state_t  state)
inherited

Definition at line 84 of file register.cc.

85 {
86  int64_t time_ns = PerformanceTimer::query() - state.begin_ns;
87  runtime_ns += time_ns;
88  current_pass = state.parent_pass;
89  if (current_pass)
90  current_pass->runtime_ns -= time_ns;
91 }
static int64_t query()
Definition: log.h:151
int64_t runtime_ns
Definition: register.h:37
Pass * current_pass
Definition: register.cc:32
Pass * parent_pass
Definition: register.h:40
int64_t begin_ns
Definition: register.h:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Pass::pre_post_exec_state_t Pass::pre_execute ( )
inherited

Definition at line 74 of file register.cc.

75 {
76  pre_post_exec_state_t state;
77  call_counter++;
78  state.begin_ns = PerformanceTimer::query();
79  state.parent_pass = current_pass;
80  current_pass = this;
81  return state;
82 }
static int64_t query()
Definition: log.h:151
Pass * current_pass
Definition: register.cc:32
int call_counter
Definition: register.h:36

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Pass::run_register ( )
virtualinherited

Reimplemented in Backend, and Frontend.

Definition at line 48 of file register.cc.

49 {
50  log_assert(pass_register.count(pass_name) == 0);
51  pass_register[pass_name] = this;
52 }
std::string pass_name
Definition: register.h:29
#define log_assert(_assert_expr_)
Definition: log.h:85
std::map< std::string, Pass * > pass_register
Definition: register.cc:35

+ Here is the caller graph for this function:

Field Documentation

int Pass::call_counter
inherited

Definition at line 36 of file register.h.

Pass* Pass::next_queued_pass
inherited

Definition at line 60 of file register.h.

std::string Pass::pass_name
inherited

Definition at line 29 of file register.h.

int64_t Pass::runtime_ns
inherited

Definition at line 37 of file register.h.

std::string Pass::short_help
inherited

Definition at line 29 of file register.h.


The documentation for this struct was generated from the following file: