6

I have designed a 32-bit single precision floating point multiplier and also a separate add/subtract unit in Verilog.

I have a script in MATLAB that I wrote that generates a bunch of random floating point numbers and generates a test bench in Verilog.

I compared the results from the ncverilog simulation to those from MATLAB and verified that my multiplier works correctly and that my add/subtracter works correctly as well.

However, I want to know a list of test cases that stress test my floating point unit. Is there such a list? I know of some programs like Softfloat, but that tests a floating point of a computer, rather than being able to merge that with a verilog test bench.

I should also mention my unit doesn't support exceptions like overflow, underflow, and doesn't support denormalized values. The rounding mode is round to nearest.

Thank you!

Martin Thompson
  • 16,395
  • 1
  • 38
  • 56
Veridian
  • 3,531
  • 12
  • 46
  • 80
  • 1
    This looks promising: https://www.research.ibm.com/cgi-bin/haifa/test_suite_download.pl?first=elenag&second=webmaster – Tim Feb 22 '13 at 17:58
  • Yes it does, now comes the annoying part of parsing those files. Thank you. – Veridian Feb 22 '13 at 18:21
  • When I worked on FPUs many years ago, I used the following paper to construct my own test vectors for initial coverage and found it useful in rooting out bugs: N. L. Schryer. A test of computer's floating-point arithmetic unit. Technical report 89, AT&T Bell Laboratories, 1981. – njuffa Feb 23 '13 at 18:44
  • @Tim , does "Floating-Point Test Generator - FPgen" have 64 floating point test vectors ? – chitranna May 01 '14 at 07:54
  • @Tim The test suite in the link provided by you, do you have any idea if it is covered by some licensing agreement? I visited the site but i cannot find any clear indication of what is their license scheme for using it. I need to be sure as i will be using it at my work( that is if it is open) – Gautam Jan 31 '15 at 04:57

2 Answers2

2

Tim's answer was the best, the fpgen suite:
https://www.research.ibm.com/cgi-bin/haifa/test_suite_download.pl?first=elenag&second=webmaster

Veridian
  • 3,531
  • 12
  • 46
  • 80
  • 2
    Parse it in a proper language and write out some Verilog... don't attempt to do the parse in Verilog :) – Martin Thompson Feb 25 '13 at 16:00
  • @MartinThompson, lol, yes I did the parsing in MATLAB. Thank you for the heads up though. – Veridian Feb 25 '13 at 16:13
  • @starbox,@Martin Thompson does "Floating-Point Test Generator - FPgen" have 64 floating point test vectors ?Also how do i parse it to get in 32 but binary values ? – chitranna May 01 '14 at 07:55
  • @TrafalgarLaw, did you visit the website to see? There is a lot of documentation available. – Veridian May 01 '14 at 23:20
  • I did , but count find what I wanted – chitranna May 04 '14 at 12:44
  • @starbox Any idea of the licensing of the test suite at the link you have provided? I visited the site but i don't see mention of license for the suite – Gautam Jan 31 '15 at 04:43
1

The canonical [published] set of test vectors for FP are those from Jerome Coonen's PhD thesis. They are available (on tape!) from IEEE, but I suspect you can find them in a more convenient format with a little searching.

Stephen Canon
  • 103,815
  • 19
  • 183
  • 269
  • Found it, not easily translatable into something useful. I think parsing the IBM file referenced above will be easier. – Veridian Feb 22 '13 at 21:01
  • @starbox Where did you find the above mentioned test vectors? If it is not much of a trouble could you please post the link? – Gautam Jan 31 '15 at 05:01