ALU test scripts?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ALU test scripts?

Haiduc
Hi Guys,


So I've implemented my ALU to my satisfaction, i.e. it passes my little test script OK, but I was wondering if there is a corpus of test scripts with corresponding compare files against which I could do some additional testing?  I'm just concerned about the very large number of different input combinations (2^38 by my reckoning) and the difficulty of ensuring I've got a design with no subtle errors.

I do note that the book mentions scripts on the web site - but I couldn't find them .  Feel free to point me in the right direction, or alternatively... anyone care to share some meaty test/compare files?

Thoughts on effectively testing non-trivial chip designs also gratefully received :)
Reply | Threaded
Open this post in threaded view
|

Re: ALU test scripts?

milythael
This post was updated on .
As you have noticed, it is cost prohibitive to exhaustively test every
possible combination of input.  This is similar to testing a simple method
in higher level programing languages that takes two numbers as input and is
supposed to output the product of those two numbers.  Since the realm of a
single number is theoretically infinite, exhaustively testing this function
would also be infinite.  This is what leads us to testing important cases.
 Typically, testing valid samples of easy data and then testing edge cases
that need to be right is the way to go.  For example, in my example,
testing with both a and b as zero, with either one as zero and then with
various combinations of negative numbers is important.

You can probably consider your ALU well enough tested if you have
determined that individual bits aren't affecting each other
inappropriately, and that several bits are coming up with correct values.
 The provided script / compare file should be good enough to identify most
problems and if you pass that test, you can probably move on with
confidence.  Also, in later chapters, you should use the built in ALU
because of performance concerns.  This means a subtle bug in your code now
won't actually shoot you in the foot later.

I doubt people have much more to offer you for test scripts but if you
still want more, I would be happy to help you develop a more thorough test
script offline.

Sean
Reply | Threaded
Open this post in threaded view
|

Re: ALU test scripts?

cadet1620
Administrator
In reply to this post by Haiduc
Haiduc wrote
Hi Guys,


So I've implemented my ALU to my satisfaction, i.e. it passes my little test script OK, but I was wondering if there is a corpus of test scripts with corresponding compare files against which I could do some additional testing?  I'm just concerned about the very large number of different input combinations (2^38 by my reckoning) and the difficulty of ensuring I've got a design with no subtle errors.

I do note that the book mentions scripts on the web site - but I couldn't find them .  Feel free to point me in the right direction, or alternatively... anyone care to share some meaty test/compare files?

Thoughts on effectively testing non-trivial chip designs also gratefully received :)
You want to read this post: Hardware Construction Survival Kit.  It includes a link to the TECS web site page where you can get stubs and test scripts for the projects, and other useful information.

--Mark