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

Public Member Functions

 LibertyFrontend ()
 
virtual void help ()
 
virtual void execute (std::istream *&f, std::string filename, std::vector< std::string > args, RTLIL::Design *design)
 
virtual void run_register ()
 
virtual void execute (std::vector< std::string > args, RTLIL::Design *design) YS_OVERRIDE YS_FINAL
 
void extra_args (std::istream *&f, std::string &filename, std::vector< std::string > args, size_t argidx)
 
void extra_args (std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
 
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)
 

Static Public Member Functions

static void frontend_call (RTLIL::Design *design, std::istream *f, std::string filename, std::string command)
 
static void frontend_call (RTLIL::Design *design, std::istream *f, std::string filename, std::vector< std::string > args)
 
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 frontend_name
 
std::string pass_name
 
std::string short_help
 
int call_counter
 
int64_t runtime_ns
 
Passnext_queued_pass
 

Static Public Attributes

static FILE * current_script_file = NULL
 
static std::string last_here_document
 
static std::vector< std::string > next_args
 

Detailed Description

Definition at line 404 of file liberty.cc.

Constructor & Destructor Documentation

LibertyFrontend::LibertyFrontend ( )
inline

Definition at line 405 of file liberty.cc.

405 : Frontend("liberty", "read cells from liberty file") { }
Frontend(std::string name, std::string short_help="** document me **")
Definition: register.cc:266

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:

void Frontend::execute ( std::vector< std::string >  args,
RTLIL::Design design 
)
virtualinherited

Implements Pass.

Definition at line 285 of file register.cc.

286 {
287  log_assert(next_args.empty());
288  do {
289  std::istream *f = NULL;
290  next_args.clear();
291  auto state = pre_execute();
292  execute(f, std::string(), args, design);
293  post_execute(state);
294  args = next_args;
295  delete f;
296  } while (!args.empty());
297 }
static std::vector< std::string > next_args
Definition: register.h:79
#define log_assert(_assert_expr_)
Definition: log.h:85
virtual void execute(std::vector< std::string > args, RTLIL::Design *design) YS_OVERRIDE YS_FINAL
Definition: register.cc:285
#define NULL
pre_post_exec_state_t pre_execute()
Definition: register.cc:74
void post_execute(pre_post_exec_state_t state)
Definition: register.cc:84

+ Here is the call graph for this function:

virtual void LibertyFrontend::execute ( std::istream *&  f,
std::string  filename,
std::vector< std::string >  args,
RTLIL::Design design 
)
inlinevirtual

Implements Frontend.

Definition at line 432 of file liberty.cc.

433  {
434  bool flag_lib = false;
435  bool flag_ignore_redef = false;
436  bool flag_ignore_miss_func = false;
437  bool flag_ignore_miss_dir = false;
438  std::vector<std::string> attributes;
439 
440  log_header("Executing Liberty frontend.\n");
441 
442  size_t argidx;
443  for (argidx = 1; argidx < args.size(); argidx++) {
444  std::string arg = args[argidx];
445  if (arg == "-lib") {
446  flag_lib = true;
447  continue;
448  }
449  if (arg == "-ignore_redef") {
450  flag_ignore_redef = true;
451  continue;
452  }
453  if (arg == "-ignore_miss_func") {
454  flag_ignore_miss_func = true;
455  continue;
456  }
457  if (arg == "-ignore_miss_dir") {
458  flag_ignore_miss_dir = true;
459  continue;
460  }
461  if (arg == "-setattr" && argidx+1 < args.size()) {
462  attributes.push_back(RTLIL::escape_id(args[++argidx]));
463  continue;
464  }
465  break;
466  }
467  extra_args(f, filename, args, argidx);
468 
469  LibertyParser parser(*f);
470  int cell_count = 0;
471 
472  for (auto cell : parser.ast->children)
473  {
474  if (cell->id != "cell" || cell->args.size() != 1)
475  continue;
476 
477  std::string cell_name = RTLIL::escape_id(cell->args.at(0));
478 
479  if (design->has(cell_name)) {
480  if (flag_ignore_redef)
481  continue;
482  log_error("Duplicate definition of cell/module %s.\n", RTLIL::unescape_id(cell_name).c_str());
483  }
484 
485  // log("Processing cell type %s.\n", RTLIL::unescape_id(cell_name).c_str());
486 
488  module->name = cell_name;
489 
490  if (flag_lib)
491  module->set_bool_attribute("\\blackbox");
492 
493  for (auto &attr : attributes)
494  module->attributes[attr] = 1;
495 
496  for (auto node : cell->children)
497  if (node->id == "pin" && node->args.size() == 1) {
498  LibertyAst *dir = node->find("direction");
499  if (!dir || (dir->value != "input" && dir->value != "output" && dir->value != "inout" && dir->value != "internal"))
500  {
501  if (!flag_ignore_miss_dir)
502  {
503  log_error("Missing or invalid direction for pin %s of cell %s.\n", node->args.at(0).c_str(), log_id(module->name));
504  } else {
505  log("Ignoring cell %s with missing or invalid direction for pin %s.\n", log_id(module->name), node->args.at(0).c_str());
506  delete module;
507  goto skip_cell;
508  }
509  }
510  if (!flag_lib || dir->value != "internal")
511  module->addWire(RTLIL::escape_id(node->args.at(0)));
512  }
513 
514  for (auto node : cell->children)
515  {
516  if (!flag_lib) {
517  if (node->id == "ff" && node->args.size() == 2)
518  create_ff(module, node);
519  if (node->id == "latch" && node->args.size() == 2)
520  create_latch(module, node);
521  }
522 
523  if (node->id == "pin" && node->args.size() == 1)
524  {
525  LibertyAst *dir = node->find("direction");
526 
527  if (flag_lib && dir->value == "internal")
528  continue;
529 
530  RTLIL::Wire *wire = module->wires_.at(RTLIL::escape_id(node->args.at(0)));
531 
532  if (dir && dir->value == "inout") {
533  wire->port_input = true;
534  wire->port_output = true;
535  }
536 
537  if (dir && dir->value == "input") {
538  wire->port_input = true;
539  continue;
540  }
541 
542  if (dir && dir->value == "output")
543  wire->port_output = true;
544 
545  if (flag_lib)
546  continue;
547 
548  LibertyAst *func = node->find("function");
549  if (func == NULL)
550  {
551  if (!flag_ignore_miss_func)
552  {
553  log_error("Missing function on output %s of cell %s.\n", log_id(wire->name), log_id(module->name));
554  } else {
555  log("Ignoring cell %s with missing function on output %s.\n", log_id(module->name), log_id(wire->name));
556  delete module;
557  goto skip_cell;
558  }
559  }
560 
561  RTLIL::SigSpec out_sig = parse_func_expr(module, func->value.c_str());
562  module->connect(RTLIL::SigSig(wire, out_sig));
563  }
564  }
565 
566  module->fixup_ports();
567  design->add(module);
568  cell_count++;
569 skip_cell:;
570  }
571 
572  log("Imported %d cell types from liberty file.\n", cell_count);
573  }
bool flag_lib
Definition: ast.cc:56
void add(RTLIL::Module *module)
Definition: rtlil.cc:259
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
bool port_input
Definition: rtlil.h:827
void log_error(const char *format,...)
Definition: log.cc:204
RTLIL::Module * module
Definition: abc.cc:94
static void create_latch(RTLIL::Module *module, LibertyAst *node)
Definition: liberty.cc:293
static void create_ff(RTLIL::Module *module, LibertyAst *node)
Definition: liberty.cc:216
static std::string escape_id(std::string str)
Definition: rtlil.h:251
bool port_output
Definition: rtlil.h:827
void connect(const RTLIL::SigSig &conn)
Definition: rtlil.cc:1278
static RTLIL::SigSpec parse_func_expr(RTLIL::Module *module, const char *expr)
Definition: liberty.cc:178
void fixup_ports()
Definition: rtlil.cc:1312
RTLIL::Wire * addWire(RTLIL::IdString name, int width=1)
Definition: rtlil.cc:1331
RTLIL::IdString name
Definition: rtlil.h:599
RTLIL::IdString name
Definition: rtlil.h:825
bool has(RTLIL::IdString id) const
Definition: rtlil.h:519
#define NULL
void log(const char *format,...)
Definition: log.cc:180
std::pair< SigSpec, SigSpec > SigSig
Definition: rtlil.h:71
const char * log_id(RTLIL::IdString str)
Definition: log.cc:283
void extra_args(std::istream *&f, std::string &filename, std::vector< std::string > args, size_t argidx)
Definition: register.cc:302

+ 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:

void Frontend::extra_args ( std::istream *&  f,
std::string &  filename,
std::vector< std::string >  args,
size_t  argidx 
)
inherited

Definition at line 302 of file register.cc.

303 {
304  bool called_with_fp = f != NULL;
305 
306  next_args.clear();
307  for (; argidx < args.size(); argidx++)
308  {
309  std::string arg = args[argidx];
310 
311  if (arg.substr(0, 1) == "-")
312  cmd_error(args, argidx, "Unknown option or option in arguments.");
313  if (f != NULL)
314  cmd_error(args, argidx, "Extra filename argument in direct file mode.");
315 
316  filename = arg;
317  if (filename == "<<" && argidx+1 < args.size())
318  filename += args[++argidx];
319  if (filename.substr(0, 2) == "<<") {
321  log_error("Unexpected here document '%s' outside of script!\n", filename.c_str());
322  if (filename.size() <= 2)
323  log_error("Missing EOT marker in here document!\n");
324  std::string eot_marker = filename.substr(2);
325  last_here_document.clear();
326  while (1) {
327  std::string buffer;
328  char block[4096];
329  while (1) {
330  if (fgets(block, 4096, Frontend::current_script_file) == NULL)
331  log_error("Unexpected end of file in here document '%s'!\n", filename.c_str());
332  buffer += block;
333  if (buffer.size() > 0 && (buffer[buffer.size() - 1] == '\n' || buffer[buffer.size() - 1] == '\r'))
334  break;
335  }
336  size_t indent = buffer.find_first_not_of(" \t\r\n");
337  if (indent != std::string::npos && buffer.substr(indent, eot_marker.size()) == eot_marker)
338  break;
339  last_here_document += buffer;
340  }
341  f = new std::istringstream(last_here_document);
342  } else {
343  if (filename.substr(0, 2) == "+/")
344  filename = proc_share_dirname() + filename.substr(1);
345  std::ifstream *ff = new std::ifstream;
346  ff->open(filename.c_str());
347  if (ff->fail())
348  delete ff;
349  else
350  f = ff;
351  }
352  if (f == NULL)
353  log_cmd_error("Can't open input file `%s' for reading: %s\n", filename.c_str(), strerror(errno));
354 
355  for (size_t i = argidx+1; i < args.size(); i++)
356  if (args[i].substr(0, 1) == "-")
357  cmd_error(args, i, "Found option, expected arguments.");
358 
359  if (argidx+1 < args.size()) {
360  next_args.insert(next_args.begin(), args.begin(), args.begin()+argidx);
361  next_args.insert(next_args.begin()+argidx, args.begin()+argidx+1, args.end());
362  args.erase(args.begin()+argidx+1, args.end());
363  }
364  break;
365  }
366  if (f == NULL)
367  cmd_error(args, argidx, "No filename given.");
368 
369  if (called_with_fp)
370  args.push_back(filename);
371  args[0] = pass_name;
372  // cmd_log_args(args);
373 }
void cmd_error(const std::vector< std::string > &args, size_t argidx, std::string msg)
Definition: register.cc:110
static std::string last_here_document
Definition: register.h:70
void log_error(const char *format,...)
Definition: log.cc:204
static FILE * current_script_file
Definition: register.h:69
std::string pass_name
Definition: register.h:29
static std::vector< std::string > next_args
Definition: register.h:79
void log_cmd_error(const char *format,...)
Definition: log.cc:211
#define NULL
std::string proc_share_dirname()
Definition: yosys.cc:543

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Frontend::frontend_call ( RTLIL::Design design,
std::istream *  f,
std::string  filename,
std::string  command 
)
staticinherited

Definition at line 375 of file register.cc.

376 {
377  std::vector<std::string> args;
378  char *s = strdup(command.c_str());
379  for (char *p = strtok(s, " \t\r\n"); p; p = strtok(NULL, " \t\r\n"))
380  args.push_back(p);
381  free(s);
382  frontend_call(design, f, filename, args);
383 }
void free(void *)
static void frontend_call(RTLIL::Design *design, std::istream *f, std::string filename, std::string command)
Definition: register.cc:375
#define NULL

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Frontend::frontend_call ( RTLIL::Design design,
std::istream *  f,
std::string  filename,
std::vector< std::string >  args 
)
staticinherited

Definition at line 385 of file register.cc.

386 {
387  if (args.size() == 0)
388  return;
389  if (frontend_register.count(args[0]) == 0)
390  log_cmd_error("No such frontend: %s\n", args[0].c_str());
391 
392  if (f != NULL) {
393  auto state = frontend_register[args[0]]->pre_execute();
394  frontend_register[args[0]]->execute(f, filename, args, design);
395  frontend_register[args[0]]->post_execute(state);
396  } else if (filename == "-") {
397  std::istream *f_cin = &std::cin;
398  auto state = frontend_register[args[0]]->pre_execute();
399  frontend_register[args[0]]->execute(f_cin, "<stdin>", args, design);
400  frontend_register[args[0]]->post_execute(state);
401  } else {
402  if (!filename.empty())
403  args.push_back(filename);
404  frontend_register[args[0]]->execute(args, design);
405  }
406 
407  design->check();
408 }
std::map< std::string, Frontend * > frontend_register
Definition: register.cc:34
void check()
Definition: rtlil.cc:357
void log_cmd_error(const char *format,...)
Definition: log.cc:211
#define NULL

+ Here is the call graph for this function:

virtual void LibertyFrontend::help ( )
inlinevirtual

Reimplemented from Pass.

Definition at line 406 of file liberty.cc.

407  {
408  // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
409  log("\n");
410  log(" read_liberty [filename]\n");
411  log("\n");
412  log("Read cells from liberty file as modules into current design.\n");
413  log("\n");
414  log(" -lib\n");
415  log(" only create empty blackbox modules\n");
416  log("\n");
417  log(" -ignore_redef\n");
418  log(" ignore re-definitions of modules. (the default behavior is to\n");
419  log(" create an error message.)\n");
420  log("\n");
421  log(" -ignore_miss_func\n");
422  log(" ignore cells with missing function specification of outputs\n");
423  log("\n");
424  log(" -ignore_miss_dir\n");
425  log(" ignore cells with a missing or invalid direction\n");
426  log(" specification on a pin\n");
427  log("\n");
428  log(" -setattr <attribute_name>\n");
429  log(" set the specified attribute (to the value 1) on all loaded modules\n");
430  log("\n");
431  }
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 Frontend::run_register ( )
virtualinherited

Reimplemented from Pass.

Definition at line 272 of file register.cc.

273 {
274  log_assert(pass_register.count(pass_name) == 0);
275  pass_register[pass_name] = this;
276 
279 }
std::map< std::string, Frontend * > frontend_register
Definition: register.cc:34
std::string frontend_name
Definition: register.h:72
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

Field Documentation

int Pass::call_counter
inherited

Definition at line 36 of file register.h.

FILE * Frontend::current_script_file = NULL
staticinherited

Definition at line 69 of file register.h.

std::string Frontend::frontend_name
inherited

Definition at line 72 of file register.h.

std::string Frontend::last_here_document
staticinherited

Definition at line 70 of file register.h.

std::vector< std::string > Frontend::next_args
staticinherited

Definition at line 79 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: