How do I test 32-bit multiplier in the real verification world?

Hi, I’m trying to get some insight for coverage. Assume that the 32-bit multiplier has two inputs, there are 2^32 (unsigned int) = 4,294,967,296 possible cases for each input. Therefore, to test all cases, we need a total of (2^32)^2 = 18,446,744,073,709,551,616 cases. Since each case takes 1 ns, the total simulation time can be calculated as follows
18,446,744,073,709,551,616 x 1ns = 18,446,744,073,709.551616 seconds

This is roughly equivalent to 585,862.2 years, and it would be impossible to achieve 100% all cases.
How do I test in the real verification world?

You have shown 100% of exhaustive testing of a 32 bit multiplier is impossible in many thousand lifetimes !
So now you have to decide how much you can really want to test this mutiplier.

Let me consider the other extreme where someone is happy with minimal testing
So if we break the inputs into two bins .

Inp1_Lower_Half_Bin = [ 0 … (2^16-1)]
Inp1_Upper_Half_Bin = [(2^16)…(2^32-1)]

Inp2_Lower_Half_Bin = [ 0 … (2^16-1)]
Inp2_Upper_Half_Bin = [(2^16)…(2^32-1)]

Let us say we will be happy if we test with one number from each of the bins.
We can pick a random number within a bin. In this scenario, we have to only do 4 tests
Obviously this is not sufficient ( and will not be acceptable to any verification team).

So let us break the inputs into 4 bins … The number of tests will increase to 16
Similarly if we break the inputs into n bins … the number of tests will now be 2^n.

Pick an “n” where you will be comfortable. n=20 will give you 1Million tests to run.

Logie Ramachandran
Verikwest Systems Inc

In reply to UVM_LOVE:

In the real world of verification, you rarely have to verify a multiplier or any other arithmetic operator. You wither will pull some IP from your FPGA/ASIC vendor or your synthesis tool will implement it for you. You will have to verify that you have specified your multiplier correctly (for signed or unsigned arithmetic, and proper input/output sizing) and made the necessary connections to handle those inputs and outputs. For that you can use a combination of random testing and directed test for corner case.

If you are implementing an algorithm for a operator yourself, there are textbook examples for testing highly regular structures in simulation. There are also formal techniques for exhaustively verifying an operation.

In reply to dave_59:

Not only multipliers or other arithmetic operators need this, but other devices as well, and one example is a bus address or memory address. For example, if I need to determine the memory or protocol bus address [0x20000000 : 0xF0000000], which method will help me?