yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ilang_backend.cc
Go to the documentation of this file.
1 /*
2  * yosys -- Yosys Open SYnthesis Suite
3  *
4  * Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  *
18  * ---
19  *
20  * A very simple and straightforward backend for the RTLIL text
21  * representation (as understood by the 'ilang' frontend).
22  *
23  */
24 
25 #include "ilang_backend.h"
26 #include "kernel/yosys.h"
27 #include <errno.h>
28 
30 using namespace ILANG_BACKEND;
32 
33 void ILANG_BACKEND::dump_const(std::ostream &f, const RTLIL::Const &data, int width, int offset, bool autoint)
34 {
35  if (width < 0)
36  width = data.bits.size() - offset;
37  if ((data.flags & RTLIL::CONST_FLAG_STRING) == 0 || width != (int)data.bits.size()) {
38  if (width == 32 && autoint) {
39  int32_t val = 0;
40  for (int i = 0; i < width; i++) {
41  log_assert(offset+i < (int)data.bits.size());
42  switch (data.bits[offset+i]) {
43  case RTLIL::S0: break;
44  case RTLIL::S1: val |= 1 << i; break;
45  default: val = -1; break;
46  }
47  }
48  if (val >= 0) {
49  f << stringf("%d", val);
50  return;
51  }
52  }
53  f << stringf("%d'", width);
54  for (int i = offset+width-1; i >= offset; i--) {
55  log_assert(i < (int)data.bits.size());
56  switch (data.bits[i]) {
57  case RTLIL::S0: f << stringf("0"); break;
58  case RTLIL::S1: f << stringf("1"); break;
59  case RTLIL::Sx: f << stringf("x"); break;
60  case RTLIL::Sz: f << stringf("z"); break;
61  case RTLIL::Sa: f << stringf("-"); break;
62  case RTLIL::Sm: f << stringf("m"); break;
63  }
64  }
65  } else {
66  f << stringf("\"");
67  std::string str = data.decode_string();
68  for (size_t i = 0; i < str.size(); i++) {
69  if (str[i] == '\n')
70  f << stringf("\\n");
71  else if (str[i] == '\t')
72  f << stringf("\\t");
73  else if (str[i] < 32)
74  f << stringf("\\%03o", str[i]);
75  else if (str[i] == '"')
76  f << stringf("\\\"");
77  else if (str[i] == '\\')
78  f << stringf("\\\\");
79  else
80  f << str[i];
81  }
82  f << stringf("\"");
83  }
84 }
85 
86 void ILANG_BACKEND::dump_sigchunk(std::ostream &f, const RTLIL::SigChunk &chunk, bool autoint)
87 {
88  if (chunk.wire == NULL) {
89  dump_const(f, chunk.data, chunk.width, chunk.offset, autoint);
90  } else {
91  if (chunk.width == chunk.wire->width && chunk.offset == 0)
92  f << stringf("%s", chunk.wire->name.c_str());
93  else if (chunk.width == 1)
94  f << stringf("%s [%d]", chunk.wire->name.c_str(), chunk.offset);
95  else
96  f << stringf("%s [%d:%d]", chunk.wire->name.c_str(), chunk.offset+chunk.width-1, chunk.offset);
97  }
98 }
99 
100 void ILANG_BACKEND::dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig, bool autoint)
101 {
102  if (sig.is_chunk()) {
103  dump_sigchunk(f, sig.as_chunk(), autoint);
104  } else {
105  f << stringf("{ ");
106  for (auto it = sig.chunks().rbegin(); it != sig.chunks().rend(); it++) {
107  dump_sigchunk(f, *it, false);
108  f << stringf(" ");
109  }
110  f << stringf("}");
111  }
112 }
113 
114 void ILANG_BACKEND::dump_wire(std::ostream &f, std::string indent, const RTLIL::Wire *wire)
115 {
116  std::map<RTLIL::IdString, RTLIL::Const, RTLIL::sort_by_id_str> sorted_attributes(wire->attributes.begin(), wire->attributes.end());
117 
118  for (auto it = sorted_attributes.begin(); it != sorted_attributes.end(); it++) {
119  f << stringf("%s" "attribute %s ", indent.c_str(), it->first.c_str());
120  dump_const(f, it->second);
121  f << stringf("\n");
122  }
123  f << stringf("%s" "wire ", indent.c_str());
124  if (wire->width != 1)
125  f << stringf("width %d ", wire->width);
126  if (wire->upto)
127  f << stringf("upto ");
128  if (wire->start_offset != 0)
129  f << stringf("offset %d ", wire->start_offset);
130  if (wire->port_input && !wire->port_output)
131  f << stringf("input %d ", wire->port_id);
132  if (!wire->port_input && wire->port_output)
133  f << stringf("output %d ", wire->port_id);
134  if (wire->port_input && wire->port_output)
135  f << stringf("inout %d ", wire->port_id);
136  f << stringf("%s\n", wire->name.c_str());
137 }
138 
139 void ILANG_BACKEND::dump_memory(std::ostream &f, std::string indent, const RTLIL::Memory *memory)
140 {
141  std::map<RTLIL::IdString, RTLIL::Const, RTLIL::sort_by_id_str> sorted_attributes(memory->attributes.begin(), memory->attributes.end());
142 
143  for (auto it = sorted_attributes.begin(); it != sorted_attributes.end(); it++) {
144  f << stringf("%s" "attribute %s ", indent.c_str(), it->first.c_str());
145  dump_const(f, it->second);
146  f << stringf("\n");
147  }
148  f << stringf("%s" "memory ", indent.c_str());
149  if (memory->width != 1)
150  f << stringf("width %d ", memory->width);
151  if (memory->size != 0)
152  f << stringf("size %d ", memory->size);
153  f << stringf("%s\n", memory->name.c_str());
154 }
155 
156 void ILANG_BACKEND::dump_cell(std::ostream &f, std::string indent, const RTLIL::Cell *cell)
157 {
158  std::map<RTLIL::IdString, RTLIL::Const, RTLIL::sort_by_id_str> sorted_attributes(cell->attributes.begin(), cell->attributes.end());
159  std::map<RTLIL::IdString, RTLIL::Const, RTLIL::sort_by_id_str> sorted_parameters(cell->parameters.begin(), cell->parameters.end());
160  std::map<RTLIL::IdString, RTLIL::SigSpec, RTLIL::sort_by_id_str> sorted_connections(cell->connections().begin(), cell->connections().end());
161 
162  for (auto it = sorted_attributes.begin(); it != sorted_attributes.end(); it++) {
163  f << stringf("%s" "attribute %s ", indent.c_str(), it->first.c_str());
164  dump_const(f, it->second);
165  f << stringf("\n");
166  }
167  f << stringf("%s" "cell %s %s\n", indent.c_str(), cell->type.c_str(), cell->name.c_str());
168  for (auto it = sorted_parameters.begin(); it != sorted_parameters.end(); it++) {
169  f << stringf("%s parameter%s %s ", indent.c_str(), (it->second.flags & RTLIL::CONST_FLAG_SIGNED) != 0 ? " signed" : "", it->first.c_str());
170  dump_const(f, it->second);
171  f << stringf("\n");
172  }
173  for (auto it = sorted_connections.begin(); it != sorted_connections.end(); it++) {
174  f << stringf("%s connect %s ", indent.c_str(), it->first.c_str());
175  dump_sigspec(f, it->second);
176  f << stringf("\n");
177  }
178  f << stringf("%s" "end\n", indent.c_str());
179 }
180 
181 void ILANG_BACKEND::dump_proc_case_body(std::ostream &f, std::string indent, const RTLIL::CaseRule *cs)
182 {
183  for (auto it = cs->actions.begin(); it != cs->actions.end(); it++)
184  {
185  f << stringf("%s" "assign ", indent.c_str());
186  dump_sigspec(f, it->first);
187  f << stringf(" ");
188  dump_sigspec(f, it->second);
189  f << stringf("\n");
190  }
191 
192  for (auto it = cs->switches.begin(); it != cs->switches.end(); it++)
193  dump_proc_switch(f, indent, *it);
194 }
195 
196 void ILANG_BACKEND::dump_proc_switch(std::ostream &f, std::string indent, const RTLIL::SwitchRule *sw)
197 {
198  for (auto it = sw->attributes.begin(); it != sw->attributes.end(); it++) {
199  f << stringf("%s" "attribute %s ", indent.c_str(), it->first.c_str());
200  dump_const(f, it->second);
201  f << stringf("\n");
202  }
203 
204  f << stringf("%s" "switch ", indent.c_str());
205  dump_sigspec(f, sw->signal);
206  f << stringf("\n");
207 
208  for (auto it = sw->cases.begin(); it != sw->cases.end(); it++)
209  {
210  f << stringf("%s case ", indent.c_str());
211  for (size_t i = 0; i < (*it)->compare.size(); i++) {
212  if (i > 0)
213  f << stringf(", ");
214  dump_sigspec(f, (*it)->compare[i]);
215  }
216  f << stringf("\n");
217 
218  dump_proc_case_body(f, indent + " ", *it);
219  }
220 
221  f << stringf("%s" "end\n", indent.c_str());
222 }
223 
224 void ILANG_BACKEND::dump_proc_sync(std::ostream &f, std::string indent, const RTLIL::SyncRule *sy)
225 {
226  f << stringf("%s" "sync ", indent.c_str());
227  switch (sy->type) {
228  if (0) case RTLIL::ST0: f << stringf("low ");
229  if (0) case RTLIL::ST1: f << stringf("high ");
230  if (0) case RTLIL::STp: f << stringf("posedge ");
231  if (0) case RTLIL::STn: f << stringf("negedge ");
232  if (0) case RTLIL::STe: f << stringf("edge ");
233  dump_sigspec(f, sy->signal);
234  f << stringf("\n");
235  break;
236  case RTLIL::STa: f << stringf("always\n"); break;
237  case RTLIL::STi: f << stringf("init\n"); break;
238  }
239 
240  for (auto it = sy->actions.begin(); it != sy->actions.end(); it++) {
241  f << stringf("%s update ", indent.c_str());
242  dump_sigspec(f, it->first);
243  f << stringf(" ");
244  dump_sigspec(f, it->second);
245  f << stringf("\n");
246  }
247 }
248 
249 void ILANG_BACKEND::dump_proc(std::ostream &f, std::string indent, const RTLIL::Process *proc)
250 {
251  for (auto it = proc->attributes.begin(); it != proc->attributes.end(); it++) {
252  f << stringf("%s" "attribute %s ", indent.c_str(), it->first.c_str());
253  dump_const(f, it->second);
254  f << stringf("\n");
255  }
256  f << stringf("%s" "process %s\n", indent.c_str(), proc->name.c_str());
257  dump_proc_case_body(f, indent + " ", &proc->root_case);
258  for (auto it = proc->syncs.begin(); it != proc->syncs.end(); it++)
259  dump_proc_sync(f, indent + " ", *it);
260  f << stringf("%s" "end\n", indent.c_str());
261 }
262 
263 void ILANG_BACKEND::dump_conn(std::ostream &f, std::string indent, const RTLIL::SigSpec &left, const RTLIL::SigSpec &right)
264 {
265  f << stringf("%s" "connect ", indent.c_str());
266  dump_sigspec(f, left);
267  f << stringf(" ");
268  dump_sigspec(f, right);
269  f << stringf("\n");
270 }
271 
272 void ILANG_BACKEND::dump_module(std::ostream &f, std::string indent, RTLIL::Module *module, RTLIL::Design *design, bool only_selected, bool flag_m, bool flag_n)
273 {
274  bool print_header = flag_m || design->selected_whole_module(module->name);
275  bool print_body = !flag_n || !design->selected_whole_module(module->name);
276 
277  if (print_header)
278  {
279  for (auto it = module->attributes.begin(); it != module->attributes.end(); it++) {
280  f << stringf("%s" "attribute %s ", indent.c_str(), it->first.c_str());
281  dump_const(f, it->second);
282  f << stringf("\n");
283  }
284 
285  f << stringf("%s" "module %s\n", indent.c_str(), module->name.c_str());
286  }
287 
288  if (print_body)
289  {
290  std::vector<RTLIL::Wire*> sorted_wires;
291  for (auto it : module->wires())
292  sorted_wires.push_back(it);
293  std::sort(sorted_wires.begin(), sorted_wires.end(), RTLIL::sort_by_name_str<RTLIL::Wire>());
294 
295  std::vector<RTLIL::Memory*> sorted_memories;
296  for (auto it : module->memories)
297  sorted_memories.push_back(it.second);
298  std::sort(sorted_memories.begin(), sorted_memories.end(), RTLIL::sort_by_name_str<RTLIL::Memory>());
299 
300  std::vector<RTLIL::Cell*> sorted_cells;
301  for (auto it : module->cells())
302  sorted_cells.push_back(it);
303  std::sort(sorted_cells.begin(), sorted_cells.end(), RTLIL::sort_by_name_str<RTLIL::Cell>());
304 
305  std::vector<RTLIL::Process*> sorted_processes;
306  for (auto it : module->processes)
307  sorted_processes.push_back(it.second);
308  std::sort(sorted_processes.begin(), sorted_processes.end(), RTLIL::sort_by_name_str<RTLIL::Process>());
309 
310  for (auto it : sorted_wires)
311  if (!only_selected || design->selected(module, it)) {
312  if (only_selected)
313  f << stringf("\n");
314  dump_wire(f, indent + " ", it);
315  }
316 
317  for (auto it : sorted_memories)
318  if (!only_selected || design->selected(module, it)) {
319  if (only_selected)
320  f << stringf("\n");
321  dump_memory(f, indent + " ", it);
322  }
323 
324  for (auto it : sorted_cells)
325  if (!only_selected || design->selected(module, it)) {
326  if (only_selected)
327  f << stringf("\n");
328  dump_cell(f, indent + " ", it);
329  }
330 
331  for (auto it : sorted_processes)
332  if (!only_selected || design->selected(module, it)) {
333  if (only_selected)
334  f << stringf("\n");
335  dump_proc(f, indent + " ", it);
336  }
337 
338  bool first_conn_line = true;
339  for (auto it = module->connections().begin(); it != module->connections().end(); it++) {
340  bool show_conn = !only_selected;
341  if (only_selected) {
342  RTLIL::SigSpec sigs = it->first;
343  sigs.append(it->second);
344  for (auto &c : sigs.chunks()) {
345  if (c.wire == NULL || !design->selected(module, c.wire))
346  continue;
347  show_conn = true;
348  }
349  }
350  if (show_conn) {
351  if (only_selected && first_conn_line)
352  f << stringf("\n");
353  dump_conn(f, indent + " ", it->first, it->second);
354  first_conn_line = false;
355  }
356  }
357  }
358 
359  if (print_header)
360  f << stringf("%s" "end\n", indent.c_str());
361 }
362 
363 void ILANG_BACKEND::dump_design(std::ostream &f, RTLIL::Design *design, bool only_selected, bool flag_m, bool flag_n)
364 {
365  int init_autoidx = autoidx;
366 
367  if (!flag_m) {
368  int count_selected_mods = 0;
369  for (auto it = design->modules_.begin(); it != design->modules_.end(); it++) {
370  if (design->selected_whole_module(it->first))
371  flag_m = true;
372  if (design->selected(it->second))
373  count_selected_mods++;
374  }
375  if (count_selected_mods > 1)
376  flag_m = true;
377  }
378 
379  if (!only_selected || flag_m) {
380  if (only_selected)
381  f << stringf("\n");
382  f << stringf("autoidx %d\n", autoidx);
383  }
384 
385  for (auto it = design->modules_.begin(); it != design->modules_.end(); it++) {
386  if (!only_selected || design->selected(it->second)) {
387  if (only_selected)
388  f << stringf("\n");
389  dump_module(f, "", it->second, design, only_selected, flag_m, flag_n);
390  }
391  }
392 
393  log_assert(init_autoidx == autoidx);
394 }
395 
398 
399 struct IlangBackend : public Backend {
400  IlangBackend() : Backend("ilang", "write design to ilang file") { }
401  virtual void help()
402  {
403  // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
404  log("\n");
405  log(" write_ilang [filename]\n");
406  log("\n");
407  log("Write the current design to an 'ilang' file. (ilang is a text representation\n");
408  log("of a design in yosys's internal format.)\n");
409  log("\n");
410  log(" -selected\n");
411  log(" only write selected parts of the design.\n");
412  log("\n");
413  }
414  virtual void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design)
415  {
416  bool selected = false;
417 
418  log_header("Executing ILANG backend.\n");
419 
420  size_t argidx;
421  for (argidx = 1; argidx < args.size(); argidx++) {
422  std::string arg = args[argidx];
423  if (arg == "-selected") {
424  selected = true;
425  continue;
426  }
427  break;
428  }
429  extra_args(f, filename, args, argidx);
430 
431  log("Output filename: %s\n", filename.c_str());
432  *f << stringf("# Generated by %s\n", yosys_version_str);
433  ILANG_BACKEND::dump_design(*f, design, selected, true, false);
434  }
435 } IlangBackend;
436 
437 struct DumpPass : public Pass {
438  DumpPass() : Pass("dump", "print parts of the design in ilang format") { }
439  virtual void help()
440  {
441  // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
442  log("\n");
443  log(" dump [options] [selection]\n");
444  log("\n");
445  log("Write the selected parts of the design to the console or specified file in\n");
446  log("ilang format.\n");
447  log("\n");
448  log(" -m\n");
449  log(" also dump the module headers, even if only parts of a single\n");
450  log(" module is selected\n");
451  log("\n");
452  log(" -n\n");
453  log(" only dump the module headers if the entire module is selected\n");
454  log("\n");
455  log(" -outfile <filename>\n");
456  log(" write to the specified file.\n");
457  log("\n");
458  log(" -append <filename>\n");
459  log(" like -outfile but append instead of overwrite\n");
460  log("\n");
461  }
462  virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
463  {
464  std::string filename;
465  bool flag_m = false, flag_n = false, append = false;
466 
467  size_t argidx;
468  for (argidx = 1; argidx < args.size(); argidx++)
469  {
470  std::string arg = args[argidx];
471  if (arg == "-outfile" && argidx+1 < args.size()) {
472  filename = args[++argidx];
473  append = false;
474  continue;
475  }
476  if (arg == "-append" && argidx+1 < args.size()) {
477  filename = args[++argidx];
478  append = true;
479  continue;
480  }
481  if (arg == "-m") {
482  flag_m = true;
483  continue;
484  }
485  if (arg == "-n") {
486  flag_n = true;
487  continue;
488  }
489  break;
490  }
491  extra_args(args, argidx, design);
492 
493  std::ostream *f;
494  std::stringstream buf;
495 
496  if (!filename.empty()) {
497  std::ofstream *ff = new std::ofstream;
498  ff->open(filename.c_str(), append ? std::ofstream::app : std::ofstream::trunc);
499  if (ff->fail()) {
500  delete ff;
501  log_error("Can't open file `%s' for writing: %s\n", filename.c_str(), strerror(errno));
502  }
503  f = ff;
504  } else {
505  f = &buf;
506  }
507 
508  ILANG_BACKEND::dump_design(*f, design, true, flag_m, flag_n);
509 
510  if (!filename.empty()) {
511  delete f;
512  } else {
513  log("%s", buf.str().c_str());
514  }
515  }
516 } DumpPass;
517 
const char * yosys_version_str
const char * c_str() const
Definition: rtlil.h:178
bool selected(T1 *module) const
Definition: rtlil.h:551
void dump_cell(std::ostream &f, std::string indent, const RTLIL::Cell *cell)
DumpPass DumpPass
static void append(const vec< T > &from, vec< T > &to)
Definition: Alg.h:79
RTLIL::Wire * wire(RTLIL::IdString id)
Definition: rtlil.h:637
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
void sort(T *array, int size, LessThan lt)
Definition: Sort.h:57
void dump_proc_sync(std::ostream &f, std::string indent, const RTLIL::SyncRule *sy)
virtual void help()
int flags
Definition: rtlil.h:437
void log_header(const char *format,...)
Definition: log.cc:188
const std::vector< RTLIL::SigSig > & connections() const
Definition: rtlil.cc:1307
#define YOSYS_NAMESPACE_END
Definition: yosys.h:100
void dump_sigchunk(std::ostream &f, const RTLIL::SigChunk &chunk, bool autoint=true)
RTLIL::SyncType type
Definition: rtlil.h:1144
RTLIL_ATTRIBUTE_MEMBERS std::vector< RTLIL::CaseRule * > cases
Definition: rtlil.h:1134
RTLIL::IdString name
Definition: rtlil.h:853
bool upto
Definition: rtlil.h:827
virtual void help()
bool port_input
Definition: rtlil.h:827
void dump_proc_case_body(std::ostream &f, std::string indent, const RTLIL::CaseRule *cs)
RTLIL::ObjRange< RTLIL::Wire * > wires()
Definition: rtlil.h:640
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool autoint=true)
int width
Definition: rtlil.h:826
virtual void execute(std::vector< std::string > args, RTLIL::Design *design)
std::map< RTLIL::IdString, RTLIL::Memory * > memories
Definition: rtlil.h:601
void log_error(const char *format,...)
Definition: log.cc:204
RTLIL::Module * module
Definition: abc.cc:94
int port_id
Definition: rtlil.h:826
RTLIL::IdString type
Definition: rtlil.h:854
std::map< RTLIL::IdString, RTLIL::Const > parameters
Definition: rtlil.h:856
RTLIL::SigSpec signal
Definition: rtlil.h:1145
int size
Definition: rtlil.h:836
bool port_output
Definition: rtlil.h:827
virtual void execute(std::ostream *&f, std::string filename, std::vector< std::string > args, RTLIL::Design *design)
RTLIL::Wire * wire
Definition: rtlil.h:885
bool is_chunk() const
Definition: rtlil.cc:2755
RTLIL::SigSpec signal
Definition: rtlil.h:1132
#define PRIVATE_NAMESPACE_BEGIN
Definition: yosys.h:97
RTLIL::IdString name
Definition: rtlil.h:835
std::string decode_string() const
Definition: rtlil.cc:131
#define log_assert(_assert_expr_)
Definition: log.h:85
RTLIL::IdString name
Definition: rtlil.h:599
RTLIL::SigChunk as_chunk() const
Definition: rtlil.cc:2877
bool selected_whole_module(RTLIL::IdString mod_name) const
Definition: rtlil.cc:388
void dump_proc_switch(std::ostream &f, std::string indent, const RTLIL::SwitchRule *sw)
#define PRIVATE_NAMESPACE_END
Definition: yosys.h:98
Definition: register.h:27
RTLIL::IdString name
Definition: rtlil.h:825
void dump_wire(std::ostream &f, std::string indent, const RTLIL::Wire *wire)
std::vector< RTLIL::SigSig > actions
Definition: rtlil.h:1146
void dump_memory(std::ostream &f, std::string indent, const RTLIL::Memory *memory)
RTLIL::IdString name
Definition: rtlil.h:1154
std::map< RTLIL::IdString, RTLIL::Process * > processes
Definition: rtlil.h:602
#define USING_YOSYS_NAMESPACE
Definition: yosys.h:102
RTLIL::ObjRange< RTLIL::Cell * > cells()
Definition: rtlil.h:641
void dump_design(std::ostream &f, RTLIL::Design *design, bool only_selected, bool flag_m=true, bool flag_n=false)
std::map< RTLIL::IdString, RTLIL::Module * > modules_
Definition: rtlil.h:507
#define NULL
#define YOSYS_NAMESPACE_BEGIN
Definition: yosys.h:99
void dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig, bool autoint=true)
void log(const char *format,...)
Definition: log.cc:180
std::vector< RTLIL::SyncRule * > syncs
Definition: rtlil.h:1157
IlangBackend IlangBackend
void dump_conn(std::ostream &f, std::string indent, const RTLIL::SigSpec &left, const RTLIL::SigSpec &right)
void dump_module(std::ostream &f, std::string indent, RTLIL::Module *module, RTLIL::Design *design, bool only_selected, bool flag_m=true, bool flag_n=false)
std::vector< RTLIL::State > bits
Definition: rtlil.h:438
void append(const RTLIL::SigSpec &signal)
Definition: rtlil.cc:2523
int start_offset
Definition: rtlil.h:826
int width
Definition: rtlil.h:836
std::vector< RTLIL::SigSig > actions
Definition: rtlil.h:1120
void dump_proc(std::ostream &f, std::string indent, const RTLIL::Process *proc)
std::vector< RTLIL::SwitchRule * > switches
Definition: rtlil.h:1121
const std::map< RTLIL::IdString, RTLIL::SigSpec > & connections() const
Definition: rtlil.cc:1814
std::vector< RTLIL::State > data
Definition: rtlil.h:886
YOSYS_NAMESPACE_BEGIN int autoidx
Definition: yosys.cc:51
const std::vector< RTLIL::SigChunk > & chunks() const
Definition: rtlil.h:1016
RTLIL_ATTRIBUTE_MEMBERS RTLIL::CaseRule root_case
Definition: rtlil.h:1156