Update backends/btor/btor.cc; credit @boqwxp
authorEddie Hung <eddie@fpgeh.com>
Sun, 15 Mar 2020 16:09:35 +0000 (09:09 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 2 Apr 2020 14:14:08 +0000 (07:14 -0700)
Co-Authored-By: Alberto Gonzalez <61295559+boqwxp@users.noreply.github.com>
backends/btor/btor.cc

index d2bca8cd6299ff4db08407834045412931a5aad2..eabd870ab715540072db1e35c87fe887663b2c09 100644 (file)
@@ -433,8 +433,7 @@ struct BtorWorker
                        if (cell->type == "$neg") btor_op = "neg";
                        log_assert(!btor_op.empty());
 
-                       int width = GetSize(cell->getPort(ID::Y));
-                       width = std::max(width, GetSize(cell->getPort(ID::A)));
+                       int width = std::max(GetSize(cell->getPort(ID::A)), GetSize(cell->getPort(ID::Y)));
 
                        bool a_signed = cell->hasParam("\\A_SIGNED") ? cell->getParam("\\A_SIGNED").as_bool() : false;