shiftx NULL pointer check
authorEddie Hung <eddieh@ece.ubc.ca>
Mon, 18 Mar 2019 20:35:54 +0000 (13:35 -0700)
committerEddie Hung <eddieh@ece.ubc.ca>
Mon, 18 Mar 2019 20:35:54 +0000 (13:35 -0700)
passes/techmap/shregmap.cc

index 179a331fd735b544b943ee34651fdf76cf56aae5..f3153b400ae7ae18bbd3829d30919f2827099a05 100644 (file)
@@ -165,15 +165,17 @@ struct ShregmapTechXilinx7 : ShregmapTech
                        }
                }
 
-               // Cannot implement variable-length shift registers
-               // greater than 128 since Q31 cannot be output onto
-               // fabric
-               if (shiftx && GetSize(taps) > 128)
-                       return false;
+               if (shiftx) {
+                       // Cannot implement variable-length shift registers
+                       // greater than 128 since Q31 cannot be output onto
+                       // fabric
+                       if (GetSize(taps) > 128)
+                               return false;
 
-               // Only map if $shiftx exclusively covers the shift register
-               if (GetSize(taps) != shiftx->getParam("\\A_WIDTH").as_int())
-                       return false;
+                       // Only map if $shiftx exclusively covers the shift register
+                       if (GetSize(taps) != shiftx->getParam("\\A_WIDTH").as_int())
+                               return false;
+               }
 
                return true;
        }