yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
simplemap.cc
Go to the documentation of this file.
1 /*
2  * yosys -- Yosys Open SYnthesis Suite
3  *
4  * Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
5  *
6  * Permission to use, copy, modify, and/or distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  *
18  */
19 
20 #include "kernel/register.h"
21 #include "kernel/sigtools.h"
22 #include "kernel/log.h"
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <string.h>
26 
29 
31 {
32  RTLIL::SigSpec sig_a = cell->getPort("\\A");
33  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
34 
35  sig_a.extend(GetSize(sig_y), cell->parameters.at("\\A_SIGNED").as_bool());
36 
37  for (int i = 0; i < GetSize(sig_y); i++) {
38  RTLIL::Cell *gate = module->addCell(NEW_ID, "$_NOT_");
39  gate->setPort("\\A", sig_a[i]);
40  gate->setPort("\\Y", sig_y[i]);
41  }
42 }
43 
45 {
46  RTLIL::SigSpec sig_a = cell->getPort("\\A");
47  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
48 
49  sig_a.extend_u0(GetSize(sig_y), cell->parameters.at("\\A_SIGNED").as_bool());
50 
51  module->connect(RTLIL::SigSig(sig_y, sig_a));
52 }
53 
55 {
56  RTLIL::SigSpec sig_a = cell->getPort("\\A");
57  RTLIL::SigSpec sig_b = cell->getPort("\\B");
58  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
59 
60  sig_a.extend_u0(GetSize(sig_y), cell->parameters.at("\\A_SIGNED").as_bool());
61  sig_b.extend_u0(GetSize(sig_y), cell->parameters.at("\\B_SIGNED").as_bool());
62 
63  if (cell->type == "$xnor")
64  {
65  RTLIL::SigSpec sig_t = module->addWire(NEW_ID, GetSize(sig_y));
66 
67  for (int i = 0; i < GetSize(sig_y); i++) {
68  RTLIL::Cell *gate = module->addCell(NEW_ID, "$_NOT_");
69  gate->setPort("\\A", sig_t[i]);
70  gate->setPort("\\Y", sig_y[i]);
71  }
72 
73  sig_y = sig_t;
74  }
75 
76  std::string gate_type;
77  if (cell->type == "$and") gate_type = "$_AND_";
78  if (cell->type == "$or") gate_type = "$_OR_";
79  if (cell->type == "$xor") gate_type = "$_XOR_";
80  if (cell->type == "$xnor") gate_type = "$_XOR_";
81  log_assert(!gate_type.empty());
82 
83  for (int i = 0; i < GetSize(sig_y); i++) {
84  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
85  gate->setPort("\\A", sig_a[i]);
86  gate->setPort("\\B", sig_b[i]);
87  gate->setPort("\\Y", sig_y[i]);
88  }
89 }
90 
92 {
93  RTLIL::SigSpec sig_a = cell->getPort("\\A");
94  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
95 
96  if (sig_y.size() == 0)
97  return;
98 
99  if (sig_a.size() == 0) {
100  if (cell->type == "$reduce_and") module->connect(RTLIL::SigSig(sig_y, RTLIL::SigSpec(1, sig_y.size())));
101  if (cell->type == "$reduce_or") module->connect(RTLIL::SigSig(sig_y, RTLIL::SigSpec(0, sig_y.size())));
102  if (cell->type == "$reduce_xor") module->connect(RTLIL::SigSig(sig_y, RTLIL::SigSpec(0, sig_y.size())));
103  if (cell->type == "$reduce_xnor") module->connect(RTLIL::SigSig(sig_y, RTLIL::SigSpec(1, sig_y.size())));
104  if (cell->type == "$reduce_bool") module->connect(RTLIL::SigSig(sig_y, RTLIL::SigSpec(0, sig_y.size())));
105  return;
106  }
107 
108  if (sig_y.size() > 1) {
109  module->connect(RTLIL::SigSig(sig_y.extract(1, sig_y.size()-1), RTLIL::SigSpec(0, sig_y.size()-1)));
110  sig_y = sig_y.extract(0, 1);
111  }
112 
113  std::string gate_type;
114  if (cell->type == "$reduce_and") gate_type = "$_AND_";
115  if (cell->type == "$reduce_or") gate_type = "$_OR_";
116  if (cell->type == "$reduce_xor") gate_type = "$_XOR_";
117  if (cell->type == "$reduce_xnor") gate_type = "$_XOR_";
118  if (cell->type == "$reduce_bool") gate_type = "$_OR_";
119  log_assert(!gate_type.empty());
120 
121  RTLIL::Cell *last_output_cell = NULL;
122 
123  while (sig_a.size() > 1)
124  {
125  RTLIL::SigSpec sig_t = module->addWire(NEW_ID, sig_a.size() / 2);
126 
127  for (int i = 0; i < sig_a.size(); i += 2)
128  {
129  if (i+1 == sig_a.size()) {
130  sig_t.append(sig_a[i]);
131  continue;
132  }
133 
134  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
135  gate->setPort("\\A", sig_a[i]);
136  gate->setPort("\\B", sig_a[i+1]);
137  gate->setPort("\\Y", sig_t[i/2]);
138  last_output_cell = gate;
139  }
140 
141  sig_a = sig_t;
142  }
143 
144  if (cell->type == "$reduce_xnor") {
145  RTLIL::SigSpec sig_t = module->addWire(NEW_ID);
146  RTLIL::Cell *gate = module->addCell(NEW_ID, "$_NOT_");
147  gate->setPort("\\A", sig_a);
148  gate->setPort("\\Y", sig_t);
149  last_output_cell = gate;
150  sig_a = sig_t;
151  }
152 
153  if (last_output_cell == NULL) {
154  module->connect(RTLIL::SigSig(sig_y, sig_a));
155  } else {
156  last_output_cell->setPort("\\Y", sig_y);
157  }
158 }
159 
161 {
162  while (sig.size() > 1)
163  {
164  RTLIL::SigSpec sig_t = module->addWire(NEW_ID, sig.size() / 2);
165 
166  for (int i = 0; i < sig.size(); i += 2)
167  {
168  if (i+1 == sig.size()) {
169  sig_t.append(sig[i]);
170  continue;
171  }
172 
173  RTLIL::Cell *gate = module->addCell(NEW_ID, "$_OR_");
174  gate->setPort("\\A", sig[i]);
175  gate->setPort("\\B", sig[i+1]);
176  gate->setPort("\\Y", sig_t[i/2]);
177  }
178 
179  sig = sig_t;
180  }
181 
182  if (sig.size() == 0)
183  sig = RTLIL::SigSpec(0, 1);
184 }
185 
187 {
188  RTLIL::SigSpec sig_a = cell->getPort("\\A");
189  logic_reduce(module, sig_a);
190 
191  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
192 
193  if (sig_y.size() == 0)
194  return;
195 
196  if (sig_y.size() > 1) {
197  module->connect(RTLIL::SigSig(sig_y.extract(1, sig_y.size()-1), RTLIL::SigSpec(0, sig_y.size()-1)));
198  sig_y = sig_y.extract(0, 1);
199  }
200 
201  RTLIL::Cell *gate = module->addCell(NEW_ID, "$_NOT_");
202  gate->setPort("\\A", sig_a);
203  gate->setPort("\\Y", sig_y);
204 }
205 
207 {
208  RTLIL::SigSpec sig_a = cell->getPort("\\A");
209  logic_reduce(module, sig_a);
210 
211  RTLIL::SigSpec sig_b = cell->getPort("\\B");
212  logic_reduce(module, sig_b);
213 
214  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
215 
216  if (sig_y.size() == 0)
217  return;
218 
219  if (sig_y.size() > 1) {
220  module->connect(RTLIL::SigSig(sig_y.extract(1, sig_y.size()-1), RTLIL::SigSpec(0, sig_y.size()-1)));
221  sig_y = sig_y.extract(0, 1);
222  }
223 
224  std::string gate_type;
225  if (cell->type == "$logic_and") gate_type = "$_AND_";
226  if (cell->type == "$logic_or") gate_type = "$_OR_";
227  log_assert(!gate_type.empty());
228 
229  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
230  gate->setPort("\\A", sig_a);
231  gate->setPort("\\B", sig_b);
232  gate->setPort("\\Y", sig_y);
233 }
234 
236 {
237  RTLIL::SigSpec sig_a = cell->getPort("\\A");
238  RTLIL::SigSpec sig_b = cell->getPort("\\B");
239  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
240 
241  for (int i = 0; i < GetSize(sig_y); i++) {
242  RTLIL::Cell *gate = module->addCell(NEW_ID, "$_MUX_");
243  gate->setPort("\\A", sig_a[i]);
244  gate->setPort("\\B", sig_b[i]);
245  gate->setPort("\\S", cell->getPort("\\S"));
246  gate->setPort("\\Y", sig_y[i]);
247  }
248 }
249 
251 {
252  int offset = cell->parameters.at("\\OFFSET").as_int();
253  RTLIL::SigSpec sig_a = cell->getPort("\\A");
254  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
255  module->connect(RTLIL::SigSig(sig_y, sig_a.extract(offset, sig_y.size())));
256 }
257 
259 {
260  RTLIL::SigSpec sig_ab = cell->getPort("\\A");
261  sig_ab.append(cell->getPort("\\B"));
262  RTLIL::SigSpec sig_y = cell->getPort("\\Y");
263  module->connect(RTLIL::SigSig(sig_y, sig_ab));
264 }
265 
267 {
268  int width = cell->parameters.at("\\WIDTH").as_int();
269  char set_pol = cell->parameters.at("\\SET_POLARITY").as_bool() ? 'P' : 'N';
270  char clr_pol = cell->parameters.at("\\CLR_POLARITY").as_bool() ? 'P' : 'N';
271 
272  RTLIL::SigSpec sig_s = cell->getPort("\\SET");
273  RTLIL::SigSpec sig_r = cell->getPort("\\CLR");
274  RTLIL::SigSpec sig_q = cell->getPort("\\Q");
275 
276  std::string gate_type = stringf("$_SR_%c%c_", set_pol, clr_pol);
277 
278  for (int i = 0; i < width; i++) {
279  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
280  gate->setPort("\\S", sig_s[i]);
281  gate->setPort("\\R", sig_r[i]);
282  gate->setPort("\\Q", sig_q[i]);
283  }
284 }
285 
287 {
288  int width = cell->parameters.at("\\WIDTH").as_int();
289  char clk_pol = cell->parameters.at("\\CLK_POLARITY").as_bool() ? 'P' : 'N';
290 
291  RTLIL::SigSpec sig_clk = cell->getPort("\\CLK");
292  RTLIL::SigSpec sig_d = cell->getPort("\\D");
293  RTLIL::SigSpec sig_q = cell->getPort("\\Q");
294 
295  std::string gate_type = stringf("$_DFF_%c_", clk_pol);
296 
297  for (int i = 0; i < width; i++) {
298  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
299  gate->setPort("\\C", sig_clk);
300  gate->setPort("\\D", sig_d[i]);
301  gate->setPort("\\Q", sig_q[i]);
302  }
303 }
304 
306 {
307  int width = cell->parameters.at("\\WIDTH").as_int();
308  char clk_pol = cell->parameters.at("\\CLK_POLARITY").as_bool() ? 'P' : 'N';
309  char en_pol = cell->parameters.at("\\EN_POLARITY").as_bool() ? 'P' : 'N';
310 
311  RTLIL::SigSpec sig_clk = cell->getPort("\\CLK");
312  RTLIL::SigSpec sig_en = cell->getPort("\\EN");
313  RTLIL::SigSpec sig_d = cell->getPort("\\D");
314  RTLIL::SigSpec sig_q = cell->getPort("\\Q");
315 
316  std::string gate_type = stringf("$_DFFE_%c%c_", clk_pol, en_pol);
317 
318  for (int i = 0; i < width; i++) {
319  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
320  gate->setPort("\\C", sig_clk);
321  gate->setPort("\\E", sig_en);
322  gate->setPort("\\D", sig_d[i]);
323  gate->setPort("\\Q", sig_q[i]);
324  }
325 }
326 
328 {
329  int width = cell->parameters.at("\\WIDTH").as_int();
330  char clk_pol = cell->parameters.at("\\CLK_POLARITY").as_bool() ? 'P' : 'N';
331  char set_pol = cell->parameters.at("\\SET_POLARITY").as_bool() ? 'P' : 'N';
332  char clr_pol = cell->parameters.at("\\CLR_POLARITY").as_bool() ? 'P' : 'N';
333 
334  RTLIL::SigSpec sig_clk = cell->getPort("\\CLK");
335  RTLIL::SigSpec sig_s = cell->getPort("\\SET");
336  RTLIL::SigSpec sig_r = cell->getPort("\\CLR");
337  RTLIL::SigSpec sig_d = cell->getPort("\\D");
338  RTLIL::SigSpec sig_q = cell->getPort("\\Q");
339 
340  std::string gate_type = stringf("$_DFFSR_%c%c%c_", clk_pol, set_pol, clr_pol);
341 
342  for (int i = 0; i < width; i++) {
343  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
344  gate->setPort("\\C", sig_clk);
345  gate->setPort("\\S", sig_s[i]);
346  gate->setPort("\\R", sig_r[i]);
347  gate->setPort("\\D", sig_d[i]);
348  gate->setPort("\\Q", sig_q[i]);
349  }
350 }
351 
353 {
354  int width = cell->parameters.at("\\WIDTH").as_int();
355  char clk_pol = cell->parameters.at("\\CLK_POLARITY").as_bool() ? 'P' : 'N';
356  char rst_pol = cell->parameters.at("\\ARST_POLARITY").as_bool() ? 'P' : 'N';
357 
358  std::vector<RTLIL::State> rst_val = cell->parameters.at("\\ARST_VALUE").bits;
359  while (int(rst_val.size()) < width)
360  rst_val.push_back(RTLIL::State::S0);
361 
362  RTLIL::SigSpec sig_clk = cell->getPort("\\CLK");
363  RTLIL::SigSpec sig_rst = cell->getPort("\\ARST");
364  RTLIL::SigSpec sig_d = cell->getPort("\\D");
365  RTLIL::SigSpec sig_q = cell->getPort("\\Q");
366 
367  std::string gate_type_0 = stringf("$_DFF_%c%c0_", clk_pol, rst_pol);
368  std::string gate_type_1 = stringf("$_DFF_%c%c1_", clk_pol, rst_pol);
369 
370  for (int i = 0; i < width; i++) {
371  RTLIL::Cell *gate = module->addCell(NEW_ID, rst_val.at(i) == RTLIL::State::S1 ? gate_type_1 : gate_type_0);
372  gate->setPort("\\C", sig_clk);
373  gate->setPort("\\R", sig_rst);
374  gate->setPort("\\D", sig_d[i]);
375  gate->setPort("\\Q", sig_q[i]);
376  }
377 }
378 
380 {
381  int width = cell->parameters.at("\\WIDTH").as_int();
382  char en_pol = cell->parameters.at("\\EN_POLARITY").as_bool() ? 'P' : 'N';
383 
384  RTLIL::SigSpec sig_en = cell->getPort("\\EN");
385  RTLIL::SigSpec sig_d = cell->getPort("\\D");
386  RTLIL::SigSpec sig_q = cell->getPort("\\Q");
387 
388  std::string gate_type = stringf("$_DLATCH_%c_", en_pol);
389 
390  for (int i = 0; i < width; i++) {
391  RTLIL::Cell *gate = module->addCell(NEW_ID, gate_type);
392  gate->setPort("\\E", sig_en);
393  gate->setPort("\\D", sig_d[i]);
394  gate->setPort("\\Q", sig_q[i]);
395  }
396 }
397 
400 
401 extern void simplemap_get_mappers(std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> &mappers);
402 
403 void simplemap_get_mappers(std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> &mappers)
404 {
405  mappers["$not"] = simplemap_not;
406  mappers["$pos"] = simplemap_pos;
407  mappers["$and"] = simplemap_bitop;
408  mappers["$or"] = simplemap_bitop;
409  mappers["$xor"] = simplemap_bitop;
410  mappers["$xnor"] = simplemap_bitop;
411  mappers["$reduce_and"] = simplemap_reduce;
412  mappers["$reduce_or"] = simplemap_reduce;
413  mappers["$reduce_xor"] = simplemap_reduce;
414  mappers["$reduce_xnor"] = simplemap_reduce;
415  mappers["$reduce_bool"] = simplemap_reduce;
416  mappers["$logic_not"] = simplemap_lognot;
417  mappers["$logic_and"] = simplemap_logbin;
418  mappers["$logic_or"] = simplemap_logbin;
419  mappers["$mux"] = simplemap_mux;
420  mappers["$slice"] = simplemap_slice;
421  mappers["$concat"] = simplemap_concat;
422  mappers["$sr"] = simplemap_sr;
423  mappers["$dff"] = simplemap_dff;
424  mappers["$dffe"] = simplemap_dffe;
425  mappers["$dffsr"] = simplemap_dffsr;
426  mappers["$adff"] = simplemap_adff;
427  mappers["$dlatch"] = simplemap_dlatch;
428 }
429 
432 
433 struct SimplemapPass : public Pass {
434  SimplemapPass() : Pass("simplemap", "mapping simple coarse-grain cells") { }
435  virtual void help()
436  {
437  // |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
438  log("\n");
439  log(" simplemap [selection]\n");
440  log("\n");
441  log("This pass maps a small selection of simple coarse-grain cells to yosys gate\n");
442  log("primitives. The following internal cell types are mapped by this pass:\n");
443  log("\n");
444  log(" $not, $pos, $and, $or, $xor, $xnor\n");
445  log(" $reduce_and, $reduce_or, $reduce_xor, $reduce_xnor, $reduce_bool\n");
446  log(" $logic_not, $logic_and, $logic_or, $mux\n");
447  log(" $sr, $dff, $dffsr, $adff, $dlatch\n");
448  log("\n");
449  }
450  virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
451  {
452  log_header("Executing SIMPLEMAP pass (map simple cells to gate primitives).\n");
453  extra_args(args, 1, design);
454 
455  std::map<RTLIL::IdString, void(*)(RTLIL::Module*, RTLIL::Cell*)> mappers;
456  simplemap_get_mappers(mappers);
457 
458  for (auto mod : design->modules()) {
459  if (!design->selected(mod))
460  continue;
461  std::vector<RTLIL::Cell*> cells = mod->cells();
462  for (auto cell : cells) {
463  if (mappers.count(cell->type) == 0)
464  continue;
465  if (!design->selected(mod, cell))
466  continue;
467  log("Mapping %s.%s (%s).\n", log_id(mod), log_id(cell), log_id(cell->type));
468  mappers.at(cell->type)(mod, cell);
469  mod->remove(cell);
470  }
471  }
472  }
473 } SimplemapPass;
474 
bool selected(T1 *module) const
Definition: rtlil.h:551
static void simplemap_bitop(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:54
static void simplemap_lognot(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:186
std::string stringf(const char *fmt,...)
Definition: yosys.cc:58
RTLIL::Cell * addCell(RTLIL::IdString name, RTLIL::IdString type)
Definition: rtlil.cc:1353
void log_header(const char *format,...)
Definition: log.cc:188
#define YOSYS_NAMESPACE_END
Definition: yosys.h:100
void setPort(RTLIL::IdString portname, RTLIL::SigSpec signal)
Definition: rtlil.cc:1789
RTLIL::Module * module
Definition: abc.cc:94
RTLIL::IdString type
Definition: rtlil.h:854
std::map< RTLIL::IdString, RTLIL::Const > parameters
Definition: rtlil.h:856
void extend_u0(int width, bool is_signed=false)
Definition: rtlil.cc:2612
int size() const
Definition: rtlil.h:1019
static void simplemap_pos(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:44
virtual void execute(std::vector< std::string > args, RTLIL::Design *design)
Definition: simplemap.cc:450
static void simplemap_dffsr(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:327
static void simplemap_dff(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:286
static void simplemap_mux(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:235
static void simplemap_dffe(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:305
void connect(const RTLIL::SigSig &conn)
Definition: rtlil.cc:1278
static void simplemap_concat(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:258
#define PRIVATE_NAMESPACE_BEGIN
Definition: yosys.h:97
SimplemapPass SimplemapPass
const RTLIL::SigSpec & getPort(RTLIL::IdString portname) const
Definition: rtlil.cc:1809
PRIVATE_NAMESPACE_END YOSYS_NAMESPACE_BEGIN void simplemap_get_mappers(std::map< RTLIL::IdString, void(*)(RTLIL::Module *, RTLIL::Cell *)> &mappers)
Definition: simplemap.cc:403
int GetSize(RTLIL::Wire *wire)
Definition: yosys.cc:334
static void simplemap_sr(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:266
#define log_assert(_assert_expr_)
Definition: log.h:85
RTLIL::Wire * addWire(RTLIL::IdString name, int width=1)
Definition: rtlil.cc:1331
#define NEW_ID
Definition: yosys.h:166
#define PRIVATE_NAMESPACE_END
Definition: yosys.h:98
static void logic_reduce(RTLIL::Module *module, RTLIL::SigSpec &sig)
Definition: simplemap.cc:160
Definition: register.h:27
static void simplemap_slice(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:250
#define USING_YOSYS_NAMESPACE
Definition: yosys.h:102
RTLIL::ObjRange< RTLIL::Module * > modules()
Definition: rtlil.cc:249
virtual void help()
Definition: simplemap.cc:435
#define NULL
#define YOSYS_NAMESPACE_BEGIN
Definition: yosys.h:99
static void simplemap_adff(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:352
static void simplemap_reduce(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:91
void log(const char *format,...)
Definition: log.cc:180
RTLIL::SigSpec extract(const RTLIL::SigSpec &pattern, const RTLIL::SigSpec *other=NULL) const
Definition: rtlil.cc:2414
void append(const RTLIL::SigSpec &signal)
Definition: rtlil.cc:2523
void extend(int width, bool is_signed=false)
Definition: rtlil.cc:2593
static void simplemap_dlatch(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:379
USING_YOSYS_NAMESPACE static PRIVATE_NAMESPACE_BEGIN void simplemap_not(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:30
void extra_args(std::vector< std::string > args, size_t argidx, RTLIL::Design *design, bool select=true)
Definition: register.cc:128
std::pair< SigSpec, SigSpec > SigSig
Definition: rtlil.h:71
static void simplemap_logbin(RTLIL::Module *module, RTLIL::Cell *cell)
Definition: simplemap.cc:206
const char * log_id(RTLIL::IdString str)
Definition: log.cc:283