Fix issue with part of PI being 1'bx
authorEddie Hung <eddie@fpgeh.com>
Fri, 21 Jun 2019 00:29:45 +0000 (17:29 -0700)
committerEddie Hung <eddie@fpgeh.com>
Fri, 21 Jun 2019 00:29:45 +0000 (17:29 -0700)
frontends/aiger/aigerparse.cc
tests/simple_abc9/abc9.v

index b98b36319ee5f002a8485570fd24291cbcee1ab9..1235af142c4410b5d1e3d905868fb1a2340be0f7 100644 (file)
@@ -944,11 +944,13 @@ void AigerReader::post_process()
                        if (other_wire) {
                                other_wire->port_input = false;
                                other_wire->port_output = false;
-                               if (wire->port_input)
-                                       module->connect(other_wire, SigSpec(wire, i));
-                               else
-                                       module->connect(SigSpec(wire, i), other_wire);
                        }
+                       if (wire->port_input && other_wire)
+                               module->connect(other_wire, SigSpec(wire, i));
+                       else
+                                                                 // Since we skip POs that are connected to Sx,
+                                                                 // re-connect them here
+                               module->connect(SigSpec(wire, i), other_wire ? other_wire : SigSpec(RTLIL::Sx));
                }
        }
 
index 0b83c34a3b69937e175dea9c91db288189211b20..64b625efed521aa6b18c1358dbebf34e892e6a53 100644 (file)
@@ -262,3 +262,8 @@ endmodule
 module abc9_test025(input [3:0] i, output [3:0] o);
 abc9_test024_sub a(i[2:1], o[2:1]);
 endmodule
+
+module abc9_test026(output [3:0] o, p);
+assign o = { 1'b1, 1'bx };
+assign p = { 1'b1, 1'bx, 1'b0 };
+endmodule