Fixed issue when using a python plugin in the yosys shell
[yosys.git] / kernel / python_wrappers.cc
1 #ifdef WITH_PYTHON
2
3 #include "yosys.h"
4 #include <boost/python/module.hpp>
5 #include <boost/python/class.hpp>
6 #include <boost/python/wrapper.hpp>
7 #include <boost/python/call.hpp>
8 #include <boost/python.hpp>
9 #include <boost/log/exceptions.hpp>
10
11 using namespace Yosys;
12
13 namespace YOSYS_PYTHON {
14
15 struct IdString;
16 struct Const;
17 struct CaseRule;
18 struct SwitchRule;
19 struct SyncRule;
20 struct Process;
21 struct SigChunk;
22 struct SigBit;
23 struct SigSpec;
24 struct Cell;
25 struct Wire;
26 struct Memory;
27 struct Module;
28 struct Design;
29 struct Monitor;
30 typedef Yosys::RTLIL::State State;
31
32 void run(std::string command)
33 {
34 Yosys::run_pass(command);
35 }
36
37 void log(std::string text)
38 {
39 Yosys::log(text.c_str());
40 }
41
42 struct IdString
43 {
44 Yosys::RTLIL::IdString* ref_obj;
45
46 IdString(Yosys::RTLIL::IdString* ref = new Yosys::RTLIL::IdString())
47 {
48 this->ref_obj = new Yosys::RTLIL::IdString(*ref);
49 }
50
51 ~IdString()
52 {
53 delete(this->ref_obj);
54 }
55
56 IdString(Yosys::RTLIL::IdString ref)
57 {
58 this->ref_obj = new Yosys::RTLIL::IdString(ref);
59 }
60
61 IdString(const std::string &str)
62 {
63 this->ref_obj = new Yosys::RTLIL::IdString(str);
64 }
65
66 Yosys::RTLIL::IdString* get_cpp_obj() const
67 {
68 return ref_obj;
69 }
70
71 //WRAPPED static inline int get_reference(int idx)
72 static inline int get_reference(int idx);
73
74 //WRAPPED static inline void put_reference(int idx)
75 static inline void put_reference(int idx);
76
77 //WRAPPED bool in(IdString rhs) const { return *this == rhs; }
78 bool in_IdString(IdString *rhs);
79
80 //WRAPPED bool in(const std::string &rhs) const { return *this == rhs; }
81 bool in_std_string(std::string rhs);
82 };
83
84 std::ostream &operator<<(std::ostream &ostr, const IdString &ref)
85 {
86 ostr << ref.ref_obj->str();
87 return ostr;
88 }
89 struct Const
90 {
91 Yosys::RTLIL::Const* ref_obj;
92
93 Const(Yosys::RTLIL::Const* ref = new Yosys::RTLIL::Const())
94 {
95 this->ref_obj = new Yosys::RTLIL::Const(*ref);
96 }
97
98 ~Const()
99 {
100 delete(this->ref_obj);
101 }
102
103 Const(Yosys::RTLIL::Const ref)
104 {
105 this->ref_obj = new Yosys::RTLIL::Const(ref);
106 }
107
108 Yosys::RTLIL::Const* get_cpp_obj() const
109 {
110 return ref_obj;
111 }
112
113 //WRAPPED int as_int(bool is_signed = false) const;
114 int as_int(bool is_signed = false);
115
116 //WRAPPED static Const from_string(std::string str);
117 static Const from_string(std::string str);
118
119 //WRAPPED inline RTLIL::Const extract(int offset, int len = 1, RTLIL::State padding = RTLIL::State::S0) const {
120 inline Const extract(int offset, int len = 1, State padding = RTLIL::State::S0);
121 };
122
123 std::ostream &operator<<(std::ostream &ostr, const Const &ref)
124 {
125 ostr << ref.ref_obj->as_string();
126 return ostr;
127 }
128 struct CaseRule
129 {
130 Yosys::RTLIL::CaseRule* ref_obj;
131
132 CaseRule(Yosys::RTLIL::CaseRule* ref = new Yosys::RTLIL::CaseRule())
133 {
134 this->ref_obj = ref->clone();
135 }
136
137 ~CaseRule()
138 {
139 delete(this->ref_obj);
140 }
141
142 CaseRule(Yosys::RTLIL::CaseRule ref)
143 {
144 this->ref_obj = ref.clone();
145 }
146
147 Yosys::RTLIL::CaseRule* get_cpp_obj() const
148 {
149 return ref_obj;
150 }
151 };
152
153 std::ostream &operator<<(std::ostream &ostr, const CaseRule &ref)
154 {
155 ostr << "CaseRule object at " << ref.ref_obj;
156 return ostr;
157 }
158 struct SwitchRule
159 {
160 Yosys::RTLIL::SwitchRule* ref_obj;
161
162 SwitchRule(Yosys::RTLIL::SwitchRule* ref = new Yosys::RTLIL::SwitchRule())
163 {
164 this->ref_obj = ref->clone();
165 }
166
167 ~SwitchRule()
168 {
169 delete(this->ref_obj);
170 }
171
172 SwitchRule(Yosys::RTLIL::SwitchRule ref)
173 {
174 this->ref_obj = ref.clone();
175 }
176
177 Yosys::RTLIL::SwitchRule* get_cpp_obj() const
178 {
179 return ref_obj;
180 }
181 };
182
183 std::ostream &operator<<(std::ostream &ostr, const SwitchRule &ref)
184 {
185 ostr << "SwitchRule object at " << ref.ref_obj;
186 return ostr;
187 }
188 struct SyncRule
189 {
190 Yosys::RTLIL::SyncRule* ref_obj;
191
192 SyncRule(Yosys::RTLIL::SyncRule* ref = new Yosys::RTLIL::SyncRule())
193 {
194 this->ref_obj = ref->clone();
195 }
196
197 ~SyncRule()
198 {
199 delete(this->ref_obj);
200 }
201
202 SyncRule(Yosys::RTLIL::SyncRule ref)
203 {
204 this->ref_obj = ref.clone();
205 }
206
207 Yosys::RTLIL::SyncRule* get_cpp_obj() const
208 {
209 return ref_obj;
210 }
211 };
212
213 std::ostream &operator<<(std::ostream &ostr, const SyncRule &ref)
214 {
215 ostr << "SyncRule object at " << ref.ref_obj;
216 return ostr;
217 }
218 struct Process
219 {
220 Yosys::RTLIL::Process* ref_obj;
221
222 Process(Yosys::RTLIL::Process* ref = new Yosys::RTLIL::Process())
223 {
224 this->ref_obj = ref->clone();
225 }
226
227 ~Process()
228 {
229 delete(this->ref_obj);
230 }
231
232 Process(Yosys::RTLIL::Process ref)
233 {
234 this->ref_obj = ref.clone();
235 }
236
237 Yosys::RTLIL::Process* get_cpp_obj() const
238 {
239 return ref_obj;
240 }
241 };
242
243 std::ostream &operator<<(std::ostream &ostr, const Process &ref)
244 {
245 ostr << "Process with name " << ref.ref_obj->name.c_str();
246 return ostr;
247 }
248 struct SigChunk
249 {
250 Yosys::RTLIL::SigChunk* ref_obj;
251
252 SigChunk(Yosys::RTLIL::SigChunk* ref = new Yosys::RTLIL::SigChunk())
253 {
254 this->ref_obj = new Yosys::RTLIL::SigChunk(*ref);
255 }
256
257 ~SigChunk()
258 {
259 delete(this->ref_obj);
260 }
261
262 SigChunk(Yosys::RTLIL::SigChunk ref)
263 {
264 this->ref_obj = new Yosys::RTLIL::SigChunk(ref);
265 }
266
267 Yosys::RTLIL::SigChunk* get_cpp_obj() const
268 {
269 return ref_obj;
270 }
271
272 //WRAPPED RTLIL::SigChunk extract(int offset, int length) const;
273 SigChunk extract(int offset, int length);
274 };
275
276 std::ostream &operator<<(std::ostream &ostr, const SigChunk &ref)
277 {
278 ostr << "SigChunk object at " << ref.ref_obj;
279 return ostr;
280 }
281 struct SigBit
282 {
283 Yosys::RTLIL::SigBit* ref_obj;
284
285 SigBit(Yosys::RTLIL::SigBit* ref = new Yosys::RTLIL::SigBit())
286 {
287 this->ref_obj = new Yosys::RTLIL::SigBit(*ref);
288 }
289
290 ~SigBit()
291 {
292 delete(this->ref_obj);
293 }
294
295 SigBit(Yosys::RTLIL::SigBit ref)
296 {
297 this->ref_obj = new Yosys::RTLIL::SigBit(ref);
298 }
299
300 Yosys::RTLIL::SigBit* get_cpp_obj() const
301 {
302 return ref_obj;
303 }
304 };
305
306 std::ostream &operator<<(std::ostream &ostr, const SigBit &ref)
307 {
308 ostr << "SigBit object at " << ref.ref_obj;
309 return ostr;
310 }
311 struct SigSpec
312 {
313 Yosys::RTLIL::SigSpec* ref_obj;
314
315 SigSpec(Yosys::RTLIL::SigSpec* ref = new Yosys::RTLIL::SigSpec())
316 {
317 this->ref_obj = new Yosys::RTLIL::SigSpec(*ref);
318 }
319
320 ~SigSpec()
321 {
322 delete(this->ref_obj);
323 }
324
325 SigSpec(Yosys::RTLIL::SigSpec ref)
326 {
327 this->ref_obj = new Yosys::RTLIL::SigSpec(ref);
328 }
329
330 Yosys::RTLIL::SigSpec* get_cpp_obj() const
331 {
332 return ref_obj;
333 }
334
335 //WRAPPED void replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with);
336 void replace_SigSpec_SigSpec(SigSpec *pattern, SigSpec *with);
337
338 //WRAPPED void replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with, RTLIL::SigSpec *other) const;
339 void replace_SigSpec_SigSpec_SigSpec(SigSpec *pattern, SigSpec *with, SigSpec *other);
340
341 //WRAPPED void replace(int offset, const RTLIL::SigSpec &with);
342 void replace_int_SigSpec(int offset, SigSpec *with);
343
344 //WRAPPED void remove(const RTLIL::SigSpec &pattern);
345 void remove_SigSpec(SigSpec *pattern);
346
347 //WRAPPED void remove(const RTLIL::SigSpec &pattern, RTLIL::SigSpec *other) const;
348 void remove_SigSpec_SigSpec(SigSpec *pattern, SigSpec *other);
349
350 //WRAPPED void remove2(const RTLIL::SigSpec &pattern, RTLIL::SigSpec *other);
351 void remove2_SigSpec_SigSpec(SigSpec *pattern, SigSpec *other);
352
353 //WRAPPED void remove(const pool<RTLIL::SigBit> &pattern);
354 void remove_pool_SigBit(boost::python::list *pattern);
355
356 //WRAPPED void remove(const pool<RTLIL::SigBit> &pattern, RTLIL::SigSpec *other) const;
357 void remove_pool_SigBit_SigSpec(boost::python::list *pattern, SigSpec *other);
358
359 //WRAPPED void remove2(const pool<RTLIL::SigBit> &pattern, RTLIL::SigSpec *other);
360 void remove2_pool_SigBit_SigSpec(boost::python::list *pattern, SigSpec *other);
361
362 //WRAPPED void remove(int offset, int length = 1);
363 void remove_int_int(int offset, int length = 1);
364
365 //WRAPPED RTLIL::SigSpec extract(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec *other = NULL) const;
366 SigSpec extract_SigSpec_SigSpec(SigSpec *pattern, SigSpec *other);
367
368 //WRAPPED RTLIL::SigSpec extract(const pool<RTLIL::SigBit> &pattern, const RTLIL::SigSpec *other = NULL) const;
369 SigSpec extract_pool_SigBit_SigSpec(boost::python::list *pattern, SigSpec *other);
370
371 //WRAPPED RTLIL::SigSpec extract(int offset, int length = 1) const;
372 SigSpec extract_int_int(int offset, int length = 1);
373
374 //WRAPPED void append(const RTLIL::SigSpec &signal);
375 void append(SigSpec *signal);
376
377 //WRAPPED void append_bit(const RTLIL::SigBit &bit);
378 void append_bit(SigBit *bit);
379
380 //WRAPPED void extend_u0(int width, bool is_signed = false);
381 void extend_u0(int width, bool is_signed = false);
382
383 //WRAPPED RTLIL::SigSpec repeat(int num) const;
384 SigSpec repeat(int num);
385
386 //WRAPPED int as_int(bool is_signed = false) const;
387 int as_int(bool is_signed = false);
388
389 //WRAPPED bool match(std::string pattern) const;
390 bool match(std::string pattern);
391
392 //WRAPPED static bool parse(RTLIL::SigSpec &sig, RTLIL::Module *module, std::string str);
393 static bool parse(SigSpec *sig, Module *module, std::string str);
394
395 //WRAPPED static bool parse_sel(RTLIL::SigSpec &sig, RTLIL::Design *design, RTLIL::Module *module, std::string str);
396 static bool parse_sel(SigSpec *sig, Design *design, Module *module, std::string str);
397
398 //WRAPPED static bool parse_rhs(const RTLIL::SigSpec &lhs, RTLIL::SigSpec &sig, RTLIL::Module *module, std::string str);
399 static bool parse_rhs(SigSpec *lhs, SigSpec *sig, Module *module, std::string str);
400 };
401
402 std::ostream &operator<<(std::ostream &ostr, const SigSpec &ref)
403 {
404 ostr << "SigSpec object at " << ref.ref_obj;
405 return ostr;
406 }
407 struct Cell
408 {
409 unsigned int hashidx_;
410 Yosys::RTLIL::Cell* ref_obj;
411
412 Cell(Yosys::RTLIL::Cell* ref)
413 {
414 this->hashidx_ = ref->hashidx_;
415 this->ref_obj = ref;
416 }
417
418 Yosys::RTLIL::Cell* get_cpp_obj() const
419 {
420 Yosys::RTLIL::Cell* ret = Yosys::RTLIL::Cell::get_all_cells()->at(this->hashidx_);
421 if(ret != NULL && ret == this->ref_obj)
422 return ret;
423 return NULL;
424 }
425
426 //WRAPPED bool hasPort(RTLIL::IdString portname) const;
427 bool hasPort(IdString *portname);
428
429 //WRAPPED void unsetPort(RTLIL::IdString portname);
430 void unsetPort(IdString *portname);
431
432 //WRAPPED void setPort(RTLIL::IdString portname, RTLIL::SigSpec signal);
433 void setPort(IdString *portname, SigSpec *signal);
434
435 //WRAPPED bool input(RTLIL::IdString portname) const;
436 bool input(IdString *portname);
437
438 //WRAPPED bool output(RTLIL::IdString portname) const;
439 bool output(IdString *portname);
440
441 //WRAPPED bool hasParam(RTLIL::IdString paramname) const;
442 bool hasParam(IdString *paramname);
443
444 //WRAPPED void unsetParam(RTLIL::IdString paramname);
445 void unsetParam(IdString *paramname);
446
447 //WRAPPED void setParam(RTLIL::IdString paramname, RTLIL::Const value);
448 void setParam(IdString *paramname, Const *value);
449
450 //WRAPPED void fixup_parameters(bool set_a_signed = false, bool set_b_signed = false);
451 void fixup_parameters(bool set_a_signed = false, bool set_b_signed = false);
452 };
453
454 std::ostream &operator<<(std::ostream &ostr, const Cell &ref)
455 {
456 if(ref.get_cpp_obj() != NULL)
457 ostr << "Cell with name " << ref.get_cpp_obj()->name.c_str();
458 else
459 ostr << "deleted Cell";
460 return ostr;
461 }
462 struct Wire
463 {
464 unsigned int hashidx_;
465 Yosys::RTLIL::Wire* ref_obj;
466
467 Wire(Yosys::RTLIL::Wire* ref)
468 {
469 this->hashidx_ = ref->hashidx_;
470 this->ref_obj = ref;
471 }
472
473 Yosys::RTLIL::Wire* get_cpp_obj() const
474 {
475 Yosys::RTLIL::Wire* ret = Yosys::RTLIL::Wire::get_all_wires()->at(this->hashidx_);
476 if(ret != NULL && ret == this->ref_obj)
477 return ret;
478 return NULL;
479 }
480 };
481
482 std::ostream &operator<<(std::ostream &ostr, const Wire &ref)
483 {
484 if(ref.get_cpp_obj() != NULL)
485 ostr << "Wire with name " << ref.get_cpp_obj()->name.c_str();
486 else
487 ostr << "deleted Wire";
488 return ostr;
489 }
490 struct Memory
491 {
492 unsigned int hashidx_;
493 Yosys::RTLIL::Memory* ref_obj;
494
495 Memory(Yosys::RTLIL::Memory* ref)
496 {
497 this->hashidx_ = ref->hashidx_;
498 this->ref_obj = ref;
499 }
500
501 Yosys::RTLIL::Memory* get_cpp_obj() const
502 {
503 Yosys::RTLIL::Memory* ret = Yosys::RTLIL::Memory::get_all_memorys()->at(this->hashidx_);
504 if(ret != NULL && ret == this->ref_obj)
505 return ret;
506 return NULL;
507 }
508 };
509
510 std::ostream &operator<<(std::ostream &ostr, const Memory &ref)
511 {
512 if(ref.get_cpp_obj() != NULL)
513 ostr << "Memory with name " << ref.get_cpp_obj()->name.c_str();
514 else
515 ostr << "deleted Memory";
516 return ostr;
517 }
518 struct Module
519 {
520 unsigned int hashidx_;
521 Yosys::RTLIL::Module* ref_obj;
522
523 Module(Yosys::RTLIL::Module* ref = new Yosys::RTLIL::Module())
524 {
525 this->hashidx_ = ref->hashidx_;
526 this->ref_obj = ref;
527 }
528
529 Yosys::RTLIL::Module* get_cpp_obj() const
530 {
531 Yosys::RTLIL::Module* ret = Yosys::RTLIL::Module::get_all_modules()->at(this->hashidx_);
532 if(ret != NULL && ret == this->ref_obj)
533 return ret;
534 return NULL;
535 }
536
537 boost::python::list get_cells()
538 {
539 Yosys::RTLIL::Module* cpp_obj = get_cpp_obj();
540 boost::python::list result;
541 if(cpp_obj == NULL)
542 {
543 return result;
544 }
545 for(auto &mod_it : cpp_obj->cells_)
546 {
547 result.append(new Cell(mod_it.second));
548 }
549 return result;
550 }
551
552 boost::python::list get_wires()
553 {
554 Yosys::RTLIL::Module* cpp_obj = get_cpp_obj();
555 boost::python::list result;
556 if(cpp_obj == NULL)
557 {
558 return result;
559 }
560 for(auto &mod_it : cpp_obj->wires_)
561 {
562 result.append(new Wire(mod_it.second));
563 }
564 return result;
565 }
566
567 void register_monitor(Monitor* const m);
568
569 //WRAPPED void connect(const RTLIL::SigSig &conn);
570 void connect_SigSig(PyObject *conn);
571
572 //WRAPPED void connect(const RTLIL::SigSpec &lhs, const RTLIL::SigSpec &rhs);
573 void connect_SigSpec_SigSpec(SigSpec *lhs, SigSpec *rhs);
574
575 //WRAPPED void new_connections(const std::vector<RTLIL::SigSig> &new_conn);
576 void new_connections(boost::python::list *new_conn);
577
578 //WRAPPED void cloneInto(RTLIL::Module *new_mod) const;
579 void cloneInto(Module *new_mod);
580
581 //WRAPPED void remove(const pool<RTLIL::Wire*> &wires);
582 void remove_pool_Wire(boost::python::list *wires);
583
584 //WRAPPED void remove(RTLIL::Cell *cell);
585 void remove_Cell(Cell *cell);
586
587 //WRAPPED void rename(RTLIL::Wire *wire, RTLIL::IdString new_name);
588 void rename_Wire_IdString(Wire *wire, IdString *new_name);
589
590 //WRAPPED void rename(RTLIL::Cell *cell, RTLIL::IdString new_name);
591 void rename_Cell_IdString(Cell *cell, IdString *new_name);
592
593 //WRAPPED void rename(RTLIL::IdString old_name, RTLIL::IdString new_name);
594 void rename_IdString_IdString(IdString *old_name, IdString *new_name);
595
596 //WRAPPED void swap_names(RTLIL::Wire *w1, RTLIL::Wire *w2);
597 void swap_names_Wire_Wire(Wire *w1, Wire *w2);
598
599 //WRAPPED void swap_names(RTLIL::Cell *c1, RTLIL::Cell *c2);
600 void swap_names_Cell_Cell(Cell *c1, Cell *c2);
601
602 //WRAPPED RTLIL::IdString uniquify(RTLIL::IdString name);
603 IdString uniquify_IdString(IdString *name);
604
605 //WRAPPED RTLIL::IdString uniquify(RTLIL::IdString name, int &index);
606 IdString uniquify_IdString_int(IdString *name, int index);
607
608 //WRAPPED RTLIL::Wire *addWire(RTLIL::IdString name, int width = 1);
609 Wire addWire_IdString_int(IdString *name, int width = 1);
610
611 //WRAPPED RTLIL::Wire *addWire(RTLIL::IdString name, const RTLIL::Wire *other);
612 Wire addWire_IdString_Wire(IdString *name, Wire *other);
613
614 //WRAPPED RTLIL::Cell *addCell(RTLIL::IdString name, RTLIL::IdString type);
615 Cell addCell_IdString_IdString(IdString *name, IdString *type);
616
617 //WRAPPED RTLIL::Cell *addCell(RTLIL::IdString name, const RTLIL::Cell *other);
618 Cell addCell_IdString_Cell(IdString *name, Cell *other);
619
620 //WRAPPED RTLIL::Cell* addNot(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
621 Cell addNot(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
622
623 //WRAPPED RTLIL::Cell* addPos(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
624 Cell addPos(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
625
626 //WRAPPED RTLIL::Cell* addNeg(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
627 Cell addNeg(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
628
629 //WRAPPED RTLIL::Cell* addAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
630 Cell addAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
631
632 //WRAPPED RTLIL::Cell* addOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
633 Cell addOr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
634
635 //WRAPPED RTLIL::Cell* addXor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
636 Cell addXor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
637
638 //WRAPPED RTLIL::Cell* addXnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
639 Cell addXnor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
640
641 //WRAPPED RTLIL::Cell* addReduceAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
642 Cell addReduceAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
643
644 //WRAPPED RTLIL::Cell* addReduceOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
645 Cell addReduceOr(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
646
647 //WRAPPED RTLIL::Cell* addReduceXor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
648 Cell addReduceXor(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
649
650 //WRAPPED RTLIL::Cell* addReduceXnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
651 Cell addReduceXnor(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
652
653 //WRAPPED RTLIL::Cell* addReduceBool(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
654 Cell addReduceBool(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
655
656 //WRAPPED RTLIL::Cell* addShl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
657 Cell addShl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
658
659 //WRAPPED RTLIL::Cell* addShr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
660 Cell addShr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
661
662 //WRAPPED RTLIL::Cell* addSshl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
663 Cell addSshl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
664
665 //WRAPPED RTLIL::Cell* addSshr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
666 Cell addSshr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
667
668 //WRAPPED RTLIL::Cell* addShift(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
669 Cell addShift(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
670
671 //WRAPPED RTLIL::Cell* addShiftx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
672 Cell addShiftx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
673
674 //WRAPPED RTLIL::Cell* addLt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
675 Cell addLt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
676
677 //WRAPPED RTLIL::Cell* addLe(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
678 Cell addLe(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
679
680 //WRAPPED RTLIL::Cell* addEq(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
681 Cell addEq(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
682
683 //WRAPPED RTLIL::Cell* addNe(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
684 Cell addNe(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
685
686 //WRAPPED RTLIL::Cell* addEqx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
687 Cell addEqx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
688
689 //WRAPPED RTLIL::Cell* addNex(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
690 Cell addNex(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
691
692 //WRAPPED RTLIL::Cell* addGe(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
693 Cell addGe(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
694
695 //WRAPPED RTLIL::Cell* addGt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
696 Cell addGt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
697
698 //WRAPPED RTLIL::Cell* addAdd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
699 Cell addAdd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
700
701 //WRAPPED RTLIL::Cell* addSub(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
702 Cell addSub(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
703
704 //WRAPPED RTLIL::Cell* addMul(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
705 Cell addMul(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
706
707 //WRAPPED RTLIL::Cell* addDiv(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
708 Cell addDiv(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
709
710 //WRAPPED RTLIL::Cell* addMod(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
711 Cell addMod(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
712
713 //WRAPPED RTLIL::Cell* addPow(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool a_signed = false, bool b_signed = false, const std::string &src = "");
714 Cell addPow(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool a_signed = false, bool b_signed = false, std::string src = "");
715
716 //WRAPPED RTLIL::Cell* addLogicNot(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
717 Cell addLogicNot(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed = false, std::string src = "");
718
719 //WRAPPED RTLIL::Cell* addLogicAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
720 Cell addLogicAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
721
722 //WRAPPED RTLIL::Cell* addLogicOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
723 Cell addLogicOr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed = false, std::string src = "");
724
725 //WRAPPED RTLIL::Cell* addMux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, RTLIL::SigSpec sig_y, const std::string &src = "");
726 Cell addMux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, SigSpec *sig_y, std::string src = "");
727
728 //WRAPPED RTLIL::Cell* addPmux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, RTLIL::SigSpec sig_y, const std::string &src = "");
729 Cell addPmux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, SigSpec *sig_y, std::string src = "");
730
731 //WRAPPED RTLIL::Cell* addSlice(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, RTLIL::Const offset, const std::string &src = "");
732 Cell addSlice(IdString *name, SigSpec *sig_a, SigSpec *sig_y, Const *offset, std::string src = "");
733
734 //WRAPPED RTLIL::Cell* addConcat(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, const std::string &src = "");
735 Cell addConcat(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, std::string src = "");
736
737 //WRAPPED RTLIL::Cell* addLut(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, RTLIL::Const lut, const std::string &src = "");
738 Cell addLut(IdString *name, SigSpec *sig_a, SigSpec *sig_y, Const *lut, std::string src = "");
739
740 //WRAPPED RTLIL::Cell* addTribuf(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_y, const std::string &src = "");
741 Cell addTribuf(IdString *name, SigSpec *sig_a, SigSpec *sig_en, SigSpec *sig_y, std::string src = "");
742
743 //WRAPPED RTLIL::Cell* addAssert(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
744 Cell addAssert(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src = "");
745
746 //WRAPPED RTLIL::Cell* addAssume(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
747 Cell addAssume(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src = "");
748
749 //WRAPPED RTLIL::Cell* addLive(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
750 Cell addLive(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src = "");
751
752 //WRAPPED RTLIL::Cell* addFair(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
753 Cell addFair(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src = "");
754
755 //WRAPPED RTLIL::Cell* addCover(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
756 Cell addCover(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src = "");
757
758 //WRAPPED RTLIL::Cell* addEquiv(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, const std::string &src = "");
759 Cell addEquiv(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, std::string src = "");
760
761 //WRAPPED RTLIL::Cell* addSr(RTLIL::IdString name, RTLIL::SigSpec sig_set, RTLIL::SigSpec sig_clr, RTLIL::SigSpec sig_q, bool set_polarity = true, bool clr_polarity = true, const std::string &src = "");
762 Cell addSr(IdString *name, SigSpec *sig_set, SigSpec *sig_clr, SigSpec *sig_q, bool set_polarity = true, bool clr_polarity = true, std::string src = "");
763
764 //WRAPPED RTLIL::Cell* addFf(RTLIL::IdString name, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, const std::string &src = "");
765 Cell addFf(IdString *name, SigSpec *sig_d, SigSpec *sig_q, std::string src = "");
766
767 //WRAPPED RTLIL::Cell* addDff(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, const std::string &src = "");
768 Cell addDff(IdString *name, SigSpec *sig_clk, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity = true, std::string src = "");
769
770 //WRAPPED RTLIL::Cell* addDffe(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, bool en_polarity = true, const std::string &src = "");
771 Cell addDffe(IdString *name, SigSpec *sig_clk, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity = true, bool en_polarity = true, std::string src = "");
772
773 //WRAPPED RTLIL::Cell* addDlatch(RTLIL::IdString name, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool en_polarity = true, const std::string &src = "");
774 Cell addDlatch(IdString *name, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool en_polarity = true, std::string src = "");
775
776 //WRAPPED RTLIL::Cell* addBufGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_y, const std::string &src = "");
777 Cell addBufGate(IdString *name, SigBit *sig_a, SigBit *sig_y, std::string src = "");
778
779 //WRAPPED RTLIL::Cell* addNotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_y, const std::string &src = "");
780 Cell addNotGate(IdString *name, SigBit *sig_a, SigBit *sig_y, std::string src = "");
781
782 //WRAPPED RTLIL::Cell* addAndGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
783 Cell addAndGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
784
785 //WRAPPED RTLIL::Cell* addNandGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
786 Cell addNandGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
787
788 //WRAPPED RTLIL::Cell* addOrGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
789 Cell addOrGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
790
791 //WRAPPED RTLIL::Cell* addNorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
792 Cell addNorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
793
794 //WRAPPED RTLIL::Cell* addXorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
795 Cell addXorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
796
797 //WRAPPED RTLIL::Cell* addXnorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
798 Cell addXnorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
799
800 //WRAPPED RTLIL::Cell* addAndnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
801 Cell addAndnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
802
803 //WRAPPED RTLIL::Cell* addOrnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
804 Cell addOrnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src = "");
805
806 //WRAPPED RTLIL::Cell* addMuxGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_s, RTLIL::SigBit sig_y, const std::string &src = "");
807 Cell addMuxGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_s, SigBit *sig_y, std::string src = "");
808
809 //WRAPPED RTLIL::Cell* addAoi3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_y, const std::string &src = "");
810 Cell addAoi3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_y, std::string src = "");
811
812 //WRAPPED RTLIL::Cell* addOai3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_y, const std::string &src = "");
813 Cell addOai3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_y, std::string src = "");
814
815 //WRAPPED RTLIL::Cell* addAoi4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, RTLIL::SigBit sig_y, const std::string &src = "");
816 Cell addAoi4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, SigBit *sig_y, std::string src = "");
817
818 //WRAPPED RTLIL::Cell* addOai4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, RTLIL::SigBit sig_y, const std::string &src = "");
819 Cell addOai4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, SigBit *sig_y, std::string src = "");
820
821 //WRAPPED RTLIL::Cell* addFfGate(RTLIL::IdString name, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, const std::string &src = "");
822 Cell addFfGate(IdString *name, SigSpec *sig_d, SigSpec *sig_q, std::string src = "");
823
824 //WRAPPED RTLIL::Cell* addDffGate(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, const std::string &src = "");
825 Cell addDffGate(IdString *name, SigSpec *sig_clk, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity = true, std::string src = "");
826
827 //WRAPPED RTLIL::Cell* addDffeGate(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, bool en_polarity = true, const std::string &src = "");
828 Cell addDffeGate(IdString *name, SigSpec *sig_clk, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity = true, bool en_polarity = true, std::string src = "");
829
830 //WRAPPED RTLIL::Cell* addDlatchGate(RTLIL::IdString name, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool en_polarity = true, const std::string &src = "");
831 Cell addDlatchGate(IdString *name, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool en_polarity = true, std::string src = "");
832
833 //WRAPPED RTLIL::SigSpec Not(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
834 SigSpec Not(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
835
836 //WRAPPED RTLIL::SigSpec Pos(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
837 SigSpec Pos(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
838
839 //WRAPPED RTLIL::SigSpec Neg(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
840 SigSpec Neg(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
841
842 //WRAPPED RTLIL::SigSpec And(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
843 SigSpec And(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
844
845 //WRAPPED RTLIL::SigSpec Or(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
846 SigSpec Or(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
847
848 //WRAPPED RTLIL::SigSpec Xor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
849 SigSpec Xor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
850
851 //WRAPPED RTLIL::SigSpec Xnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
852 SigSpec Xnor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
853
854 //WRAPPED RTLIL::SigSpec ReduceAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
855 SigSpec ReduceAnd(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
856
857 //WRAPPED RTLIL::SigSpec ReduceOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
858 SigSpec ReduceOr(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
859
860 //WRAPPED RTLIL::SigSpec ReduceXor(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
861 SigSpec ReduceXor(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
862
863 //WRAPPED RTLIL::SigSpec ReduceXnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
864 SigSpec ReduceXnor(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
865
866 //WRAPPED RTLIL::SigSpec ReduceBool(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
867 SigSpec ReduceBool(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
868
869 //WRAPPED RTLIL::SigSpec Shl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
870 SigSpec Shl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
871
872 //WRAPPED RTLIL::SigSpec Shr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
873 SigSpec Shr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
874
875 //WRAPPED RTLIL::SigSpec Sshl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
876 SigSpec Sshl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
877
878 //WRAPPED RTLIL::SigSpec Sshr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
879 SigSpec Sshr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
880
881 //WRAPPED RTLIL::SigSpec Shift(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
882 SigSpec Shift(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
883
884 //WRAPPED RTLIL::SigSpec Shiftx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
885 SigSpec Shiftx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
886
887 //WRAPPED RTLIL::SigSpec Lt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
888 SigSpec Lt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
889
890 //WRAPPED RTLIL::SigSpec Le(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
891 SigSpec Le(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
892
893 //WRAPPED RTLIL::SigSpec Eq(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
894 SigSpec Eq(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
895
896 //WRAPPED RTLIL::SigSpec Ne(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
897 SigSpec Ne(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
898
899 //WRAPPED RTLIL::SigSpec Eqx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
900 SigSpec Eqx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
901
902 //WRAPPED RTLIL::SigSpec Nex(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
903 SigSpec Nex(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
904
905 //WRAPPED RTLIL::SigSpec Ge(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
906 SigSpec Ge(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
907
908 //WRAPPED RTLIL::SigSpec Gt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
909 SigSpec Gt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
910
911 //WRAPPED RTLIL::SigSpec Add(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
912 SigSpec Add(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
913
914 //WRAPPED RTLIL::SigSpec Sub(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
915 SigSpec Sub(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
916
917 //WRAPPED RTLIL::SigSpec Mul(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
918 SigSpec Mul(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
919
920 //WRAPPED RTLIL::SigSpec Div(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
921 SigSpec Div(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
922
923 //WRAPPED RTLIL::SigSpec Mod(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
924 SigSpec Mod(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
925
926 //WRAPPED RTLIL::SigSpec LogicNot(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
927 SigSpec LogicNot(IdString *name, SigSpec *sig_a, bool is_signed = false, std::string src = "");
928
929 //WRAPPED RTLIL::SigSpec LogicAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
930 SigSpec LogicAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
931
932 //WRAPPED RTLIL::SigSpec LogicOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
933 SigSpec LogicOr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed = false, std::string src = "");
934
935 //WRAPPED RTLIL::SigSpec Mux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, const std::string &src = "");
936 SigSpec Mux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, std::string src = "");
937
938 //WRAPPED RTLIL::SigSpec Pmux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, const std::string &src = "");
939 SigSpec Pmux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, std::string src = "");
940
941 //WRAPPED RTLIL::SigBit BufGate(RTLIL::IdString name, RTLIL::SigBit sig_a, const std::string &src = "");
942 SigBit BufGate(IdString *name, SigBit *sig_a, std::string src = "");
943
944 //WRAPPED RTLIL::SigBit NotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, const std::string &src = "");
945 SigBit NotGate(IdString *name, SigBit *sig_a, std::string src = "");
946
947 //WRAPPED RTLIL::SigBit AndGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
948 SigBit AndGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
949
950 //WRAPPED RTLIL::SigBit NandGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
951 SigBit NandGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
952
953 //WRAPPED RTLIL::SigBit OrGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
954 SigBit OrGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
955
956 //WRAPPED RTLIL::SigBit NorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
957 SigBit NorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
958
959 //WRAPPED RTLIL::SigBit XorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
960 SigBit XorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
961
962 //WRAPPED RTLIL::SigBit XnorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
963 SigBit XnorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
964
965 //WRAPPED RTLIL::SigBit AndnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
966 SigBit AndnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
967
968 //WRAPPED RTLIL::SigBit OrnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
969 SigBit OrnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src = "");
970
971 //WRAPPED RTLIL::SigBit MuxGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_s, const std::string &src = "");
972 SigBit MuxGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_s, std::string src = "");
973
974 //WRAPPED RTLIL::SigBit Aoi3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, const std::string &src = "");
975 SigBit Aoi3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, std::string src = "");
976
977 //WRAPPED RTLIL::SigBit Oai3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, const std::string &src = "");
978 SigBit Oai3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, std::string src = "");
979
980 //WRAPPED RTLIL::SigBit Aoi4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, const std::string &src = "");
981 SigBit Aoi4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, std::string src = "");
982
983 //WRAPPED RTLIL::SigBit Oai4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, const std::string &src = "");
984 SigBit Oai4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, std::string src = "");
985
986 //WRAPPED RTLIL::SigSpec Anyconst(RTLIL::IdString name, int width = 1, const std::string &src = "");
987 SigSpec Anyconst(IdString *name, int width = 1, std::string src = "");
988
989 //WRAPPED RTLIL::SigSpec Anyseq(RTLIL::IdString name, int width = 1, const std::string &src = "");
990 SigSpec Anyseq(IdString *name, int width = 1, std::string src = "");
991
992 //WRAPPED RTLIL::SigSpec Allconst(RTLIL::IdString name, int width = 1, const std::string &src = "");
993 SigSpec Allconst(IdString *name, int width = 1, std::string src = "");
994
995 //WRAPPED RTLIL::SigSpec Allseq(RTLIL::IdString name, int width = 1, const std::string &src = "");
996 SigSpec Allseq(IdString *name, int width = 1, std::string src = "");
997
998 //WRAPPED RTLIL::SigSpec Initstate(RTLIL::IdString name, const std::string &src = "");
999 SigSpec Initstate(IdString *name, std::string src = "");
1000 };
1001
1002 std::ostream &operator<<(std::ostream &ostr, const Module &ref)
1003 {
1004 if(ref.get_cpp_obj() != NULL)
1005 ostr << "Module with name " << ref.get_cpp_obj()->name.c_str();
1006 else
1007 ostr << "deleted Module";
1008 return ostr;
1009 }
1010 struct Design
1011 {
1012 unsigned int hashidx_;
1013 Yosys::RTLIL::Design* ref_obj;
1014
1015 Design(Yosys::RTLIL::Design* ref = new Yosys::RTLIL::Design())
1016 {
1017 this->hashidx_ = ref->hashidx_;
1018 this->ref_obj = ref;
1019 }
1020
1021 Yosys::RTLIL::Design* get_cpp_obj() const
1022 {
1023 Yosys::RTLIL::Design* ret = Yosys::RTLIL::Design::get_all_designs()->at(this->hashidx_);
1024 if(ret != NULL && ret == this->ref_obj)
1025 return ret;
1026 return NULL;
1027 }
1028
1029 boost::python::list get_modules()
1030 {
1031 Yosys::RTLIL::Design* cpp_obj = get_cpp_obj();
1032 boost::python::list result;
1033 if(cpp_obj == NULL)
1034 {
1035 return result;
1036 }
1037 for(auto &mod_it : cpp_obj->modules_)
1038 {
1039 result.append(new Module(mod_it.second));
1040 }
1041 return result;
1042 }
1043
1044 void run(std::string command)
1045 {
1046 Yosys::RTLIL::Design* cpp_design = get_cpp_obj();
1047 if(cpp_design != NULL)
1048 Yosys::run_pass(command, cpp_design);
1049
1050 }
1051
1052 void register_monitor(Monitor* const m);
1053
1054 //WRAPPED RTLIL::Module *module(RTLIL::IdString name);
1055 Module module(IdString *name);
1056
1057 //WRAPPED bool has(RTLIL::IdString id) const {
1058 bool has(IdString *id);
1059
1060 //WRAPPED void add(RTLIL::Module *module);
1061 void add(Module *module);
1062
1063 //WRAPPED RTLIL::Module *addModule(RTLIL::IdString name);
1064 Module addModule(IdString *name);
1065
1066 //WRAPPED void remove(RTLIL::Module *module);
1067 void remove(Module *module);
1068
1069 //WRAPPED void rename(RTLIL::Module *module, RTLIL::IdString new_name);
1070 void rename(Module *module, IdString *new_name);
1071
1072 //WRAPPED void scratchpad_unset(std::string varname);
1073 void scratchpad_unset(std::string varname);
1074
1075 //WRAPPED void scratchpad_set_int(std::string varname, int value);
1076 void scratchpad_set_int(std::string varname, int value);
1077
1078 //WRAPPED void scratchpad_set_bool(std::string varname, bool value);
1079 void scratchpad_set_bool(std::string varname, bool value);
1080
1081 //WRAPPED void scratchpad_set_string(std::string varname, std::string value);
1082 void scratchpad_set_string(std::string varname, std::string value);
1083
1084 //WRAPPED int scratchpad_get_int(std::string varname, int default_value = 0) const;
1085 int scratchpad_get_int(std::string varname, int default_value = 0);
1086
1087 //WRAPPED bool scratchpad_get_bool(std::string varname, bool default_value = false) const;
1088 bool scratchpad_get_bool(std::string varname, bool default_value = false);
1089
1090 //WRAPPED std::string scratchpad_get_string(std::string varname, std::string default_value = std::string()) const;
1091 std::string scratchpad_get_string(std::string varname, std::string default_value = std::string());
1092
1093 //WRAPPED bool selected_module(RTLIL::IdString mod_name) const;
1094 bool selected_module_IdString(IdString *mod_name);
1095
1096 //WRAPPED bool selected_whole_module(RTLIL::IdString mod_name) const;
1097 bool selected_whole_module_IdString(IdString *mod_name);
1098
1099 //WRAPPED bool selected_member(RTLIL::IdString mod_name, RTLIL::IdString memb_name) const;
1100 bool selected_member(IdString *mod_name, IdString *memb_name);
1101
1102 //WRAPPED bool selected_module(RTLIL::Module *mod) const;
1103 bool selected_module_Module(Module *mod);
1104
1105 //WRAPPED bool selected_whole_module(RTLIL::Module *mod) const;
1106 bool selected_whole_module_Module(Module *mod);
1107 };
1108
1109 std::ostream &operator<<(std::ostream &ostr, const Design &ref)
1110 {
1111 if(ref.get_cpp_obj() != NULL)
1112 ostr << "Design with identifier " << ref.hashidx_;
1113 else
1114 ostr << "deleted Design";
1115 return ostr;
1116 }
1117
1118 //WRAPPED static inline std::string escape_id(std::string str) {
1119 inline std::string escape_id(std::string str)
1120 {
1121 return Yosys::RTLIL::escape_id(str);
1122 }
1123
1124 //WRAPPED static inline std::string unescape_id(std::string str) {
1125 inline std::string unescape_id_std_string(std::string str)
1126 {
1127 return Yosys::RTLIL::unescape_id(str);
1128 }
1129
1130 //WRAPPED static inline std::string unescape_id(RTLIL::IdString str) {
1131 inline std::string unescape_id_IdString(IdString *str)
1132 {
1133 return Yosys::RTLIL::unescape_id(*str->get_cpp_obj());
1134 }
1135
1136 //WRAPPED RTLIL::Const const_not(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1137 Const const_not(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1138 {
1139 return Const(Yosys::RTLIL::const_not(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1140 }
1141
1142 //WRAPPED RTLIL::Const const_and(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1143 Const const_and(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1144 {
1145 return Const(Yosys::RTLIL::const_and(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1146 }
1147
1148 //WRAPPED RTLIL::Const const_or(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1149 Const const_or(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1150 {
1151 return Const(Yosys::RTLIL::const_or(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1152 }
1153
1154 //WRAPPED RTLIL::Const const_xor(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1155 Const const_xor(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1156 {
1157 return Const(Yosys::RTLIL::const_xor(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1158 }
1159
1160 //WRAPPED RTLIL::Const const_xnor(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1161 Const const_xnor(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1162 {
1163 return Const(Yosys::RTLIL::const_xnor(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1164 }
1165
1166 //WRAPPED RTLIL::Const const_reduce_and(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1167 Const const_reduce_and(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1168 {
1169 return Const(Yosys::RTLIL::const_reduce_and(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1170 }
1171
1172 //WRAPPED RTLIL::Const const_reduce_or(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1173 Const const_reduce_or(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1174 {
1175 return Const(Yosys::RTLIL::const_reduce_or(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1176 }
1177
1178 //WRAPPED RTLIL::Const const_reduce_xor(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1179 Const const_reduce_xor(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1180 {
1181 return Const(Yosys::RTLIL::const_reduce_xor(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1182 }
1183
1184 //WRAPPED RTLIL::Const const_reduce_xnor(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1185 Const const_reduce_xnor(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1186 {
1187 return Const(Yosys::RTLIL::const_reduce_xnor(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1188 }
1189
1190 //WRAPPED RTLIL::Const const_reduce_bool(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1191 Const const_reduce_bool(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1192 {
1193 return Const(Yosys::RTLIL::const_reduce_bool(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1194 }
1195
1196 //WRAPPED RTLIL::Const const_logic_not(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1197 Const const_logic_not(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1198 {
1199 return Const(Yosys::RTLIL::const_logic_not(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1200 }
1201
1202 //WRAPPED RTLIL::Const const_logic_and(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1203 Const const_logic_and(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1204 {
1205 return Const(Yosys::RTLIL::const_logic_and(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1206 }
1207
1208 //WRAPPED RTLIL::Const const_logic_or(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1209 Const const_logic_or(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1210 {
1211 return Const(Yosys::RTLIL::const_logic_or(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1212 }
1213
1214 //WRAPPED RTLIL::Const const_shl(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1215 Const const_shl(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1216 {
1217 return Const(Yosys::RTLIL::const_shl(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1218 }
1219
1220 //WRAPPED RTLIL::Const const_shr(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1221 Const const_shr(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1222 {
1223 return Const(Yosys::RTLIL::const_shr(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1224 }
1225
1226 //WRAPPED RTLIL::Const const_sshl(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1227 Const const_sshl(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1228 {
1229 return Const(Yosys::RTLIL::const_sshl(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1230 }
1231
1232 //WRAPPED RTLIL::Const const_sshr(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1233 Const const_sshr(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1234 {
1235 return Const(Yosys::RTLIL::const_sshr(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1236 }
1237
1238 //WRAPPED RTLIL::Const const_shift(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1239 Const const_shift(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1240 {
1241 return Const(Yosys::RTLIL::const_shift(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1242 }
1243
1244 //WRAPPED RTLIL::Const const_shiftx(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1245 Const const_shiftx(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1246 {
1247 return Const(Yosys::RTLIL::const_shiftx(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1248 }
1249
1250 //WRAPPED RTLIL::Const const_lt(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1251 Const const_lt(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1252 {
1253 return Const(Yosys::RTLIL::const_lt(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1254 }
1255
1256 //WRAPPED RTLIL::Const const_le(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1257 Const const_le(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1258 {
1259 return Const(Yosys::RTLIL::const_le(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1260 }
1261
1262 //WRAPPED RTLIL::Const const_eq(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1263 Const const_eq(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1264 {
1265 return Const(Yosys::RTLIL::const_eq(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1266 }
1267
1268 //WRAPPED RTLIL::Const const_ne(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1269 Const const_ne(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1270 {
1271 return Const(Yosys::RTLIL::const_ne(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1272 }
1273
1274 //WRAPPED RTLIL::Const const_eqx(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1275 Const const_eqx(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1276 {
1277 return Const(Yosys::RTLIL::const_eqx(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1278 }
1279
1280 //WRAPPED RTLIL::Const const_nex(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1281 Const const_nex(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1282 {
1283 return Const(Yosys::RTLIL::const_nex(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1284 }
1285
1286 //WRAPPED RTLIL::Const const_ge(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1287 Const const_ge(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1288 {
1289 return Const(Yosys::RTLIL::const_ge(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1290 }
1291
1292 //WRAPPED RTLIL::Const const_gt(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1293 Const const_gt(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1294 {
1295 return Const(Yosys::RTLIL::const_gt(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1296 }
1297
1298 //WRAPPED RTLIL::Const const_add(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1299 Const const_add(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1300 {
1301 return Const(Yosys::RTLIL::const_add(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1302 }
1303
1304 //WRAPPED RTLIL::Const const_sub(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1305 Const const_sub(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1306 {
1307 return Const(Yosys::RTLIL::const_sub(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1308 }
1309
1310 //WRAPPED RTLIL::Const const_mul(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1311 Const const_mul(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1312 {
1313 return Const(Yosys::RTLIL::const_mul(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1314 }
1315
1316 //WRAPPED RTLIL::Const const_div(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1317 Const const_div(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1318 {
1319 return Const(Yosys::RTLIL::const_div(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1320 }
1321
1322 //WRAPPED RTLIL::Const const_mod(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1323 Const const_mod(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1324 {
1325 return Const(Yosys::RTLIL::const_mod(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1326 }
1327
1328 //WRAPPED RTLIL::Const const_pow(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1329 Const const_pow(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1330 {
1331 return Const(Yosys::RTLIL::const_pow(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1332 }
1333
1334 //WRAPPED RTLIL::Const const_pos(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1335 Const const_pos(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1336 {
1337 return Const(Yosys::RTLIL::const_pos(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1338 }
1339
1340 //WRAPPED RTLIL::Const const_neg(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len);
1341 Const const_neg(Const *arg1, Const *arg2, bool signed1, bool signed2, int result_len)
1342 {
1343 return Const(Yosys::RTLIL::const_neg(*arg1->get_cpp_obj(), *arg2->get_cpp_obj(), signed1, signed2, result_len));
1344 }
1345
1346 struct Monitor : public Yosys::RTLIL::Monitor
1347 {
1348
1349 virtual void notify_module_add(Yosys::RTLIL::Module *module) YS_OVERRIDE
1350 {
1351 py_notify_module_add(new Module(module));
1352 }
1353
1354 virtual void notify_module_del(Yosys::RTLIL::Module *module) YS_OVERRIDE
1355 {
1356 py_notify_module_del(new Module(module));
1357 }
1358
1359 virtual void notify_connect(Yosys::RTLIL::Cell *cell, const Yosys::RTLIL::IdString &port, const Yosys::RTLIL::SigSpec &old_sig, Yosys::RTLIL::SigSpec &sig) YS_OVERRIDE
1360 {
1361 Yosys::RTLIL::IdString *tmp_port = new Yosys::RTLIL::IdString(port);
1362 Yosys::RTLIL::SigSpec *tmp_old_sig = new Yosys::RTLIL::SigSpec(old_sig);
1363 py_notify_connect_cell(new Cell(cell), new IdString(tmp_port), new SigSpec(tmp_old_sig), new SigSpec(&sig));
1364 delete tmp_port;
1365 delete tmp_old_sig;
1366 }
1367
1368 virtual void notify_connect(Yosys::RTLIL::Module *module, const Yosys::RTLIL::SigSig &sigsig) YS_OVERRIDE
1369 {
1370 Yosys::RTLIL::SigSpec *first = new Yosys::RTLIL::SigSpec(sigsig.first);
1371 Yosys::RTLIL::SigSpec *second = new Yosys::RTLIL::SigSpec(sigsig.second);
1372 py_notify_connect_tuple(new Module(module), boost::python::make_tuple(new SigSpec(first), new SigSpec(second)));
1373 delete first;
1374 delete second;
1375 }
1376
1377 virtual void notify_connect(Yosys::RTLIL::Module *module, const std::vector<Yosys::RTLIL::SigSig> &sigsig_vec) YS_OVERRIDE
1378 {
1379 boost::python::list sigsig_list;
1380 for(auto sigsig : sigsig_vec)
1381 sigsig_list.append(boost::python::make_tuple(new SigSpec(&sigsig.first), new SigSpec(&sigsig.second)));
1382 py_notify_connect_list(new Module(module), sigsig_list);
1383 }
1384
1385 virtual void notify_blackout(Yosys::RTLIL::Module *module) YS_OVERRIDE
1386 {
1387 py_notify_blackout(new Module(module));
1388 }
1389
1390 virtual void py_notify_module_add(Module*){};
1391 virtual void py_notify_module_del(Module*){};
1392 virtual void py_notify_connect_cell(Cell *cell, IdString *port, SigSpec *old_sig, SigSpec *sig){};
1393 virtual void py_notify_connect_tuple(Module *module, boost::python::tuple sigsig){};
1394 virtual void py_notify_connect_list(Module* module, boost::python::list sigsig_list){};
1395 virtual void py_notify_blackout(Module*){};
1396 };
1397
1398 struct MonitorWrap : Monitor, boost::python::wrapper<Monitor>
1399 {
1400 void py_notify_module_add(Module* m)
1401 {
1402 if(boost::python::override py_notify_module_add = this->get_override("py_notify_module_add"))
1403 py_notify_module_add(m);
1404 else
1405 Monitor::py_notify_module_add(m);
1406 }
1407
1408 void default_py_notify_module_add(Module* m)
1409 {
1410 this->Monitor::py_notify_module_add(m);
1411 }
1412
1413 void py_notify_module_del(Module* m)
1414 {
1415 if(boost::python::override py_notify_module_del = this->get_override("py_notify_module_del"))
1416 py_notify_module_del(m);
1417 else
1418 Monitor::py_notify_module_del(m);
1419 }
1420
1421 void default_py_notify_module_del(Module* m)
1422 {
1423 this->Monitor::py_notify_module_del(m);
1424 }
1425
1426 void py_notify_connect_cell(Cell *cell, IdString *port, SigSpec *old_sig, SigSpec *sig)
1427 {
1428 if(boost::python::override py_notify_connect_cell = this->get_override("py_notify_connect_cell"))
1429 py_notify_connect_cell(cell, port, old_sig, sig);
1430 else
1431 Monitor::py_notify_connect_cell(cell, port, old_sig, sig);
1432 }
1433
1434 void default_py_notify_connect_cell(Cell *cell, IdString *port, SigSpec *old_sig, SigSpec *sig)
1435 {
1436 this->Monitor::py_notify_connect_cell(cell, port, old_sig, sig);
1437 }
1438
1439 void py_notify_connect_tuple(Module *module, boost::python::tuple sigsig)
1440 {
1441 if(boost::python::override py_notify_connect_tuple = this->get_override("py_notify_connect_tuple"))
1442 py_notify_connect_tuple(module, sigsig);
1443 else
1444 Monitor::py_notify_connect_tuple(module, sigsig);
1445 }
1446
1447 void default_py_notify_connect_tuple(Module *module, boost::python::tuple sigsig)
1448 {
1449 this->Monitor::py_notify_connect_tuple(module, sigsig);
1450 }
1451
1452 void py_notify_connect_list(Module* module, boost::python::list sigsig_list)
1453 {
1454 if(boost::python::override py_notify_connect_list = this->get_override("py_notify_connect_list"))
1455 py_notify_connect_list(module, sigsig_list);
1456 else
1457 Monitor::py_notify_connect_list(module, sigsig_list);
1458 }
1459
1460 void default_py_notify_connect_list(Module* module, boost::python::list sigsig_list)
1461 {
1462 this->Monitor::py_notify_connect_list(module, sigsig_list);
1463 }
1464
1465 void py_notify_blackout(Module* m)
1466 {
1467 if(boost::python::override py_notify_blackout = this->get_override("py_notify_blackout"))
1468 py_notify_blackout(m);
1469 else
1470 Monitor::py_notify_blackout(m);
1471 }
1472
1473 void default_py_notify_blackout(Module* m)
1474 {
1475 this->Monitor::py_notify_blackout(m);
1476 }
1477 };
1478
1479 struct PyPass : public Yosys::Pass
1480 {
1481 PyPass(std::string name, std::string short_help) : Yosys::Pass(name, short_help) { }
1482
1483 virtual void execute(vector<string> args, Yosys::RTLIL::Design* d) YS_OVERRIDE
1484 {
1485 boost::python::list py_args;
1486 for(auto arg : args)
1487 py_args.append(arg);
1488 py_execute(py_args, new Design(d));
1489 }
1490
1491 virtual void help() YS_OVERRIDE
1492 {
1493 py_help();
1494 }
1495
1496 virtual void py_execute(boost::python::list args, Design* d){}
1497 virtual void py_help(){}
1498 };
1499
1500 struct PassWrap : PyPass, boost::python::wrapper<PyPass>
1501 {
1502
1503 PassWrap(std::string name, std::string short_help) : PyPass(name, short_help) { }
1504
1505 void py_execute(boost::python::list args, Design* d)
1506 {
1507 if(boost::python::override py_execute = this->get_override("py_execute"))
1508 py_execute(args, d);
1509 else
1510 PyPass::py_execute(args, d);
1511 }
1512
1513 void default_py_execute(boost::python::list args, Design* d)
1514 {
1515 this->PyPass::py_execute(args, d);
1516 }
1517
1518 void py_help()
1519 {
1520 if(boost::python::override py_help = this->get_override("py_help"))
1521 py_help();
1522 else
1523 PyPass::py_help();
1524 }
1525
1526 void default_py_help()
1527 {
1528 this->PyPass::py_help();
1529 }
1530 };
1531
1532 void Module::register_monitor(Monitor* const m)
1533 {
1534 Yosys::RTLIL::Module* cpp_module = this->get_cpp_obj();
1535 if(cpp_module == NULL)
1536 return;
1537 cpp_module->monitors.insert(m);
1538 }
1539
1540 void Design::register_monitor(Monitor* const m)
1541 {
1542 Yosys::RTLIL::Design* cpp_design = this->get_cpp_obj();
1543 if(cpp_design == NULL)
1544 return;
1545 cpp_design->monitors.insert(m);
1546 }
1547
1548 //WRAPPED static inline int get_reference(int idx)
1549 inline int IdString::get_reference(int idx)
1550 {
1551 return Yosys::RTLIL::IdString::get_reference(idx);
1552 }
1553
1554 //WRAPPED static inline void put_reference(int idx)
1555 inline void IdString::put_reference(int idx)
1556 {
1557 Yosys::RTLIL::IdString::put_reference(idx);
1558 }
1559
1560 //WRAPPED bool in(IdString rhs) const { return *this == rhs; }
1561 bool IdString::in_IdString(IdString *rhs)
1562 {
1563 return this->get_cpp_obj()->in(*rhs->get_cpp_obj());
1564 }
1565
1566 //WRAPPED bool in(const std::string &rhs) const { return *this == rhs; }
1567 bool IdString::in_std_string(std::string rhs)
1568 {
1569 return this->get_cpp_obj()->in(rhs);
1570 }
1571
1572 //WRAPPED int as_int(bool is_signed = false) const;
1573 int Const::as_int(bool is_signed)
1574 {
1575 return this->get_cpp_obj()->as_int(is_signed);
1576 }
1577
1578 //WRAPPED static Const from_string(std::string str);
1579 Const Const::from_string(std::string str)
1580 {
1581 return Const(Yosys::RTLIL::Const::from_string(str));
1582 }
1583
1584 //WRAPPED inline RTLIL::Const extract(int offset, int len = 1, RTLIL::State padding = RTLIL::State::S0) const {
1585 inline Const Const::extract(int offset, int len, State padding)
1586 {
1587 return Const(this->get_cpp_obj()->extract(offset, len, padding));
1588 }
1589
1590 //WRAPPED RTLIL::SigChunk extract(int offset, int length) const;
1591 SigChunk SigChunk::extract(int offset, int length)
1592 {
1593 return SigChunk(this->get_cpp_obj()->extract(offset, length));
1594 }
1595
1596 //WRAPPED void replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with);
1597 void SigSpec::replace_SigSpec_SigSpec(SigSpec *pattern, SigSpec *with)
1598 {
1599 this->get_cpp_obj()->replace(*pattern->get_cpp_obj(), *with->get_cpp_obj());
1600 }
1601
1602 //WRAPPED void replace(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec &with, RTLIL::SigSpec *other) const;
1603 void SigSpec::replace_SigSpec_SigSpec_SigSpec(SigSpec *pattern, SigSpec *with, SigSpec *other)
1604 {
1605 this->get_cpp_obj()->replace(*pattern->get_cpp_obj(), *with->get_cpp_obj(), other->get_cpp_obj());
1606 }
1607
1608 //WRAPPED void replace(int offset, const RTLIL::SigSpec &with);
1609 void SigSpec::replace_int_SigSpec(int offset, SigSpec *with)
1610 {
1611 this->get_cpp_obj()->replace(offset, *with->get_cpp_obj());
1612 }
1613
1614 //WRAPPED void remove(const RTLIL::SigSpec &pattern);
1615 void SigSpec::remove_SigSpec(SigSpec *pattern)
1616 {
1617 this->get_cpp_obj()->remove(*pattern->get_cpp_obj());
1618 }
1619
1620 //WRAPPED void remove(const RTLIL::SigSpec &pattern, RTLIL::SigSpec *other) const;
1621 void SigSpec::remove_SigSpec_SigSpec(SigSpec *pattern, SigSpec *other)
1622 {
1623 this->get_cpp_obj()->remove(*pattern->get_cpp_obj(), other->get_cpp_obj());
1624 }
1625
1626 //WRAPPED void remove2(const RTLIL::SigSpec &pattern, RTLIL::SigSpec *other);
1627 void SigSpec::remove2_SigSpec_SigSpec(SigSpec *pattern, SigSpec *other)
1628 {
1629 this->get_cpp_obj()->remove2(*pattern->get_cpp_obj(), other->get_cpp_obj());
1630 }
1631
1632 //WRAPPED void remove(const pool<RTLIL::SigBit> &pattern);
1633 void SigSpec::remove_pool_SigBit(boost::python::list *pattern)
1634 {
1635 pool<Yosys::RTLIL::SigBit> pattern_;
1636 for(int i = 0; i < len(*pattern); ++i)
1637 {
1638 }
1639 this->get_cpp_obj()->remove(pattern_);
1640 }
1641
1642 //WRAPPED void remove(const pool<RTLIL::SigBit> &pattern, RTLIL::SigSpec *other) const;
1643 void SigSpec::remove_pool_SigBit_SigSpec(boost::python::list *pattern, SigSpec *other)
1644 {
1645 pool<Yosys::RTLIL::SigBit> pattern_;
1646 for(int i = 0; i < len(*pattern); ++i)
1647 {
1648 }
1649 this->get_cpp_obj()->remove(pattern_, other->get_cpp_obj());
1650 }
1651
1652 //WRAPPED void remove2(const pool<RTLIL::SigBit> &pattern, RTLIL::SigSpec *other);
1653 void SigSpec::remove2_pool_SigBit_SigSpec(boost::python::list *pattern, SigSpec *other)
1654 {
1655 pool<Yosys::RTLIL::SigBit> pattern_;
1656 for(int i = 0; i < len(*pattern); ++i)
1657 {
1658 }
1659 this->get_cpp_obj()->remove2(pattern_, other->get_cpp_obj());
1660 }
1661
1662 //WRAPPED void remove(int offset, int length = 1);
1663 void SigSpec::remove_int_int(int offset, int length)
1664 {
1665 this->get_cpp_obj()->remove(offset, length);
1666 }
1667
1668 //WRAPPED RTLIL::SigSpec extract(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec *other = NULL) const;
1669 SigSpec SigSpec::extract_SigSpec_SigSpec(SigSpec *pattern, SigSpec *other)
1670 {
1671 return SigSpec(this->get_cpp_obj()->extract(*pattern->get_cpp_obj(), other->get_cpp_obj()));
1672 }
1673
1674 //WRAPPED RTLIL::SigSpec extract(const pool<RTLIL::SigBit> &pattern, const RTLIL::SigSpec *other = NULL) const;
1675 SigSpec SigSpec::extract_pool_SigBit_SigSpec(boost::python::list *pattern, SigSpec *other)
1676 {
1677 pool<Yosys::RTLIL::SigBit> pattern_;
1678 for(int i = 0; i < len(*pattern); ++i)
1679 {
1680 }
1681 return SigSpec(this->get_cpp_obj()->extract(pattern_, other->get_cpp_obj()));
1682 }
1683
1684 //WRAPPED RTLIL::SigSpec extract(int offset, int length = 1) const;
1685 SigSpec SigSpec::extract_int_int(int offset, int length)
1686 {
1687 return SigSpec(this->get_cpp_obj()->extract(offset, length));
1688 }
1689
1690 //WRAPPED void append(const RTLIL::SigSpec &signal);
1691 void SigSpec::append(SigSpec *signal)
1692 {
1693 this->get_cpp_obj()->append(*signal->get_cpp_obj());
1694 }
1695
1696 //WRAPPED void append_bit(const RTLIL::SigBit &bit);
1697 void SigSpec::append_bit(SigBit *bit)
1698 {
1699 this->get_cpp_obj()->append_bit(*bit->get_cpp_obj());
1700 }
1701
1702 //WRAPPED void extend_u0(int width, bool is_signed = false);
1703 void SigSpec::extend_u0(int width, bool is_signed)
1704 {
1705 this->get_cpp_obj()->extend_u0(width, is_signed);
1706 }
1707
1708 //WRAPPED RTLIL::SigSpec repeat(int num) const;
1709 SigSpec SigSpec::repeat(int num)
1710 {
1711 return SigSpec(this->get_cpp_obj()->repeat(num));
1712 }
1713
1714 //WRAPPED int as_int(bool is_signed = false) const;
1715 int SigSpec::as_int(bool is_signed)
1716 {
1717 return this->get_cpp_obj()->as_int(is_signed);
1718 }
1719
1720 //WRAPPED bool match(std::string pattern) const;
1721 bool SigSpec::match(std::string pattern)
1722 {
1723 return this->get_cpp_obj()->match(pattern);
1724 }
1725
1726 //WRAPPED static bool parse(RTLIL::SigSpec &sig, RTLIL::Module *module, std::string str);
1727 bool SigSpec::parse(SigSpec *sig, Module *module, std::string str)
1728 {
1729 return Yosys::RTLIL::SigSpec::parse(*sig->get_cpp_obj(), module->get_cpp_obj(), str);
1730 }
1731
1732 //WRAPPED static bool parse_sel(RTLIL::SigSpec &sig, RTLIL::Design *design, RTLIL::Module *module, std::string str);
1733 bool SigSpec::parse_sel(SigSpec *sig, Design *design, Module *module, std::string str)
1734 {
1735 return Yosys::RTLIL::SigSpec::parse_sel(*sig->get_cpp_obj(), design->get_cpp_obj(), module->get_cpp_obj(), str);
1736 }
1737
1738 //WRAPPED static bool parse_rhs(const RTLIL::SigSpec &lhs, RTLIL::SigSpec &sig, RTLIL::Module *module, std::string str);
1739 bool SigSpec::parse_rhs(SigSpec *lhs, SigSpec *sig, Module *module, std::string str)
1740 {
1741 return Yosys::RTLIL::SigSpec::parse_rhs(*lhs->get_cpp_obj(), *sig->get_cpp_obj(), module->get_cpp_obj(), str);
1742 }
1743
1744 //WRAPPED bool hasPort(RTLIL::IdString portname) const;
1745 bool Cell::hasPort(IdString *portname)
1746 {
1747 return this->get_cpp_obj()->hasPort(*portname->get_cpp_obj());
1748 }
1749
1750 //WRAPPED void unsetPort(RTLIL::IdString portname);
1751 void Cell::unsetPort(IdString *portname)
1752 {
1753 this->get_cpp_obj()->unsetPort(*portname->get_cpp_obj());
1754 }
1755
1756 //WRAPPED void setPort(RTLIL::IdString portname, RTLIL::SigSpec signal);
1757 void Cell::setPort(IdString *portname, SigSpec *signal)
1758 {
1759 this->get_cpp_obj()->setPort(*portname->get_cpp_obj(), *signal->get_cpp_obj());
1760 }
1761
1762 //WRAPPED bool input(RTLIL::IdString portname) const;
1763 bool Cell::input(IdString *portname)
1764 {
1765 return this->get_cpp_obj()->input(*portname->get_cpp_obj());
1766 }
1767
1768 //WRAPPED bool output(RTLIL::IdString portname) const;
1769 bool Cell::output(IdString *portname)
1770 {
1771 return this->get_cpp_obj()->output(*portname->get_cpp_obj());
1772 }
1773
1774 //WRAPPED bool hasParam(RTLIL::IdString paramname) const;
1775 bool Cell::hasParam(IdString *paramname)
1776 {
1777 return this->get_cpp_obj()->hasParam(*paramname->get_cpp_obj());
1778 }
1779
1780 //WRAPPED void unsetParam(RTLIL::IdString paramname);
1781 void Cell::unsetParam(IdString *paramname)
1782 {
1783 this->get_cpp_obj()->unsetParam(*paramname->get_cpp_obj());
1784 }
1785
1786 //WRAPPED void setParam(RTLIL::IdString paramname, RTLIL::Const value);
1787 void Cell::setParam(IdString *paramname, Const *value)
1788 {
1789 this->get_cpp_obj()->setParam(*paramname->get_cpp_obj(), *value->get_cpp_obj());
1790 }
1791
1792 //WRAPPED void fixup_parameters(bool set_a_signed = false, bool set_b_signed = false);
1793 void Cell::fixup_parameters(bool set_a_signed, bool set_b_signed)
1794 {
1795 this->get_cpp_obj()->fixup_parameters(set_a_signed, set_b_signed);
1796 }
1797
1798 //WRAPPED void connect(const RTLIL::SigSig &conn);
1799 void Module::connect_SigSig(PyObject* conn)
1800 {
1801 if(!PyTuple_Check(conn) or PyTuple_Size(conn) != 2)
1802 throw std::logic_error("Tuple of two SigSpecs required");
1803 SigSpec conn_sp0 = boost::python::extract<SigSpec>(PyTuple_GetItem(conn, 0));
1804 SigSpec conn_sp1 = boost::python::extract<SigSpec>(PyTuple_GetItem(conn, 1));
1805 Yosys::RTLIL::SigSig conn_(conn_sp0.get_cpp_obj(), conn_sp1.get_cpp_obj());
1806 this->get_cpp_obj()->connect(conn_);
1807 }
1808
1809 //WRAPPED void connect(const RTLIL::SigSpec &lhs, const RTLIL::SigSpec &rhs);
1810 void Module::connect_SigSpec_SigSpec(SigSpec *lhs, SigSpec *rhs)
1811 {
1812 this->get_cpp_obj()->connect(*lhs->get_cpp_obj(), *rhs->get_cpp_obj());
1813 }
1814
1815 //WRAPPED void new_connections(const std::vector<RTLIL::SigSig> &new_conn);
1816 void Module::new_connections(boost::python::list *new_conn)
1817 {
1818 std::vector<Yosys::RTLIL::SigSig> new_conn_;
1819 for(int i = 0; i < len(*new_conn); ++i)
1820 {
1821 }
1822 this->get_cpp_obj()->new_connections(new_conn_);
1823 }
1824
1825 //WRAPPED void cloneInto(RTLIL::Module *new_mod) const;
1826 void Module::cloneInto(Module *new_mod)
1827 {
1828 this->get_cpp_obj()->cloneInto(new_mod->get_cpp_obj());
1829 }
1830
1831 //WRAPPED void remove(const pool<RTLIL::Wire*> &wires);
1832 void Module::remove_pool_Wire(boost::python::list *wires)
1833 {
1834 pool<Yosys::RTLIL::Wire*> wires_;
1835 for(int i = 0; i < len(*wires); ++i)
1836 {
1837 }
1838 this->get_cpp_obj()->remove(wires_);
1839 }
1840
1841 //WRAPPED void remove(RTLIL::Cell *cell);
1842 void Module::remove_Cell(Cell *cell)
1843 {
1844 this->get_cpp_obj()->remove(cell->get_cpp_obj());
1845 }
1846
1847 //WRAPPED void rename(RTLIL::Wire *wire, RTLIL::IdString new_name);
1848 void Module::rename_Wire_IdString(Wire *wire, IdString *new_name)
1849 {
1850 this->get_cpp_obj()->rename(wire->get_cpp_obj(), *new_name->get_cpp_obj());
1851 }
1852
1853 //WRAPPED void rename(RTLIL::Cell *cell, RTLIL::IdString new_name);
1854 void Module::rename_Cell_IdString(Cell *cell, IdString *new_name)
1855 {
1856 this->get_cpp_obj()->rename(cell->get_cpp_obj(), *new_name->get_cpp_obj());
1857 }
1858
1859 //WRAPPED void rename(RTLIL::IdString old_name, RTLIL::IdString new_name);
1860 void Module::rename_IdString_IdString(IdString *old_name, IdString *new_name)
1861 {
1862 this->get_cpp_obj()->rename(*old_name->get_cpp_obj(), *new_name->get_cpp_obj());
1863 }
1864
1865 //WRAPPED void swap_names(RTLIL::Wire *w1, RTLIL::Wire *w2);
1866 void Module::swap_names_Wire_Wire(Wire *w1, Wire *w2)
1867 {
1868 this->get_cpp_obj()->swap_names(w1->get_cpp_obj(), w2->get_cpp_obj());
1869 }
1870
1871 //WRAPPED void swap_names(RTLIL::Cell *c1, RTLIL::Cell *c2);
1872 void Module::swap_names_Cell_Cell(Cell *c1, Cell *c2)
1873 {
1874 this->get_cpp_obj()->swap_names(c1->get_cpp_obj(), c2->get_cpp_obj());
1875 }
1876
1877 //WRAPPED RTLIL::IdString uniquify(RTLIL::IdString name);
1878 IdString Module::uniquify_IdString(IdString *name)
1879 {
1880 return IdString(this->get_cpp_obj()->uniquify(*name->get_cpp_obj()));
1881 }
1882
1883 //WRAPPED RTLIL::IdString uniquify(RTLIL::IdString name, int &index);
1884 IdString Module::uniquify_IdString_int(IdString *name, int index)
1885 {
1886 return IdString(this->get_cpp_obj()->uniquify(*name->get_cpp_obj(), index));
1887 }
1888
1889 //WRAPPED RTLIL::Wire *addWire(RTLIL::IdString name, int width = 1);
1890 Wire Module::addWire_IdString_int(IdString *name, int width)
1891 {
1892 return Wire(this->get_cpp_obj()->addWire(*name->get_cpp_obj(), width));
1893 }
1894
1895 //WRAPPED RTLIL::Wire *addWire(RTLIL::IdString name, const RTLIL::Wire *other);
1896 Wire Module::addWire_IdString_Wire(IdString *name, Wire *other)
1897 {
1898 return Wire(this->get_cpp_obj()->addWire(*name->get_cpp_obj(), other->get_cpp_obj()));
1899 }
1900
1901 //WRAPPED RTLIL::Cell *addCell(RTLIL::IdString name, RTLIL::IdString type);
1902 Cell Module::addCell_IdString_IdString(IdString *name, IdString *type)
1903 {
1904 return Cell(this->get_cpp_obj()->addCell(*name->get_cpp_obj(), *type->get_cpp_obj()));
1905 }
1906
1907 //WRAPPED RTLIL::Cell *addCell(RTLIL::IdString name, const RTLIL::Cell *other);
1908 Cell Module::addCell_IdString_Cell(IdString *name, Cell *other)
1909 {
1910 return Cell(this->get_cpp_obj()->addCell(*name->get_cpp_obj(), other->get_cpp_obj()));
1911 }
1912
1913 //WRAPPED RTLIL::Cell* addNot(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1914 Cell Module::addNot(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1915 {
1916 return Cell(this->get_cpp_obj()->addNot(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1917 }
1918
1919 //WRAPPED RTLIL::Cell* addPos(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1920 Cell Module::addPos(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1921 {
1922 return Cell(this->get_cpp_obj()->addPos(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1923 }
1924
1925 //WRAPPED RTLIL::Cell* addNeg(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1926 Cell Module::addNeg(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1927 {
1928 return Cell(this->get_cpp_obj()->addNeg(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1929 }
1930
1931 //WRAPPED RTLIL::Cell* addAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1932 Cell Module::addAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
1933 {
1934 return Cell(this->get_cpp_obj()->addAnd(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1935 }
1936
1937 //WRAPPED RTLIL::Cell* addOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1938 Cell Module::addOr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
1939 {
1940 return Cell(this->get_cpp_obj()->addOr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1941 }
1942
1943 //WRAPPED RTLIL::Cell* addXor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1944 Cell Module::addXor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
1945 {
1946 return Cell(this->get_cpp_obj()->addXor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1947 }
1948
1949 //WRAPPED RTLIL::Cell* addXnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1950 Cell Module::addXnor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
1951 {
1952 return Cell(this->get_cpp_obj()->addXnor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1953 }
1954
1955 //WRAPPED RTLIL::Cell* addReduceAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1956 Cell Module::addReduceAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1957 {
1958 return Cell(this->get_cpp_obj()->addReduceAnd(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1959 }
1960
1961 //WRAPPED RTLIL::Cell* addReduceOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1962 Cell Module::addReduceOr(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1963 {
1964 return Cell(this->get_cpp_obj()->addReduceOr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1965 }
1966
1967 //WRAPPED RTLIL::Cell* addReduceXor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1968 Cell Module::addReduceXor(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1969 {
1970 return Cell(this->get_cpp_obj()->addReduceXor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1971 }
1972
1973 //WRAPPED RTLIL::Cell* addReduceXnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1974 Cell Module::addReduceXnor(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1975 {
1976 return Cell(this->get_cpp_obj()->addReduceXnor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1977 }
1978
1979 //WRAPPED RTLIL::Cell* addReduceBool(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1980 Cell Module::addReduceBool(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
1981 {
1982 return Cell(this->get_cpp_obj()->addReduceBool(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1983 }
1984
1985 //WRAPPED RTLIL::Cell* addShl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1986 Cell Module::addShl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
1987 {
1988 return Cell(this->get_cpp_obj()->addShl(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1989 }
1990
1991 //WRAPPED RTLIL::Cell* addShr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1992 Cell Module::addShr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
1993 {
1994 return Cell(this->get_cpp_obj()->addShr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
1995 }
1996
1997 //WRAPPED RTLIL::Cell* addSshl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
1998 Cell Module::addSshl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
1999 {
2000 return Cell(this->get_cpp_obj()->addSshl(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2001 }
2002
2003 //WRAPPED RTLIL::Cell* addSshr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2004 Cell Module::addSshr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2005 {
2006 return Cell(this->get_cpp_obj()->addSshr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2007 }
2008
2009 //WRAPPED RTLIL::Cell* addShift(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2010 Cell Module::addShift(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2011 {
2012 return Cell(this->get_cpp_obj()->addShift(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2013 }
2014
2015 //WRAPPED RTLIL::Cell* addShiftx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2016 Cell Module::addShiftx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2017 {
2018 return Cell(this->get_cpp_obj()->addShiftx(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2019 }
2020
2021 //WRAPPED RTLIL::Cell* addLt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2022 Cell Module::addLt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2023 {
2024 return Cell(this->get_cpp_obj()->addLt(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2025 }
2026
2027 //WRAPPED RTLIL::Cell* addLe(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2028 Cell Module::addLe(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2029 {
2030 return Cell(this->get_cpp_obj()->addLe(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2031 }
2032
2033 //WRAPPED RTLIL::Cell* addEq(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2034 Cell Module::addEq(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2035 {
2036 return Cell(this->get_cpp_obj()->addEq(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2037 }
2038
2039 //WRAPPED RTLIL::Cell* addNe(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2040 Cell Module::addNe(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2041 {
2042 return Cell(this->get_cpp_obj()->addNe(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2043 }
2044
2045 //WRAPPED RTLIL::Cell* addEqx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2046 Cell Module::addEqx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2047 {
2048 return Cell(this->get_cpp_obj()->addEqx(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2049 }
2050
2051 //WRAPPED RTLIL::Cell* addNex(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2052 Cell Module::addNex(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2053 {
2054 return Cell(this->get_cpp_obj()->addNex(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2055 }
2056
2057 //WRAPPED RTLIL::Cell* addGe(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2058 Cell Module::addGe(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2059 {
2060 return Cell(this->get_cpp_obj()->addGe(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2061 }
2062
2063 //WRAPPED RTLIL::Cell* addGt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2064 Cell Module::addGt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2065 {
2066 return Cell(this->get_cpp_obj()->addGt(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2067 }
2068
2069 //WRAPPED RTLIL::Cell* addAdd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2070 Cell Module::addAdd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2071 {
2072 return Cell(this->get_cpp_obj()->addAdd(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2073 }
2074
2075 //WRAPPED RTLIL::Cell* addSub(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2076 Cell Module::addSub(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2077 {
2078 return Cell(this->get_cpp_obj()->addSub(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2079 }
2080
2081 //WRAPPED RTLIL::Cell* addMul(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2082 Cell Module::addMul(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2083 {
2084 return Cell(this->get_cpp_obj()->addMul(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2085 }
2086
2087 //WRAPPED RTLIL::Cell* addDiv(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2088 Cell Module::addDiv(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2089 {
2090 return Cell(this->get_cpp_obj()->addDiv(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2091 }
2092
2093 //WRAPPED RTLIL::Cell* addMod(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2094 Cell Module::addMod(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2095 {
2096 return Cell(this->get_cpp_obj()->addMod(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2097 }
2098
2099 //WRAPPED RTLIL::Cell* addPow(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool a_signed = false, bool b_signed = false, const std::string &src = "");
2100 Cell Module::addPow(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool a_signed, bool b_signed, std::string src)
2101 {
2102 return Cell(this->get_cpp_obj()->addPow(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), a_signed, b_signed, src));
2103 }
2104
2105 //WRAPPED RTLIL::Cell* addLogicNot(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2106 Cell Module::addLogicNot(IdString *name, SigSpec *sig_a, SigSpec *sig_y, bool is_signed, std::string src)
2107 {
2108 return Cell(this->get_cpp_obj()->addLogicNot(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2109 }
2110
2111 //WRAPPED RTLIL::Cell* addLogicAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2112 Cell Module::addLogicAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2113 {
2114 return Cell(this->get_cpp_obj()->addLogicAnd(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2115 }
2116
2117 //WRAPPED RTLIL::Cell* addLogicOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, bool is_signed = false, const std::string &src = "");
2118 Cell Module::addLogicOr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, bool is_signed, std::string src)
2119 {
2120 return Cell(this->get_cpp_obj()->addLogicOr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), is_signed, src));
2121 }
2122
2123 //WRAPPED RTLIL::Cell* addMux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, RTLIL::SigSpec sig_y, const std::string &src = "");
2124 Cell Module::addMux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, SigSpec *sig_y, std::string src)
2125 {
2126 return Cell(this->get_cpp_obj()->addMux(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_s->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2127 }
2128
2129 //WRAPPED RTLIL::Cell* addPmux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, RTLIL::SigSpec sig_y, const std::string &src = "");
2130 Cell Module::addPmux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, SigSpec *sig_y, std::string src)
2131 {
2132 return Cell(this->get_cpp_obj()->addPmux(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_s->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2133 }
2134
2135 //WRAPPED RTLIL::Cell* addSlice(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, RTLIL::Const offset, const std::string &src = "");
2136 Cell Module::addSlice(IdString *name, SigSpec *sig_a, SigSpec *sig_y, Const *offset, std::string src)
2137 {
2138 return Cell(this->get_cpp_obj()->addSlice(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), *offset->get_cpp_obj(), src));
2139 }
2140
2141 //WRAPPED RTLIL::Cell* addConcat(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, const std::string &src = "");
2142 Cell Module::addConcat(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, std::string src)
2143 {
2144 return Cell(this->get_cpp_obj()->addConcat(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2145 }
2146
2147 //WRAPPED RTLIL::Cell* addLut(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_y, RTLIL::Const lut, const std::string &src = "");
2148 Cell Module::addLut(IdString *name, SigSpec *sig_a, SigSpec *sig_y, Const *lut, std::string src)
2149 {
2150 return Cell(this->get_cpp_obj()->addLut(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), *lut->get_cpp_obj(), src));
2151 }
2152
2153 //WRAPPED RTLIL::Cell* addTribuf(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_y, const std::string &src = "");
2154 Cell Module::addTribuf(IdString *name, SigSpec *sig_a, SigSpec *sig_en, SigSpec *sig_y, std::string src)
2155 {
2156 return Cell(this->get_cpp_obj()->addTribuf(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_en->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2157 }
2158
2159 //WRAPPED RTLIL::Cell* addAssert(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
2160 Cell Module::addAssert(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src)
2161 {
2162 return Cell(this->get_cpp_obj()->addAssert(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_en->get_cpp_obj(), src));
2163 }
2164
2165 //WRAPPED RTLIL::Cell* addAssume(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
2166 Cell Module::addAssume(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src)
2167 {
2168 return Cell(this->get_cpp_obj()->addAssume(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_en->get_cpp_obj(), src));
2169 }
2170
2171 //WRAPPED RTLIL::Cell* addLive(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
2172 Cell Module::addLive(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src)
2173 {
2174 return Cell(this->get_cpp_obj()->addLive(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_en->get_cpp_obj(), src));
2175 }
2176
2177 //WRAPPED RTLIL::Cell* addFair(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
2178 Cell Module::addFair(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src)
2179 {
2180 return Cell(this->get_cpp_obj()->addFair(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_en->get_cpp_obj(), src));
2181 }
2182
2183 //WRAPPED RTLIL::Cell* addCover(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_en, const std::string &src = "");
2184 Cell Module::addCover(IdString *name, SigSpec *sig_a, SigSpec *sig_en, std::string src)
2185 {
2186 return Cell(this->get_cpp_obj()->addCover(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_en->get_cpp_obj(), src));
2187 }
2188
2189 //WRAPPED RTLIL::Cell* addEquiv(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_y, const std::string &src = "");
2190 Cell Module::addEquiv(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_y, std::string src)
2191 {
2192 return Cell(this->get_cpp_obj()->addEquiv(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2193 }
2194
2195 //WRAPPED RTLIL::Cell* addSr(RTLIL::IdString name, RTLIL::SigSpec sig_set, RTLIL::SigSpec sig_clr, RTLIL::SigSpec sig_q, bool set_polarity = true, bool clr_polarity = true, const std::string &src = "");
2196 Cell Module::addSr(IdString *name, SigSpec *sig_set, SigSpec *sig_clr, SigSpec *sig_q, bool set_polarity, bool clr_polarity, std::string src)
2197 {
2198 return Cell(this->get_cpp_obj()->addSr(*name->get_cpp_obj(), *sig_set->get_cpp_obj(), *sig_clr->get_cpp_obj(), *sig_q->get_cpp_obj(), set_polarity, clr_polarity, src));
2199 }
2200
2201 //WRAPPED RTLIL::Cell* addFf(RTLIL::IdString name, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, const std::string &src = "");
2202 Cell Module::addFf(IdString *name, SigSpec *sig_d, SigSpec *sig_q, std::string src)
2203 {
2204 return Cell(this->get_cpp_obj()->addFf(*name->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), src));
2205 }
2206
2207 //WRAPPED RTLIL::Cell* addDff(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, const std::string &src = "");
2208 Cell Module::addDff(IdString *name, SigSpec *sig_clk, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity, std::string src)
2209 {
2210 return Cell(this->get_cpp_obj()->addDff(*name->get_cpp_obj(), *sig_clk->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), clk_polarity, src));
2211 }
2212
2213 //WRAPPED RTLIL::Cell* addDffe(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, bool en_polarity = true, const std::string &src = "");
2214 Cell Module::addDffe(IdString *name, SigSpec *sig_clk, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity, bool en_polarity, std::string src)
2215 {
2216 return Cell(this->get_cpp_obj()->addDffe(*name->get_cpp_obj(), *sig_clk->get_cpp_obj(), *sig_en->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), clk_polarity, en_polarity, src));
2217 }
2218
2219 //WRAPPED RTLIL::Cell* addDlatch(RTLIL::IdString name, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool en_polarity = true, const std::string &src = "");
2220 Cell Module::addDlatch(IdString *name, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool en_polarity, std::string src)
2221 {
2222 return Cell(this->get_cpp_obj()->addDlatch(*name->get_cpp_obj(), *sig_en->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), en_polarity, src));
2223 }
2224
2225 //WRAPPED RTLIL::Cell* addBufGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_y, const std::string &src = "");
2226 Cell Module::addBufGate(IdString *name, SigBit *sig_a, SigBit *sig_y, std::string src)
2227 {
2228 return Cell(this->get_cpp_obj()->addBufGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2229 }
2230
2231 //WRAPPED RTLIL::Cell* addNotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_y, const std::string &src = "");
2232 Cell Module::addNotGate(IdString *name, SigBit *sig_a, SigBit *sig_y, std::string src)
2233 {
2234 return Cell(this->get_cpp_obj()->addNotGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2235 }
2236
2237 //WRAPPED RTLIL::Cell* addAndGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2238 Cell Module::addAndGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2239 {
2240 return Cell(this->get_cpp_obj()->addAndGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2241 }
2242
2243 //WRAPPED RTLIL::Cell* addNandGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2244 Cell Module::addNandGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2245 {
2246 return Cell(this->get_cpp_obj()->addNandGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2247 }
2248
2249 //WRAPPED RTLIL::Cell* addOrGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2250 Cell Module::addOrGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2251 {
2252 return Cell(this->get_cpp_obj()->addOrGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2253 }
2254
2255 //WRAPPED RTLIL::Cell* addNorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2256 Cell Module::addNorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2257 {
2258 return Cell(this->get_cpp_obj()->addNorGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2259 }
2260
2261 //WRAPPED RTLIL::Cell* addXorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2262 Cell Module::addXorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2263 {
2264 return Cell(this->get_cpp_obj()->addXorGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2265 }
2266
2267 //WRAPPED RTLIL::Cell* addXnorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2268 Cell Module::addXnorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2269 {
2270 return Cell(this->get_cpp_obj()->addXnorGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2271 }
2272
2273 //WRAPPED RTLIL::Cell* addAndnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2274 Cell Module::addAndnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2275 {
2276 return Cell(this->get_cpp_obj()->addAndnotGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2277 }
2278
2279 //WRAPPED RTLIL::Cell* addOrnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_y, const std::string &src = "");
2280 Cell Module::addOrnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_y, std::string src)
2281 {
2282 return Cell(this->get_cpp_obj()->addOrnotGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2283 }
2284
2285 //WRAPPED RTLIL::Cell* addMuxGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_s, RTLIL::SigBit sig_y, const std::string &src = "");
2286 Cell Module::addMuxGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_s, SigBit *sig_y, std::string src)
2287 {
2288 return Cell(this->get_cpp_obj()->addMuxGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_s->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2289 }
2290
2291 //WRAPPED RTLIL::Cell* addAoi3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_y, const std::string &src = "");
2292 Cell Module::addAoi3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_y, std::string src)
2293 {
2294 return Cell(this->get_cpp_obj()->addAoi3Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2295 }
2296
2297 //WRAPPED RTLIL::Cell* addOai3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_y, const std::string &src = "");
2298 Cell Module::addOai3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_y, std::string src)
2299 {
2300 return Cell(this->get_cpp_obj()->addOai3Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2301 }
2302
2303 //WRAPPED RTLIL::Cell* addAoi4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, RTLIL::SigBit sig_y, const std::string &src = "");
2304 Cell Module::addAoi4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, SigBit *sig_y, std::string src)
2305 {
2306 return Cell(this->get_cpp_obj()->addAoi4Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2307 }
2308
2309 //WRAPPED RTLIL::Cell* addOai4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, RTLIL::SigBit sig_y, const std::string &src = "");
2310 Cell Module::addOai4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, SigBit *sig_y, std::string src)
2311 {
2312 return Cell(this->get_cpp_obj()->addOai4Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_y->get_cpp_obj(), src));
2313 }
2314
2315 //WRAPPED RTLIL::Cell* addFfGate(RTLIL::IdString name, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, const std::string &src = "");
2316 Cell Module::addFfGate(IdString *name, SigSpec *sig_d, SigSpec *sig_q, std::string src)
2317 {
2318 return Cell(this->get_cpp_obj()->addFfGate(*name->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), src));
2319 }
2320
2321 //WRAPPED RTLIL::Cell* addDffGate(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, const std::string &src = "");
2322 Cell Module::addDffGate(IdString *name, SigSpec *sig_clk, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity, std::string src)
2323 {
2324 return Cell(this->get_cpp_obj()->addDffGate(*name->get_cpp_obj(), *sig_clk->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), clk_polarity, src));
2325 }
2326
2327 //WRAPPED RTLIL::Cell* addDffeGate(RTLIL::IdString name, RTLIL::SigSpec sig_clk, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool clk_polarity = true, bool en_polarity = true, const std::string &src = "");
2328 Cell Module::addDffeGate(IdString *name, SigSpec *sig_clk, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool clk_polarity, bool en_polarity, std::string src)
2329 {
2330 return Cell(this->get_cpp_obj()->addDffeGate(*name->get_cpp_obj(), *sig_clk->get_cpp_obj(), *sig_en->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), clk_polarity, en_polarity, src));
2331 }
2332
2333 //WRAPPED RTLIL::Cell* addDlatchGate(RTLIL::IdString name, RTLIL::SigSpec sig_en, RTLIL::SigSpec sig_d, RTLIL::SigSpec sig_q, bool en_polarity = true, const std::string &src = "");
2334 Cell Module::addDlatchGate(IdString *name, SigSpec *sig_en, SigSpec *sig_d, SigSpec *sig_q, bool en_polarity, std::string src)
2335 {
2336 return Cell(this->get_cpp_obj()->addDlatchGate(*name->get_cpp_obj(), *sig_en->get_cpp_obj(), *sig_d->get_cpp_obj(), *sig_q->get_cpp_obj(), en_polarity, src));
2337 }
2338
2339 //WRAPPED RTLIL::SigSpec Not(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2340 SigSpec Module::Not(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2341 {
2342 return SigSpec(this->get_cpp_obj()->Not(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2343 }
2344
2345 //WRAPPED RTLIL::SigSpec Pos(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2346 SigSpec Module::Pos(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2347 {
2348 return SigSpec(this->get_cpp_obj()->Pos(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2349 }
2350
2351 //WRAPPED RTLIL::SigSpec Neg(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2352 SigSpec Module::Neg(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2353 {
2354 return SigSpec(this->get_cpp_obj()->Neg(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2355 }
2356
2357 //WRAPPED RTLIL::SigSpec And(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2358 SigSpec Module::And(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2359 {
2360 return SigSpec(this->get_cpp_obj()->And(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2361 }
2362
2363 //WRAPPED RTLIL::SigSpec Or(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2364 SigSpec Module::Or(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2365 {
2366 return SigSpec(this->get_cpp_obj()->Or(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2367 }
2368
2369 //WRAPPED RTLIL::SigSpec Xor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2370 SigSpec Module::Xor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2371 {
2372 return SigSpec(this->get_cpp_obj()->Xor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2373 }
2374
2375 //WRAPPED RTLIL::SigSpec Xnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2376 SigSpec Module::Xnor(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2377 {
2378 return SigSpec(this->get_cpp_obj()->Xnor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2379 }
2380
2381 //WRAPPED RTLIL::SigSpec ReduceAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2382 SigSpec Module::ReduceAnd(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2383 {
2384 return SigSpec(this->get_cpp_obj()->ReduceAnd(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2385 }
2386
2387 //WRAPPED RTLIL::SigSpec ReduceOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2388 SigSpec Module::ReduceOr(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2389 {
2390 return SigSpec(this->get_cpp_obj()->ReduceOr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2391 }
2392
2393 //WRAPPED RTLIL::SigSpec ReduceXor(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2394 SigSpec Module::ReduceXor(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2395 {
2396 return SigSpec(this->get_cpp_obj()->ReduceXor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2397 }
2398
2399 //WRAPPED RTLIL::SigSpec ReduceXnor(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2400 SigSpec Module::ReduceXnor(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2401 {
2402 return SigSpec(this->get_cpp_obj()->ReduceXnor(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2403 }
2404
2405 //WRAPPED RTLIL::SigSpec ReduceBool(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2406 SigSpec Module::ReduceBool(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2407 {
2408 return SigSpec(this->get_cpp_obj()->ReduceBool(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2409 }
2410
2411 //WRAPPED RTLIL::SigSpec Shl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2412 SigSpec Module::Shl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2413 {
2414 return SigSpec(this->get_cpp_obj()->Shl(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2415 }
2416
2417 //WRAPPED RTLIL::SigSpec Shr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2418 SigSpec Module::Shr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2419 {
2420 return SigSpec(this->get_cpp_obj()->Shr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2421 }
2422
2423 //WRAPPED RTLIL::SigSpec Sshl(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2424 SigSpec Module::Sshl(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2425 {
2426 return SigSpec(this->get_cpp_obj()->Sshl(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2427 }
2428
2429 //WRAPPED RTLIL::SigSpec Sshr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2430 SigSpec Module::Sshr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2431 {
2432 return SigSpec(this->get_cpp_obj()->Sshr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2433 }
2434
2435 //WRAPPED RTLIL::SigSpec Shift(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2436 SigSpec Module::Shift(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2437 {
2438 return SigSpec(this->get_cpp_obj()->Shift(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2439 }
2440
2441 //WRAPPED RTLIL::SigSpec Shiftx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2442 SigSpec Module::Shiftx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2443 {
2444 return SigSpec(this->get_cpp_obj()->Shiftx(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2445 }
2446
2447 //WRAPPED RTLIL::SigSpec Lt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2448 SigSpec Module::Lt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2449 {
2450 return SigSpec(this->get_cpp_obj()->Lt(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2451 }
2452
2453 //WRAPPED RTLIL::SigSpec Le(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2454 SigSpec Module::Le(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2455 {
2456 return SigSpec(this->get_cpp_obj()->Le(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2457 }
2458
2459 //WRAPPED RTLIL::SigSpec Eq(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2460 SigSpec Module::Eq(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2461 {
2462 return SigSpec(this->get_cpp_obj()->Eq(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2463 }
2464
2465 //WRAPPED RTLIL::SigSpec Ne(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2466 SigSpec Module::Ne(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2467 {
2468 return SigSpec(this->get_cpp_obj()->Ne(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2469 }
2470
2471 //WRAPPED RTLIL::SigSpec Eqx(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2472 SigSpec Module::Eqx(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2473 {
2474 return SigSpec(this->get_cpp_obj()->Eqx(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2475 }
2476
2477 //WRAPPED RTLIL::SigSpec Nex(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2478 SigSpec Module::Nex(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2479 {
2480 return SigSpec(this->get_cpp_obj()->Nex(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2481 }
2482
2483 //WRAPPED RTLIL::SigSpec Ge(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2484 SigSpec Module::Ge(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2485 {
2486 return SigSpec(this->get_cpp_obj()->Ge(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2487 }
2488
2489 //WRAPPED RTLIL::SigSpec Gt(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2490 SigSpec Module::Gt(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2491 {
2492 return SigSpec(this->get_cpp_obj()->Gt(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2493 }
2494
2495 //WRAPPED RTLIL::SigSpec Add(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2496 SigSpec Module::Add(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2497 {
2498 return SigSpec(this->get_cpp_obj()->Add(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2499 }
2500
2501 //WRAPPED RTLIL::SigSpec Sub(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2502 SigSpec Module::Sub(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2503 {
2504 return SigSpec(this->get_cpp_obj()->Sub(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2505 }
2506
2507 //WRAPPED RTLIL::SigSpec Mul(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2508 SigSpec Module::Mul(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2509 {
2510 return SigSpec(this->get_cpp_obj()->Mul(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2511 }
2512
2513 //WRAPPED RTLIL::SigSpec Div(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2514 SigSpec Module::Div(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2515 {
2516 return SigSpec(this->get_cpp_obj()->Div(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2517 }
2518
2519 //WRAPPED RTLIL::SigSpec Mod(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2520 SigSpec Module::Mod(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2521 {
2522 return SigSpec(this->get_cpp_obj()->Mod(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2523 }
2524
2525 //WRAPPED RTLIL::SigSpec LogicNot(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed = false, const std::string &src = "");
2526 SigSpec Module::LogicNot(IdString *name, SigSpec *sig_a, bool is_signed, std::string src)
2527 {
2528 return SigSpec(this->get_cpp_obj()->LogicNot(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), is_signed, src));
2529 }
2530
2531 //WRAPPED RTLIL::SigSpec LogicAnd(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2532 SigSpec Module::LogicAnd(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2533 {
2534 return SigSpec(this->get_cpp_obj()->LogicAnd(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2535 }
2536
2537 //WRAPPED RTLIL::SigSpec LogicOr(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed = false, const std::string &src = "");
2538 SigSpec Module::LogicOr(IdString *name, SigSpec *sig_a, SigSpec *sig_b, bool is_signed, std::string src)
2539 {
2540 return SigSpec(this->get_cpp_obj()->LogicOr(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), is_signed, src));
2541 }
2542
2543 //WRAPPED RTLIL::SigSpec Mux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, const std::string &src = "");
2544 SigSpec Module::Mux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, std::string src)
2545 {
2546 return SigSpec(this->get_cpp_obj()->Mux(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_s->get_cpp_obj(), src));
2547 }
2548
2549 //WRAPPED RTLIL::SigSpec Pmux(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s, const std::string &src = "");
2550 SigSpec Module::Pmux(IdString *name, SigSpec *sig_a, SigSpec *sig_b, SigSpec *sig_s, std::string src)
2551 {
2552 return SigSpec(this->get_cpp_obj()->Pmux(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_s->get_cpp_obj(), src));
2553 }
2554
2555 //WRAPPED RTLIL::SigBit BufGate(RTLIL::IdString name, RTLIL::SigBit sig_a, const std::string &src = "");
2556 SigBit Module::BufGate(IdString *name, SigBit *sig_a, std::string src)
2557 {
2558 return SigBit(this->get_cpp_obj()->BufGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), src));
2559 }
2560
2561 //WRAPPED RTLIL::SigBit NotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, const std::string &src = "");
2562 SigBit Module::NotGate(IdString *name, SigBit *sig_a, std::string src)
2563 {
2564 return SigBit(this->get_cpp_obj()->NotGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), src));
2565 }
2566
2567 //WRAPPED RTLIL::SigBit AndGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2568 SigBit Module::AndGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2569 {
2570 return SigBit(this->get_cpp_obj()->AndGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2571 }
2572
2573 //WRAPPED RTLIL::SigBit NandGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2574 SigBit Module::NandGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2575 {
2576 return SigBit(this->get_cpp_obj()->NandGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2577 }
2578
2579 //WRAPPED RTLIL::SigBit OrGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2580 SigBit Module::OrGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2581 {
2582 return SigBit(this->get_cpp_obj()->OrGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2583 }
2584
2585 //WRAPPED RTLIL::SigBit NorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2586 SigBit Module::NorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2587 {
2588 return SigBit(this->get_cpp_obj()->NorGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2589 }
2590
2591 //WRAPPED RTLIL::SigBit XorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2592 SigBit Module::XorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2593 {
2594 return SigBit(this->get_cpp_obj()->XorGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2595 }
2596
2597 //WRAPPED RTLIL::SigBit XnorGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2598 SigBit Module::XnorGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2599 {
2600 return SigBit(this->get_cpp_obj()->XnorGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2601 }
2602
2603 //WRAPPED RTLIL::SigBit AndnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2604 SigBit Module::AndnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2605 {
2606 return SigBit(this->get_cpp_obj()->AndnotGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2607 }
2608
2609 //WRAPPED RTLIL::SigBit OrnotGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, const std::string &src = "");
2610 SigBit Module::OrnotGate(IdString *name, SigBit *sig_a, SigBit *sig_b, std::string src)
2611 {
2612 return SigBit(this->get_cpp_obj()->OrnotGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), src));
2613 }
2614
2615 //WRAPPED RTLIL::SigBit MuxGate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_s, const std::string &src = "");
2616 SigBit Module::MuxGate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_s, std::string src)
2617 {
2618 return SigBit(this->get_cpp_obj()->MuxGate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_s->get_cpp_obj(), src));
2619 }
2620
2621 //WRAPPED RTLIL::SigBit Aoi3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, const std::string &src = "");
2622 SigBit Module::Aoi3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, std::string src)
2623 {
2624 return SigBit(this->get_cpp_obj()->Aoi3Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), src));
2625 }
2626
2627 //WRAPPED RTLIL::SigBit Oai3Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, const std::string &src = "");
2628 SigBit Module::Oai3Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, std::string src)
2629 {
2630 return SigBit(this->get_cpp_obj()->Oai3Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), src));
2631 }
2632
2633 //WRAPPED RTLIL::SigBit Aoi4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, const std::string &src = "");
2634 SigBit Module::Aoi4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, std::string src)
2635 {
2636 return SigBit(this->get_cpp_obj()->Aoi4Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), *sig_d->get_cpp_obj(), src));
2637 }
2638
2639 //WRAPPED RTLIL::SigBit Oai4Gate(RTLIL::IdString name, RTLIL::SigBit sig_a, RTLIL::SigBit sig_b, RTLIL::SigBit sig_c, RTLIL::SigBit sig_d, const std::string &src = "");
2640 SigBit Module::Oai4Gate(IdString *name, SigBit *sig_a, SigBit *sig_b, SigBit *sig_c, SigBit *sig_d, std::string src)
2641 {
2642 return SigBit(this->get_cpp_obj()->Oai4Gate(*name->get_cpp_obj(), *sig_a->get_cpp_obj(), *sig_b->get_cpp_obj(), *sig_c->get_cpp_obj(), *sig_d->get_cpp_obj(), src));
2643 }
2644
2645 //WRAPPED RTLIL::SigSpec Anyconst(RTLIL::IdString name, int width = 1, const std::string &src = "");
2646 SigSpec Module::Anyconst(IdString *name, int width, std::string src)
2647 {
2648 return SigSpec(this->get_cpp_obj()->Anyconst(*name->get_cpp_obj(), width, src));
2649 }
2650
2651 //WRAPPED RTLIL::SigSpec Anyseq(RTLIL::IdString name, int width = 1, const std::string &src = "");
2652 SigSpec Module::Anyseq(IdString *name, int width, std::string src)
2653 {
2654 return SigSpec(this->get_cpp_obj()->Anyseq(*name->get_cpp_obj(), width, src));
2655 }
2656
2657 //WRAPPED RTLIL::SigSpec Allconst(RTLIL::IdString name, int width = 1, const std::string &src = "");
2658 SigSpec Module::Allconst(IdString *name, int width, std::string src)
2659 {
2660 return SigSpec(this->get_cpp_obj()->Allconst(*name->get_cpp_obj(), width, src));
2661 }
2662
2663 //WRAPPED RTLIL::SigSpec Allseq(RTLIL::IdString name, int width = 1, const std::string &src = "");
2664 SigSpec Module::Allseq(IdString *name, int width, std::string src)
2665 {
2666 return SigSpec(this->get_cpp_obj()->Allseq(*name->get_cpp_obj(), width, src));
2667 }
2668
2669 //WRAPPED RTLIL::SigSpec Initstate(RTLIL::IdString name, const std::string &src = "");
2670 SigSpec Module::Initstate(IdString *name, std::string src)
2671 {
2672 return SigSpec(this->get_cpp_obj()->Initstate(*name->get_cpp_obj(), src));
2673 }
2674
2675 //WRAPPED RTLIL::Module *module(RTLIL::IdString name);
2676 Module Design::module(IdString *name)
2677 {
2678 return Module(this->get_cpp_obj()->module(*name->get_cpp_obj()));
2679 }
2680
2681 //WRAPPED bool has(RTLIL::IdString id) const {
2682 bool Design::has(IdString *id)
2683 {
2684 return this->get_cpp_obj()->has(*id->get_cpp_obj());
2685 }
2686
2687 //WRAPPED void add(RTLIL::Module *module);
2688 void Design::add(Module *module)
2689 {
2690 this->get_cpp_obj()->add(module->get_cpp_obj());
2691 }
2692
2693 //WRAPPED RTLIL::Module *addModule(RTLIL::IdString name);
2694 Module Design::addModule(IdString *name)
2695 {
2696 return Module(this->get_cpp_obj()->addModule(*name->get_cpp_obj()));
2697 }
2698
2699 //WRAPPED void remove(RTLIL::Module *module);
2700 void Design::remove(Module *module)
2701 {
2702 this->get_cpp_obj()->remove(module->get_cpp_obj());
2703 }
2704
2705 //WRAPPED void rename(RTLIL::Module *module, RTLIL::IdString new_name);
2706 void Design::rename(Module *module, IdString *new_name)
2707 {
2708 this->get_cpp_obj()->rename(module->get_cpp_obj(), *new_name->get_cpp_obj());
2709 }
2710
2711 //WRAPPED void scratchpad_unset(std::string varname);
2712 void Design::scratchpad_unset(std::string varname)
2713 {
2714 this->get_cpp_obj()->scratchpad_unset(varname);
2715 }
2716
2717 //WRAPPED void scratchpad_set_int(std::string varname, int value);
2718 void Design::scratchpad_set_int(std::string varname, int value)
2719 {
2720 this->get_cpp_obj()->scratchpad_set_int(varname, value);
2721 }
2722
2723 //WRAPPED void scratchpad_set_bool(std::string varname, bool value);
2724 void Design::scratchpad_set_bool(std::string varname, bool value)
2725 {
2726 this->get_cpp_obj()->scratchpad_set_bool(varname, value);
2727 }
2728
2729 //WRAPPED void scratchpad_set_string(std::string varname, std::string value);
2730 void Design::scratchpad_set_string(std::string varname, std::string value)
2731 {
2732 this->get_cpp_obj()->scratchpad_set_string(varname, value);
2733 }
2734
2735 //WRAPPED int scratchpad_get_int(std::string varname, int default_value = 0) const;
2736 int Design::scratchpad_get_int(std::string varname, int default_value)
2737 {
2738 return this->get_cpp_obj()->scratchpad_get_int(varname, default_value);
2739 }
2740
2741 //WRAPPED bool scratchpad_get_bool(std::string varname, bool default_value = false) const;
2742 bool Design::scratchpad_get_bool(std::string varname, bool default_value)
2743 {
2744 return this->get_cpp_obj()->scratchpad_get_bool(varname, default_value);
2745 }
2746
2747 //WRAPPED std::string scratchpad_get_string(std::string varname, std::string default_value = std::string()) const;
2748 std::string Design::scratchpad_get_string(std::string varname, std::string default_value)
2749 {
2750 return this->get_cpp_obj()->scratchpad_get_string(varname, default_value);
2751 }
2752
2753 //WRAPPED bool selected_module(RTLIL::IdString mod_name) const;
2754 bool Design::selected_module_IdString(IdString *mod_name)
2755 {
2756 return this->get_cpp_obj()->selected_module(*mod_name->get_cpp_obj());
2757 }
2758
2759 //WRAPPED bool selected_whole_module(RTLIL::IdString mod_name) const;
2760 bool Design::selected_whole_module_IdString(IdString *mod_name)
2761 {
2762 return this->get_cpp_obj()->selected_whole_module(*mod_name->get_cpp_obj());
2763 }
2764
2765 //WRAPPED bool selected_member(RTLIL::IdString mod_name, RTLIL::IdString memb_name) const;
2766 bool Design::selected_member(IdString *mod_name, IdString *memb_name)
2767 {
2768 return this->get_cpp_obj()->selected_member(*mod_name->get_cpp_obj(), *memb_name->get_cpp_obj());
2769 }
2770
2771 //WRAPPED bool selected_module(RTLIL::Module *mod) const;
2772 bool Design::selected_module_Module(Module *mod)
2773 {
2774 return this->get_cpp_obj()->selected_module(mod->get_cpp_obj());
2775 }
2776
2777 //WRAPPED bool selected_whole_module(RTLIL::Module *mod) const;
2778 bool Design::selected_whole_module_Module(Module *mod)
2779 {
2780 return this->get_cpp_obj()->selected_whole_module(mod->get_cpp_obj());
2781 }
2782
2783 struct Initializer
2784 {
2785 Initializer() {
2786 if(!Yosys::yosys_already_setup())
2787 {
2788 Yosys::log_streams.push_back(&std::cout);
2789 Yosys::log_error_stderr = true;
2790 Yosys::yosys_setup();
2791 Yosys::yosys_banner();
2792 }
2793 }
2794
2795 Initializer(Initializer const &) {}
2796
2797 ~Initializer() {
2798 Yosys::yosys_shutdown();
2799 }
2800 };
2801
2802 BOOST_PYTHON_MODULE(libyosys)
2803 {
2804 using namespace boost::python;
2805
2806 enum_<Yosys::RTLIL::State>("State")
2807 .value("S0",Yosys::RTLIL::S0)
2808 .value("S1",Yosys::RTLIL::S1)
2809 .value("Sx",Yosys::RTLIL::Sx)
2810 .value("Sz",Yosys::RTLIL::Sz)
2811 .value("Sa",Yosys::RTLIL::Sa)
2812 .value("Sm",Yosys::RTLIL::Sm)
2813 ;
2814
2815 enum_<Yosys::RTLIL::SyncType>("SyncType")
2816 .value("ST0",Yosys::RTLIL::ST0)
2817 .value("ST1",Yosys::RTLIL::ST1)
2818 .value("STp",Yosys::RTLIL::STp)
2819 .value("STn",Yosys::RTLIL::STn)
2820 .value("STe",Yosys::RTLIL::STe)
2821 .value("STa",Yosys::RTLIL::STa)
2822 .value("STg",Yosys::RTLIL::STg)
2823 .value("STi",Yosys::RTLIL::STi)
2824 ;
2825
2826 enum_<Yosys::RTLIL::ConstFlags>("ConstFlags")
2827 .value("CONST_FLAG_NONE",Yosys::RTLIL::CONST_FLAG_NONE)
2828 .value("CONST_FLAG_STRING",Yosys::RTLIL::CONST_FLAG_STRING)
2829 .value("CONST_FLAG_SIGNED",Yosys::RTLIL::CONST_FLAG_SIGNED)
2830 .value("CONST_FLAG_REAL",Yosys::RTLIL::CONST_FLAG_REAL)
2831 ;
2832
2833 class_<MonitorWrap, boost::noncopyable>("Monitor")
2834 .def("py_notify_module_add", &Monitor::py_notify_module_add, &MonitorWrap::default_py_notify_module_add)
2835 .def("py_notify_module_del", &Monitor::py_notify_module_del, &MonitorWrap::default_py_notify_module_del)
2836 .def("py_notify_connect_cell", &Monitor::py_notify_connect_cell, &MonitorWrap::default_py_notify_connect_cell)
2837 .def("py_notify_connect_tuple", &Monitor::py_notify_connect_tuple, &MonitorWrap::default_py_notify_connect_tuple)
2838 .def("py_notify_connect_list", &Monitor::py_notify_connect_list, &MonitorWrap::default_py_notify_connect_list)
2839 .def("py_notify_blackout", &Monitor::py_notify_blackout, &MonitorWrap::default_py_notify_blackout)
2840 ;
2841
2842 class_<PassWrap, boost::noncopyable>("Pass", init<std::string, std::string>())
2843 .def("py_execute", &PyPass::py_execute, &PassWrap::default_py_execute)
2844 .def("py_help", &PyPass::py_help, &PassWrap::default_py_help)
2845 ;
2846
2847 class_<Initializer>("Initializer");
2848 scope().attr("_hidden") = new Initializer();
2849
2850 class_<IdString>("IdString")
2851 .def(init<std::string>())
2852 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2853 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2854 .def("get_reference", &IdString::get_reference)
2855 .def("put_reference", &IdString::put_reference)
2856 .def("in_IdString", &IdString::in_IdString)
2857 .def("in_std_string", &IdString::in_std_string)
2858 ;
2859
2860 class_<Const>("Const")
2861 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2862 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2863 .def("as_int", &Const::as_int)
2864 .def("from_string", &Const::from_string)
2865 .def("extract", &Const::extract)
2866 ;
2867
2868 class_<CaseRule>("CaseRule")
2869 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2870 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2871 ;
2872
2873 class_<SwitchRule>("SwitchRule")
2874 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2875 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2876 ;
2877
2878 class_<SyncRule>("SyncRule")
2879 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2880 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2881 ;
2882
2883 class_<Process>("Process")
2884 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2885 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2886 ;
2887
2888 class_<SigChunk>("SigChunk")
2889 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2890 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2891 .def("extract", &SigChunk::extract)
2892 ;
2893
2894 class_<SigBit>("SigBit")
2895 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2896 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2897 ;
2898
2899 class_<SigSpec>("SigSpec")
2900 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2901 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2902 .def("replace_SigSpec_SigSpec", &SigSpec::replace_SigSpec_SigSpec)
2903 .def("replace_SigSpec_SigSpec_SigSpec", &SigSpec::replace_SigSpec_SigSpec_SigSpec)
2904 .def("replace_int_SigSpec", &SigSpec::replace_int_SigSpec)
2905 .def("remove_SigSpec", &SigSpec::remove_SigSpec)
2906 .def("remove_SigSpec_SigSpec", &SigSpec::remove_SigSpec_SigSpec)
2907 .def("remove2_SigSpec_SigSpec", &SigSpec::remove2_SigSpec_SigSpec)
2908 .def("remove_pool_SigBit", &SigSpec::remove_pool_SigBit)
2909 .def("remove_pool_SigBit_SigSpec", &SigSpec::remove_pool_SigBit_SigSpec)
2910 .def("remove2_pool_SigBit_SigSpec", &SigSpec::remove2_pool_SigBit_SigSpec)
2911 .def("remove_int_int", &SigSpec::remove_int_int)
2912 .def("extract_SigSpec_SigSpec", &SigSpec::extract_SigSpec_SigSpec)
2913 .def("extract_pool_SigBit_SigSpec", &SigSpec::extract_pool_SigBit_SigSpec)
2914 .def("extract_int_int", &SigSpec::extract_int_int)
2915 .def("append", &SigSpec::append)
2916 .def("append_bit", &SigSpec::append_bit)
2917 .def("extend_u0", &SigSpec::extend_u0)
2918 .def("repeat", &SigSpec::repeat)
2919 .def("as_int", &SigSpec::as_int)
2920 .def("match", &SigSpec::match)
2921 .def("parse", &SigSpec::parse)
2922 .def("parse_sel", &SigSpec::parse_sel)
2923 .def("parse_rhs", &SigSpec::parse_rhs)
2924 ;
2925
2926 class_<Cell>("Cell", no_init)
2927 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2928 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2929 .def("hasPort", &Cell::hasPort)
2930 .def("unsetPort", &Cell::unsetPort)
2931 .def("setPort", &Cell::setPort)
2932 .def("input", &Cell::input)
2933 .def("output", &Cell::output)
2934 .def("hasParam", &Cell::hasParam)
2935 .def("unsetParam", &Cell::unsetParam)
2936 .def("setParam", &Cell::setParam)
2937 .def("fixup_parameters", &Cell::fixup_parameters)
2938 ;
2939
2940 class_<Wire>("Wire", no_init)
2941 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2942 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2943 ;
2944
2945 class_<Memory>("Memory", no_init)
2946 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2947 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2948 ;
2949
2950 class_<Module>("Module")
2951 .def(boost::python::self_ns::str(boost::python::self_ns::self))
2952 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
2953 .def("get_cells", &Module::get_cells)
2954 .def("get_wires", &Module::get_wires)
2955 .def("register_monitor", &Module::register_monitor)
2956 .def("connect_SigSig", &Module::connect_SigSig)
2957 .def("connect_SigSpec_SigSpec", &Module::connect_SigSpec_SigSpec)
2958 .def("new_connections", &Module::new_connections)
2959 .def("cloneInto", &Module::cloneInto)
2960 .def("remove_pool_Wire", &Module::remove_pool_Wire)
2961 .def("remove_Cell", &Module::remove_Cell)
2962 .def("rename_Wire_IdString", &Module::rename_Wire_IdString)
2963 .def("rename_Cell_IdString", &Module::rename_Cell_IdString)
2964 .def("rename_IdString_IdString", &Module::rename_IdString_IdString)
2965 .def("swap_names_Wire_Wire", &Module::swap_names_Wire_Wire)
2966 .def("swap_names_Cell_Cell", &Module::swap_names_Cell_Cell)
2967 .def("uniquify_IdString", &Module::uniquify_IdString)
2968 .def("uniquify_IdString_int", &Module::uniquify_IdString_int)
2969 .def("addWire_IdString_int", &Module::addWire_IdString_int)
2970 .def("addWire_IdString_Wire", &Module::addWire_IdString_Wire)
2971 .def("addCell_IdString_IdString", &Module::addCell_IdString_IdString)
2972 .def("addCell_IdString_Cell", &Module::addCell_IdString_Cell)
2973 .def("addNot", &Module::addNot)
2974 .def("addPos", &Module::addPos)
2975 .def("addNeg", &Module::addNeg)
2976 .def("addAnd", &Module::addAnd)
2977 .def("addOr", &Module::addOr)
2978 .def("addXor", &Module::addXor)
2979 .def("addXnor", &Module::addXnor)
2980 .def("addReduceAnd", &Module::addReduceAnd)
2981 .def("addReduceOr", &Module::addReduceOr)
2982 .def("addReduceXor", &Module::addReduceXor)
2983 .def("addReduceXnor", &Module::addReduceXnor)
2984 .def("addReduceBool", &Module::addReduceBool)
2985 .def("addShl", &Module::addShl)
2986 .def("addShr", &Module::addShr)
2987 .def("addSshl", &Module::addSshl)
2988 .def("addSshr", &Module::addSshr)
2989 .def("addShift", &Module::addShift)
2990 .def("addShiftx", &Module::addShiftx)
2991 .def("addLt", &Module::addLt)
2992 .def("addLe", &Module::addLe)
2993 .def("addEq", &Module::addEq)
2994 .def("addNe", &Module::addNe)
2995 .def("addEqx", &Module::addEqx)
2996 .def("addNex", &Module::addNex)
2997 .def("addGe", &Module::addGe)
2998 .def("addGt", &Module::addGt)
2999 .def("addAdd", &Module::addAdd)
3000 .def("addSub", &Module::addSub)
3001 .def("addMul", &Module::addMul)
3002 .def("addDiv", &Module::addDiv)
3003 .def("addMod", &Module::addMod)
3004 .def("addPow", &Module::addPow)
3005 .def("addLogicNot", &Module::addLogicNot)
3006 .def("addLogicAnd", &Module::addLogicAnd)
3007 .def("addLogicOr", &Module::addLogicOr)
3008 .def("addMux", &Module::addMux)
3009 .def("addPmux", &Module::addPmux)
3010 .def("addSlice", &Module::addSlice)
3011 .def("addConcat", &Module::addConcat)
3012 .def("addLut", &Module::addLut)
3013 .def("addTribuf", &Module::addTribuf)
3014 .def("addAssert", &Module::addAssert)
3015 .def("addAssume", &Module::addAssume)
3016 .def("addLive", &Module::addLive)
3017 .def("addFair", &Module::addFair)
3018 .def("addCover", &Module::addCover)
3019 .def("addEquiv", &Module::addEquiv)
3020 .def("addSr", &Module::addSr)
3021 .def("addFf", &Module::addFf)
3022 .def("addDff", &Module::addDff)
3023 .def("addDffe", &Module::addDffe)
3024 .def("addDlatch", &Module::addDlatch)
3025 .def("addBufGate", &Module::addBufGate)
3026 .def("addNotGate", &Module::addNotGate)
3027 .def("addAndGate", &Module::addAndGate)
3028 .def("addNandGate", &Module::addNandGate)
3029 .def("addOrGate", &Module::addOrGate)
3030 .def("addNorGate", &Module::addNorGate)
3031 .def("addXorGate", &Module::addXorGate)
3032 .def("addXnorGate", &Module::addXnorGate)
3033 .def("addAndnotGate", &Module::addAndnotGate)
3034 .def("addOrnotGate", &Module::addOrnotGate)
3035 .def("addMuxGate", &Module::addMuxGate)
3036 .def("addAoi3Gate", &Module::addAoi3Gate)
3037 .def("addOai3Gate", &Module::addOai3Gate)
3038 .def("addAoi4Gate", &Module::addAoi4Gate)
3039 .def("addOai4Gate", &Module::addOai4Gate)
3040 .def("addFfGate", &Module::addFfGate)
3041 .def("addDffGate", &Module::addDffGate)
3042 .def("addDffeGate", &Module::addDffeGate)
3043 .def("addDlatchGate", &Module::addDlatchGate)
3044 .def("Not", &Module::Not)
3045 .def("Pos", &Module::Pos)
3046 .def("Neg", &Module::Neg)
3047 .def("And", &Module::And)
3048 .def("Or", &Module::Or)
3049 .def("Xor", &Module::Xor)
3050 .def("Xnor", &Module::Xnor)
3051 .def("ReduceAnd", &Module::ReduceAnd)
3052 .def("ReduceOr", &Module::ReduceOr)
3053 .def("ReduceXor", &Module::ReduceXor)
3054 .def("ReduceXnor", &Module::ReduceXnor)
3055 .def("ReduceBool", &Module::ReduceBool)
3056 .def("Shl", &Module::Shl)
3057 .def("Shr", &Module::Shr)
3058 .def("Sshl", &Module::Sshl)
3059 .def("Sshr", &Module::Sshr)
3060 .def("Shift", &Module::Shift)
3061 .def("Shiftx", &Module::Shiftx)
3062 .def("Lt", &Module::Lt)
3063 .def("Le", &Module::Le)
3064 .def("Eq", &Module::Eq)
3065 .def("Ne", &Module::Ne)
3066 .def("Eqx", &Module::Eqx)
3067 .def("Nex", &Module::Nex)
3068 .def("Ge", &Module::Ge)
3069 .def("Gt", &Module::Gt)
3070 .def("Add", &Module::Add)
3071 .def("Sub", &Module::Sub)
3072 .def("Mul", &Module::Mul)
3073 .def("Div", &Module::Div)
3074 .def("Mod", &Module::Mod)
3075 .def("LogicNot", &Module::LogicNot)
3076 .def("LogicAnd", &Module::LogicAnd)
3077 .def("LogicOr", &Module::LogicOr)
3078 .def("Mux", &Module::Mux)
3079 .def("Pmux", &Module::Pmux)
3080 .def("BufGate", &Module::BufGate)
3081 .def("NotGate", &Module::NotGate)
3082 .def("AndGate", &Module::AndGate)
3083 .def("NandGate", &Module::NandGate)
3084 .def("OrGate", &Module::OrGate)
3085 .def("NorGate", &Module::NorGate)
3086 .def("XorGate", &Module::XorGate)
3087 .def("XnorGate", &Module::XnorGate)
3088 .def("AndnotGate", &Module::AndnotGate)
3089 .def("OrnotGate", &Module::OrnotGate)
3090 .def("MuxGate", &Module::MuxGate)
3091 .def("Aoi3Gate", &Module::Aoi3Gate)
3092 .def("Oai3Gate", &Module::Oai3Gate)
3093 .def("Aoi4Gate", &Module::Aoi4Gate)
3094 .def("Oai4Gate", &Module::Oai4Gate)
3095 .def("Anyconst", &Module::Anyconst)
3096 .def("Anyseq", &Module::Anyseq)
3097 .def("Allconst", &Module::Allconst)
3098 .def("Allseq", &Module::Allseq)
3099 .def("Initstate", &Module::Initstate)
3100 ;
3101
3102 class_<Design>("Design")
3103 .def(boost::python::self_ns::str(boost::python::self_ns::self))
3104 .def(boost::python::self_ns::repr(boost::python::self_ns::self))
3105 .def("get_modules", &Design::get_modules)
3106 .def("run", &Design::run)
3107 .def("register_monitor", &Design::register_monitor)
3108 .def("module", &Design::module)
3109 .def("has", &Design::has)
3110 .def("add", &Design::add)
3111 .def("addModule", &Design::addModule)
3112 .def("remove", &Design::remove)
3113 .def("rename", &Design::rename)
3114 .def("scratchpad_unset", &Design::scratchpad_unset)
3115 .def("scratchpad_set_int", &Design::scratchpad_set_int)
3116 .def("scratchpad_set_bool", &Design::scratchpad_set_bool)
3117 .def("scratchpad_set_string", &Design::scratchpad_set_string)
3118 .def("scratchpad_get_int", &Design::scratchpad_get_int)
3119 .def("scratchpad_get_bool", &Design::scratchpad_get_bool)
3120 .def("scratchpad_get_string", &Design::scratchpad_get_string)
3121 .def("selected_module_IdString", &Design::selected_module_IdString)
3122 .def("selected_whole_module_IdString", &Design::selected_whole_module_IdString)
3123 .def("selected_member", &Design::selected_member)
3124 .def("selected_module_Module", &Design::selected_module_Module)
3125 .def("selected_whole_module_Module", &Design::selected_whole_module_Module)
3126 ;
3127
3128 def("escape_id", escape_id);
3129 def("unescape_id_std_string", unescape_id_std_string);
3130 def("unescape_id_IdString", unescape_id_IdString);
3131 def("const_not", const_not);
3132 def("const_and", const_and);
3133 def("const_or", const_or);
3134 def("const_xor", const_xor);
3135 def("const_xnor", const_xnor);
3136 def("const_reduce_and", const_reduce_and);
3137 def("const_reduce_or", const_reduce_or);
3138 def("const_reduce_xor", const_reduce_xor);
3139 def("const_reduce_xnor", const_reduce_xnor);
3140 def("const_reduce_bool", const_reduce_bool);
3141 def("const_logic_not", const_logic_not);
3142 def("const_logic_and", const_logic_and);
3143 def("const_logic_or", const_logic_or);
3144 def("const_shl", const_shl);
3145 def("const_shr", const_shr);
3146 def("const_sshl", const_sshl);
3147 def("const_sshr", const_sshr);
3148 def("const_shift", const_shift);
3149 def("const_shiftx", const_shiftx);
3150 def("const_lt", const_lt);
3151 def("const_le", const_le);
3152 def("const_eq", const_eq);
3153 def("const_ne", const_ne);
3154 def("const_eqx", const_eqx);
3155 def("const_nex", const_nex);
3156 def("const_ge", const_ge);
3157 def("const_gt", const_gt);
3158 def("const_add", const_add);
3159 def("const_sub", const_sub);
3160 def("const_mul", const_mul);
3161 def("const_div", const_div);
3162 def("const_mod", const_mod);
3163 def("const_pow", const_pow);
3164 def("const_pos", const_pos);
3165 def("const_neg", const_neg);
3166
3167 def("run",run);
3168 def("log",log);
3169
3170 }
3171
3172 }
3173 #endif