Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#898 Division with divisors larger than 32bits is incorrect

devel
closed-out-of-date
nobody
5
2012-07-09
2012-07-09
Thomas D.
No

using:

Icarus Verilog version 0.10.0 (devel) (s20090923-753-ge62b09d)

When you do division along the lines of:

quotient = dividend / divisor;

and the dividend and/or divisor are larger than 32 bits the result returned is wrong. Attached is a simple test bench that reports the following errors:

vzd file name = divide_integer_test.netlist_vzd
dividend = 1098791506602, divisor = 1924134885, quotient = 513
*** ERROR - divide_integer_test - quotient = 513, expected 571
dividend = 1098114386521, divisor = 1842047451, quotient = 512
*** ERROR - divide_integer_test - quotient = 512, expected 596
dividend = 1099037126343, divisor = 1527504310, quotient = 514
*** ERROR - divide_integer_test - quotient = 514, expected 719
*** TEST FINISHED.

Discussion

  • Thomas D.
    Thomas D.
    2012-07-09

    test bench to demonstrate bug

     
    Attachments
  • Cary R.
    Cary R.
    2012-07-09

    • status: open --> closed-out-of-date
     
  • Cary R.
    Cary R.
    2012-07-09

    This appears to be fixed in the latest development from git. I tested this on RHEL 5 (64 bit) and cygwin (32 bit) and both gave the correct results.

    I'm going to mark this as out of date. I'm also guessing the latest snapshot also will work correctly.