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

Public Member Functions

 TechmapPass ()
 
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 763 of file techmap.cc.

Constructor & Destructor Documentation

TechmapPass::TechmapPass ( )
inline

Definition at line 764 of file techmap.cc.

764 : Pass("techmap", "generic technology mapper") { }
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 TechmapPass::execute ( std::vector< std::string >  args,
RTLIL::Design design 
)
inlinevirtual

Implements Pass.

Definition at line 901 of file techmap.cc.

902  {
903  log_header("Executing TECHMAP pass (map to technology primitives).\n");
904  log_push();
905 
906  TechmapWorker worker;
908 
909  std::vector<std::string> map_files;
910  std::string verilog_frontend = "verilog -ignore_redef";
911  int max_iter = -1;
912 
913  size_t argidx;
914  for (argidx = 1; argidx < args.size(); argidx++) {
915  if (args[argidx] == "-map" && argidx+1 < args.size()) {
916  if (args[argidx+1].substr(0, 2) == "+/")
917  map_files.push_back(proc_share_dirname() + args[++argidx].substr(2));
918  else
919  map_files.push_back(args[++argidx]);
920  continue;
921  }
922  if (args[argidx] == "-share_map" && argidx+1 < args.size()) {
923  map_files.push_back(proc_share_dirname() + args[++argidx]);
924  continue;
925  }
926  if (args[argidx] == "-max_iter" && argidx+1 < args.size()) {
927  max_iter = atoi(args[++argidx].c_str());
928  continue;
929  }
930  if (args[argidx] == "-D" && argidx+1 < args.size()) {
931  verilog_frontend += " -D " + args[++argidx];
932  continue;
933  }
934  if (args[argidx] == "-I" && argidx+1 < args.size()) {
935  verilog_frontend += " -I " + args[++argidx];
936  continue;
937  }
938  if (args[argidx] == "-assert") {
939  worker.assert_mode = true;
940  continue;
941  }
942  if (args[argidx] == "-extern") {
943  worker.extern_mode = true;
944  continue;
945  }
946  if (args[argidx] == "-recursive") {
947  worker.recursive_mode = true;
948  continue;
949  }
950  if (args[argidx] == "-autoproc") {
951  worker.autoproc_mode = true;
952  continue;
953  }
954  break;
955  }
956  extra_args(args, argidx, design);
957 
958  RTLIL::Design *map = new RTLIL::Design;
959  if (map_files.empty()) {
960  std::istringstream f(stdcells_code);
961  Frontend::frontend_call(map, &f, "<techmap.v>", verilog_frontend);
962  } else
963  for (auto &fn : map_files)
964  if (fn.substr(0, 1) == "%") {
965  if (!saved_designs.count(fn.substr(1))) {
966  delete map;
967  log_cmd_error("Can't saved design `%s'.\n", fn.c_str()+1);
968  }
969  for (auto mod : saved_designs.at(fn.substr(1))->modules())
970  if (!map->has(mod->name))
971  map->add(mod->clone());
972  } else {
973  std::ifstream f;
974  f.open(fn.c_str());
975  if (f.fail())
976  log_cmd_error("Can't open map file `%s'\n", fn.c_str());
977  Frontend::frontend_call(map, &f, fn, (fn.size() > 3 && fn.substr(fn.size()-3) == ".il") ? "ilang" : verilog_frontend);
978  }
979 
980  std::map<RTLIL::IdString, RTLIL::Module*> modules_new;
981  for (auto &it : map->modules_) {
982  if (it.first.substr(0, 2) == "\\$")
983  it.second->name = it.first.substr(1);
984  modules_new[it.second->name] = it.second;
985  }
986  map->modules_.swap(modules_new);
987 
988  std::map<RTLIL::IdString, std::set<RTLIL::IdString, RTLIL::sort_by_id_str>> celltypeMap;
989  for (auto &it : map->modules_) {
990  if (it.second->attributes.count("\\techmap_celltype") && !it.second->attributes.at("\\techmap_celltype").bits.empty()) {
991  char *p = strdup(it.second->attributes.at("\\techmap_celltype").decode_string().c_str());
992  for (char *q = strtok(p, " \t\r\n"); q; q = strtok(NULL, " \t\r\n"))
993  celltypeMap[RTLIL::escape_id(q)].insert(it.first);
994  free(p);
995  } else
996  celltypeMap[it.first].insert(it.first);
997  }
998 
999  for (auto module : design->modules())
1000  worker.module_queue.insert(module);
1001 
1002  while (!worker.module_queue.empty())
1003  {
1004  RTLIL::Module *module = *worker.module_queue.begin();
1005  worker.module_queue.erase(module);
1006 
1007  bool did_something = true;
1008  std::set<RTLIL::Cell*> handled_cells;
1009  while (did_something) {
1010  did_something = false;
1011  if (worker.techmap_module(design, module, map, handled_cells, celltypeMap, false))
1012  did_something = true;
1013  if (did_something)
1014  module->check();
1015  if (max_iter > 0 && --max_iter == 0)
1016  break;
1017  }
1018  }
1019 
1020  log("No more expansions possible.\n");
1021  delete map;
1022 
1023  log_pop();
1024  }
bool recursive_mode
Definition: techmap.cc:82
std::set< RTLIL::Module *, RTLIL::IdString::compare_ptr_by_name< RTLIL::Module > > module_queue
Definition: techmap.cc:70
void free(void *)
void add(RTLIL::Module *module)
Definition: rtlil.cc:259
void log_header(const char *format,...)
Definition: log.cc:188
static void frontend_call(RTLIL::Design *design, std::istream *f, std::string filename, std::string command)
Definition: register.cc:375
std::map< RTLIL::IdString, void(*)(RTLIL::Module *, RTLIL::Cell *)> simplemap_mappers
Definition: techmap.cc:67
RTLIL::Module * module
Definition: abc.cc:94
void log_pop()
Definition: log.cc:237
virtual void check()
Definition: rtlil.cc:948
YOSYS_NAMESPACE_BEGIN void simplemap_get_mappers(std::map< RTLIL::IdString, void(*)(RTLIL::Module *, RTLIL::Cell *)> &mappers)
Definition: simplemap.cc:403
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
std::map< std::string, RTLIL::Design * > saved_designs
Definition: design.cc:27
bool techmap_module(RTLIL::Design *design, RTLIL::Module *module, RTLIL::Design *map, std::set< RTLIL::Cell * > &handled_cells, const std::map< RTLIL::IdString, std::set< RTLIL::IdString, RTLIL::sort_by_id_str >> &celltypeMap, bool in_recursion)
Definition: techmap.cc:271
bool assert_mode
Definition: techmap.cc:80
void log_cmd_error(const char *format,...)
Definition: log.cc:211
bool has(RTLIL::IdString id) const
Definition: rtlil.h:519
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
bool extern_mode
Definition: techmap.cc:79
void log_push()
Definition: log.cc:232
std::string proc_share_dirname()
Definition: yosys.cc:543
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
Definition: register.cc:128
bool autoproc_mode
Definition: techmap.cc:83

+ 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 TechmapPass::help ( )
inlinevirtual

Reimplemented from Pass.

Definition at line 765 of file techmap.cc.

766  {
767  // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
768  log("\n");
769  log(" techmap [-map filename] [selection]\n");
770  log("\n");
771  log("This pass implements a very simple technology mapper that replaces cells in\n");
772  log("the design with implementations given in form of a verilog or ilang source\n");
773  log("file.\n");
774  log("\n");
775  log(" -map filename\n");
776  log(" the library of cell implementations to be used.\n");
777  log(" without this parameter a builtin library is used that\n");
778  log(" transforms the internal RTL cells to the internal gate\n");
779  log(" library.\n");
780  log("\n");
781  log(" -map %%<design-name>\n");
782  log(" like -map above, but with an in-memory design instead of a file.\n");
783  log("\n");
784  log(" -share_map filename\n");
785  log(" like -map, but look for the file in the share directory (where the\n");
786  log(" yosys data files are). this is mainly used internally when techmap\n");
787  log(" is called from other commands.\n");
788  log("\n");
789  log(" -extern\n");
790  log(" load the cell implementations as separate modules into the design\n");
791  log(" instead of inlining them.\n");
792  log("\n");
793  log(" -max_iter <number>\n");
794  log(" only run the specified number of iterations.\n");
795  log("\n");
796  log(" -recursive\n");
797  log(" instead of the iterative breadth-first algorithm use a recursive\n");
798  log(" depth-first algorithm. both methods should yield equivialent results,\n");
799  log(" but may differ in performance.\n");
800  log("\n");
801  log(" -autoproc\n");
802  log(" Automatically call \"proc\" on implementations that contain processes.\n");
803  log("\n");
804  log(" -assert\n");
805  log(" this option will cause techmap to exit with an error if it can't map\n");
806  log(" a selected cell. only cell types that end on an underscore are accepted\n");
807  log(" as final cell types by this mode.\n");
808  log("\n");
809  log(" -D <define>, -I <incdir>\n");
810  log(" this options are passed as-is to the verilog frontend for loading the\n");
811  log(" map file. Note that the verilog frontend is also called with the\n");
812  log(" '-ignore_redef' option set.\n");
813  log("\n");
814  log("When a module in the map file has the 'techmap_celltype' attribute set, it will\n");
815  log("match cells with a type that match the text value of this attribute. Otherwise\n");
816  log("the module name will be used to match the cell.\n");
817  log("\n");
818  log("When a module in the map file has the 'techmap_simplemap' attribute set, techmap\n");
819  log("will use 'simplemap' (see 'help simplemap') to map cells matching the module.\n");
820  log("\n");
821  log("When a module in the map file has the 'techmap_maccmap' attribute set, techmap\n");
822  log("will use 'maccmap' (see 'help maccmap') to map cells matching the module.\n");
823  log("\n");
824  log("When a module in the map file has the 'techmap_wrap' attribute set, techmap\n");
825  log("will create a wrapper for the cell and then run the command string that the\n");
826  log("attribute is set to on the wrapper module.\n");
827  log("\n");
828  log("All wires in the modules from the map file matching the pattern _TECHMAP_*\n");
829  log("or *._TECHMAP_* are special wires that are used to pass instructions from\n");
830  log("the mapping module to the techmap command. At the moment the following special\n");
831  log("wires are supported:\n");
832  log("\n");
833  log(" _TECHMAP_FAIL_\n");
834  log(" When this wire is set to a non-zero constant value, techmap will not\n");
835  log(" use this module and instead try the next module with a matching\n");
836  log(" 'techmap_celltype' attribute.\n");
837  log("\n");
838  log(" When such a wire exists but does not have a constant value after all\n");
839  log(" _TECHMAP_DO_* commands have been executed, an error is generated.\n");
840  log("\n");
841  log(" _TECHMAP_DO_*\n");
842  log(" This wires are evaluated in alphabetical order. The constant text value\n");
843  log(" of this wire is a yosys command (or sequence of commands) that is run\n");
844  log(" by techmap on the module. A common use case is to run 'proc' on modules\n");
845  log(" that are written using always-statements.\n");
846  log("\n");
847  log(" When such a wire has a non-constant value at the time it is to be\n");
848  log(" evaluated, an error is produced. That means it is possible for such a\n");
849  log(" wire to start out as non-constant and evaluate to a constant value\n");
850  log(" during processing of other _TECHMAP_DO_* commands.\n");
851  log("\n");
852  log(" A _TECHMAP_DO_* command may start with the special token 'CONSTMAP; '.\n");
853  log(" in this case techmap will create a copy for each distinct configuration\n");
854  log(" of constant inputs and shorted inputs at this point and import the\n");
855  log(" constant and connected bits into the map module. All further commands\n");
856  log(" are executed in this copy. This is a very convenient way of creating\n");
857  log(" optimizied specializations of techmap modules without using the special\n");
858  log(" parameters described below.\n");
859  log("\n");
860  log(" A _TECHMAP_DO_* command may start with the special token 'RECURSION; '.\n");
861  log(" then techmap will recursively replace the cells in the module with their\n");
862  log(" implementation. This is not affected by the -max_iter option.\n");
863  log("\n");
864  log(" It is possible to combine both prefixes to 'RECURSION; CONSTMAP; '.\n");
865  log("\n");
866  log("In addition to this special wires, techmap also supports special parameters in\n");
867  log("modules in the map file:\n");
868  log("\n");
869  log(" _TECHMAP_CELLTYPE_\n");
870  log(" When a parameter with this name exists, it will be set to the type name\n");
871  log(" of the cell that matches the module.\n");
872  log("\n");
873  log(" _TECHMAP_CONSTMSK_<port-name>_\n");
874  log(" _TECHMAP_CONSTVAL_<port-name>_\n");
875  log(" When this pair of parameters is available in a module for a port, then\n");
876  log(" former has a 1-bit for each constant input bit and the latter has the\n");
877  log(" value for this bit. The unused bits of the latter are set to undef (x).\n");
878  log("\n");
879  log(" _TECHMAP_BITS_CONNMAP_\n");
880  log(" _TECHMAP_CONNMAP_<port-name>_\n");
881  log(" For an N-bit port, the _TECHMAP_CONNMAP_<port-name>_ parameter, if it\n");
882  log(" exists, will be set to an N*_TECHMAP_BITS_CONNMAP_ bit vector containing\n");
883  log(" N words (of _TECHMAP_BITS_CONNMAP_ bits each) that assign each single\n");
884  log(" bit driver a unique id. The values 0-3 are reserved for 0, 1, x, and z.\n");
885  log(" This can be used to detect shorted inputs.\n");
886  log("\n");
887  log("When a module in the map file has a parameter where the according cell in the\n");
888  log("design has a port, the module from the map file is only used if the port in\n");
889  log("the design is connected to a constant value. The parameter is then set to the\n");
890  log("constant value.\n");
891  log("\n");
892  log("A cell with the name _TECHMAP_REPLACE_ in the map file will inherit the name\n");
893  log("of the cell that is beeing replaced.\n");
894  log("\n");
895  log("See 'help extract' for a pass that does the opposite thing.\n");
896  log("\n");
897  log("See 'help flatten' for a pass that does flatten the design (which is\n");
898  log("esentially techmap but using the design itself as map library).\n");
899  log("\n");
900  }
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: