yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ILANG_BACKEND Namespace Reference

Functions

void dump_const (std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool autoint=true)
 
void dump_sigchunk (std::ostream &f, const RTLIL::SigChunk &chunk, bool autoint=true)
 
void dump_sigspec (std::ostream &f, const RTLIL::SigSpec &sig, bool autoint=true)
 
void dump_wire (std::ostream &f, std::string indent, const RTLIL::Wire *wire)
 
void dump_memory (std::ostream &f, std::string indent, const RTLIL::Memory *memory)
 
void dump_cell (std::ostream &f, std::string indent, const RTLIL::Cell *cell)
 
void dump_proc_case_body (std::ostream &f, std::string indent, const RTLIL::CaseRule *cs)
 
void dump_proc_switch (std::ostream &f, std::string indent, const RTLIL::SwitchRule *sw)
 
void dump_proc_sync (std::ostream &f, std::string indent, const RTLIL::SyncRule *sy)
 
void dump_proc (std::ostream &f, std::string indent, const RTLIL::Process *proc)
 
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)
 
void dump_design (std::ostream &f, RTLIL::Design *design, bool only_selected, bool flag_m=true, bool flag_n=false)
 

Function Documentation

void ILANG_BACKEND::dump_cell ( std::ostream &  f,
std::string  indent,
const RTLIL::Cell cell 
)

Definition at line 156 of file ilang_backend.cc.

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 }
const char * c_str() const
Definition: rtlil.h:178
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
RTLIL::IdString name
Definition: rtlil.h:853
RTLIL::IdString type
Definition: rtlil.h:854
std::map< RTLIL::IdString, RTLIL::Const > parameters
Definition: rtlil.h:856
void dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig)
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool no_decimal=false, bool set_signed=false)
const std::map< RTLIL::IdString, RTLIL::SigSpec > & connections() const
Definition: rtlil.cc:1814

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_conn ( std::ostream &  f,
std::string  indent,
const RTLIL::SigSpec left,
const RTLIL::SigSpec right 
)

Definition at line 263 of file ilang_backend.cc.

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 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
void dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

YOSYS_NAMESPACE_BEGIN void ILANG_BACKEND::dump_const ( std::ostream &  f,
const RTLIL::Const data,
int  width = -1,
int  offset = 0,
bool  autoint = true 
)

Definition at line 33 of file ilang_backend.cc.

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 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
int flags
Definition: rtlil.h:437
std::string decode_string() const
Definition: rtlil.cc:131
#define log_assert(_assert_expr_)
Definition: log.h:85
std::vector< RTLIL::State > bits
Definition: rtlil.h:438

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_design ( std::ostream &  f,
RTLIL::Design design,
bool  only_selected,
bool  flag_m = true,
bool  flag_n = false 
)

Definition at line 363 of file ilang_backend.cc.

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 }
bool selected(T1 *module) const
Definition: rtlil.h:551
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
void dump_module(std::ostream &f, std::string indent, RTLIL::Module *module)
#define log_assert(_assert_expr_)
Definition: log.h:85
bool selected_whole_module(RTLIL::IdString mod_name) const
Definition: rtlil.cc:388
std::map< RTLIL::IdString, RTLIL::Module * > modules_
Definition: rtlil.h:507
YOSYS_NAMESPACE_BEGIN int autoidx
Definition: yosys.cc:51

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_memory ( std::ostream &  f,
std::string  indent,
const RTLIL::Memory memory 
)

Definition at line 139 of file ilang_backend.cc.

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 }
const char * c_str() const
Definition: rtlil.h:178
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
int size
Definition: rtlil.h:836
RTLIL::IdString name
Definition: rtlil.h:835
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool no_decimal=false, bool set_signed=false)
int width
Definition: rtlil.h:836

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::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 
)

Definition at line 272 of file ilang_backend.cc.

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 }
const char * c_str() const
Definition: rtlil.h:178
bool selected(T1 *module) const
Definition: rtlil.h:551
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_wire(std::ostream &f, std::string indent, RTLIL::Wire *wire)
const std::vector< RTLIL::SigSig > & connections() const
Definition: rtlil.cc:1307
RTLIL::ObjRange< RTLIL::Wire * > wires()
Definition: rtlil.h:640
std::map< RTLIL::IdString, RTLIL::Memory * > memories
Definition: rtlil.h:601
void dump_conn(std::ostream &f, std::string indent, const RTLIL::SigSpec &left, const RTLIL::SigSpec &right)
void dump_cell(std::ostream &f, std::string indent, RTLIL::Cell *cell)
RTLIL::IdString name
Definition: rtlil.h:599
bool selected_whole_module(RTLIL::IdString mod_name) const
Definition: rtlil.cc:388
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool no_decimal=false, bool set_signed=false)
std::map< RTLIL::IdString, RTLIL::Process * > processes
Definition: rtlil.h:602
RTLIL::ObjRange< RTLIL::Cell * > cells()
Definition: rtlil.h:641
#define NULL
void append(const RTLIL::SigSpec &signal)
Definition: rtlil.cc:2523
void dump_memory(std::ostream &f, std::string indent, RTLIL::Memory *memory)
void dump_proc(std::ostream &f, std::string indent, const RTLIL::Process *proc)
const std::vector< RTLIL::SigChunk > & chunks() const
Definition: rtlil.h:1016

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_proc ( std::ostream &  f,
std::string  indent,
const RTLIL::Process proc 
)

Definition at line 249 of file ilang_backend.cc.

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 }
const char * c_str() const
Definition: rtlil.h:178
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
void dump_proc_sync(std::ostream &f, std::string indent, const RTLIL::SyncRule *sy)
void dump_proc_case_body(std::ostream &f, std::string indent, const RTLIL::CaseRule *cs)
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool no_decimal=false, bool set_signed=false)
RTLIL::IdString name
Definition: rtlil.h:1154
std::vector< RTLIL::SyncRule * > syncs
Definition: rtlil.h:1157
RTLIL_ATTRIBUTE_MEMBERS RTLIL::CaseRule root_case
Definition: rtlil.h:1156

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_proc_case_body ( std::ostream &  f,
std::string  indent,
const RTLIL::CaseRule cs 
)

Definition at line 181 of file ilang_backend.cc.

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 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
void dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig)
void dump_proc_switch(std::ostream &f, std::string indent, RTLIL::SwitchRule *sw)
std::vector< RTLIL::SigSig > actions
Definition: rtlil.h:1120
std::vector< RTLIL::SwitchRule * > switches
Definition: rtlil.h:1121

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_proc_switch ( std::ostream &  f,
std::string  indent,
const RTLIL::SwitchRule sw 
)

Definition at line 196 of file ilang_backend.cc.

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 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
RTLIL_ATTRIBUTE_MEMBERS std::vector< RTLIL::CaseRule * > cases
Definition: rtlil.h:1134
void dump_proc_case_body(std::ostream &f, std::string indent, const RTLIL::CaseRule *cs)
void dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig)
RTLIL::SigSpec signal
Definition: rtlil.h:1132
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool no_decimal=false, bool set_signed=false)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_proc_sync ( std::ostream &  f,
std::string  indent,
const RTLIL::SyncRule sy 
)

Definition at line 224 of file ilang_backend.cc.

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 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
RTLIL::SyncType type
Definition: rtlil.h:1144
RTLIL::SigSpec signal
Definition: rtlil.h:1145
void dump_sigspec(std::ostream &f, const RTLIL::SigSpec &sig)
std::vector< RTLIL::SigSig > actions
Definition: rtlil.h:1146

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_sigchunk ( std::ostream &  f,
const RTLIL::SigChunk chunk,
bool  autoint = true 
)

Definition at line 86 of file ilang_backend.cc.

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 }
const char * c_str() const
Definition: rtlil.h:178
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
int width
Definition: rtlil.h:826
RTLIL::Wire * wire
Definition: rtlil.h:885
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool no_decimal=false, bool set_signed=false)
RTLIL::IdString name
Definition: rtlil.h:825
#define NULL
std::vector< RTLIL::State > data
Definition: rtlil.h:886

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_sigspec ( std::ostream &  f,
const RTLIL::SigSpec sig,
bool  autoint = true 
)

Definition at line 100 of file ilang_backend.cc.

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 }
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
void dump_sigchunk(std::ostream &f, const RTLIL::SigChunk &chunk, bool no_decimal=false)
bool is_chunk() const
Definition: rtlil.cc:2755
RTLIL::SigChunk as_chunk() const
Definition: rtlil.cc:2877
const std::vector< RTLIL::SigChunk > & chunks() const
Definition: rtlil.h:1016

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ILANG_BACKEND::dump_wire ( std::ostream &  f,
std::string  indent,
const RTLIL::Wire wire 
)

Definition at line 114 of file ilang_backend.cc.

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 }
const char * c_str() const
Definition: rtlil.h:178
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
bool upto
Definition: rtlil.h:827
bool port_input
Definition: rtlil.h:827
int width
Definition: rtlil.h:826
int port_id
Definition: rtlil.h:826
bool port_output
Definition: rtlil.h:827
void dump_const(std::ostream &f, const RTLIL::Const &data, int width=-1, int offset=0, bool no_decimal=false, bool set_signed=false)
RTLIL::IdString name
Definition: rtlil.h:825
int start_offset
Definition: rtlil.h:826

+ Here is the call graph for this function:

+ Here is the caller graph for this function: