Test program for literal signedness


Subject: Test program for literal signedness
From: Steven Sharp (sharp@cadence.com)
Date: Wed Jul 24 2002 - 13:02:56 PDT


module top;
reg [1:0] rs, ru, rt;
initial
begin
        rs = 1'sb1 | 1'sb0;
        ru = 1'sb1 | 1'b0;
        rt = 1'sb1 | '0;
        if (rs !== 2'b11 || ru !== 2'b01)
                $display("signed arithmetic broken!");
        if (rt === rs)
                $display("test literal is signed");
        else if (rt === ru)
                $display("test literal is unsigned");
        else
                $display("test literal is broken");
end
endmodule



This archive was generated by hypermail 2b28 : Wed Jul 24 2002 - 13:05:07 PDT