diff options
author | Clifford Wolf <clifford@clifford.at> | 2017-05-17 09:08:29 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2017-05-17 09:08:29 +0200 |
commit | 05cdd58c8dc73968992681d0ee1cbfa89880b94f (patch) | |
tree | 426fabb50c83d45f1194bd94125d4701242e920f /backends/smv | |
parent | 9f4fbc5e74747c8973da3a2fd42d2ef40dbe1fa5 (diff) | |
download | yosys-05cdd58c8dc73968992681d0ee1cbfa89880b94f.tar.gz yosys-05cdd58c8dc73968992681d0ee1cbfa89880b94f.tar.bz2 yosys-05cdd58c8dc73968992681d0ee1cbfa89880b94f.zip |
Add $_ANDNOT_ and $_ORNOT_ gates
Diffstat (limited to 'backends/smv')
-rw-r--r-- | backends/smv/smv.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/backends/smv/smv.cc b/backends/smv/smv.cc index 162ce4906..768969e6b 100644 --- a/backends/smv/smv.cc +++ b/backends/smv/smv.cc @@ -507,15 +507,19 @@ struct SmvWorker continue; } - if (cell->type.in("$_AND_", "$_NAND_", "$_OR_", "$_NOR_", "$_XOR_", "$_XNOR_")) + if (cell->type.in("$_AND_", "$_NAND_", "$_OR_", "$_NOR_", "$_XOR_", "$_XNOR_", "$_ANDNOT_", "$_ORNOT_")) { string op; - if (cell->type.in("$_AND_", "$_NAND_")) op = "&"; - if (cell->type.in("$_OR_", "$_NOR_")) op = "|"; + if (cell->type.in("$_AND_", "$_NAND_", "$_ANDNOT_")) op = "&"; + if (cell->type.in("$_OR_", "$_NOR_", "$_ORNOT_")) op = "|"; if (cell->type.in("$_XOR_")) op = "xor"; if (cell->type.in("$_XNOR_")) op = "xnor"; + if (cell->type.in("$_ANDNOT_", "$_ORNOT_")) + assignments.push_back(stringf("%s := %s %s (!%s);", lvalue(cell->getPort("\\Y")), + rvalue(cell->getPort("\\A")), op.c_str(), rvalue(cell->getPort("\\B")))); + else if (cell->type.in("$_NAND_", "$_NOR_")) assignments.push_back(stringf("%s := !(%s %s %s);", lvalue(cell->getPort("\\Y")), rvalue(cell->getPort("\\A")), op.c_str(), rvalue(cell->getPort("\\B")))); |