aboutsummaryrefslogtreecommitdiffstats
path: root/backends/verilog
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-05-17 09:08:29 +0200
committerClifford Wolf <clifford@clifford.at>2017-05-17 09:08:29 +0200
commit05cdd58c8dc73968992681d0ee1cbfa89880b94f (patch)
tree426fabb50c83d45f1194bd94125d4701242e920f /backends/verilog
parent9f4fbc5e74747c8973da3a2fd42d2ef40dbe1fa5 (diff)
downloadyosys-05cdd58c8dc73968992681d0ee1cbfa89880b94f.tar.gz
yosys-05cdd58c8dc73968992681d0ee1cbfa89880b94f.tar.bz2
yosys-05cdd58c8dc73968992681d0ee1cbfa89880b94f.zip
Add $_ANDNOT_ and $_ORNOT_ gates
Diffstat (limited to 'backends/verilog')
-rw-r--r--backends/verilog/verilog_backend.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc
index 191553324..bb312944e 100644
--- a/backends/verilog/verilog_backend.cc
+++ b/backends/verilog/verilog_backend.cc
@@ -470,7 +470,7 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
return true;
}
- if (cell->type.in("$_AND_", "$_NAND_", "$_OR_", "$_NOR_", "$_XOR_", "$_XNOR_")) {
+ if (cell->type.in("$_AND_", "$_NAND_", "$_OR_", "$_NOR_", "$_XOR_", "$_XNOR_", "$_ANDNOT_", "$_ORNOT_")) {
f << stringf("%s" "assign ", indent.c_str());
dump_sigspec(f, cell->getPort("\\Y"));
f << stringf(" = ");
@@ -478,16 +478,18 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell)
f << stringf("~(");
dump_cell_expr_port(f, cell, "A", false);
f << stringf(" ");
- if (cell->type.in("$_AND_", "$_NAND_"))
+ if (cell->type.in("$_AND_", "$_NAND_", "$_ANDNOT_"))
f << stringf("&");
- if (cell->type.in("$_OR_", "$_NOR_"))
+ if (cell->type.in("$_OR_", "$_NOR_", "$_ORNOT_"))
f << stringf("|");
if (cell->type.in("$_XOR_", "$_XNOR_"))
f << stringf("^");
dump_attributes(f, "", cell->attributes, ' ');
f << stringf(" ");
+ if (cell->type.in("$_ANDNOT_", "$_ORNOT_"))
+ f << stringf("~(");
dump_cell_expr_port(f, cell, "B", false);
- if (cell->type.in("$_NAND_", "$_NOR_", "$_XNOR_"))
+ if (cell->type.in("$_NAND_", "$_NOR_", "$_XNOR_", "$_ANDNOT_", "$_ORNOT_"))
f << stringf(")");
f << stringf(";\n");
return true;