Fixed another bug found using vloghammer
authorClifford Wolf <clifford@clifford.at>
Sun, 7 Jul 2013 14:49:30 +0000 (16:49 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 7 Jul 2013 14:49:30 +0000 (16:49 +0200)
frontends/ast/genrtlil.cc
tests/simple/vloghammer.v [new file with mode: 0644]

index 03bb8a43009cdb21eca454f656807e00886481f0..f9f5c6f88cd04aa3406cf36641fdd0051252b7fd 100644 (file)
@@ -798,7 +798,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint)
        if (0) { case AST_SHIFT_SLEFT:  type_name = "$sshl"; is_signed = true; }
        if (0) { case AST_SHIFT_SRIGHT: type_name = "$sshr"; is_signed = true; }
                {
-                       RTLIL::SigSpec left = children[0]->genRTLIL(width_hint);
+                       RTLIL::SigSpec left = children[0]->genRTLIL();
                        RTLIL::SigSpec right = children[1]->genRTLIL(width_hint);
                        int width = width_hint > 0 ? width_hint : left.width;
                        return binop2rtlil(this, type_name, width, left, right);
diff --git a/tests/simple/vloghammer.v b/tests/simple/vloghammer.v
new file mode 100644 (file)
index 0000000..a0cde04
--- /dev/null
@@ -0,0 +1,10 @@
+
+// test cases found using vloghammer
+// https://github.com/cliffordwolf/VlogHammer
+
+module test01(a, y);
+       input [7:0] a;
+       output [3:0] y;
+       assign y = ~a >> 4;
+endmodule
+