Scoreboards and discards
January 27, 2008 4 Comments
A common difficulty in ASIC Verification is how to scoreboard packet discards. Malformed packets, tail drops (or RED), and the impossible task of being cycle accurate with the internal state of the ASIC make it virtually impossible for a scoreboard to predict what the outcome will be in the presence of saturated queues, error injection and other DUT internal states: will the packet make it, or will it get dropped? Trying to predict the output response is a game you lose before it even starts. Instead try to realize the truth: there is no spoon… er… the scoreboard does not have to predict the outcome, it only has to do the accounting.
For all types of discards except RED, the packet generator is the VC that knows what will happen to the packet. When the packet generator inserts a bogus TCP checksum, it knows the packet will be discarded for this reason. So instead of relying on the scoreboard to parse the packet and re-discover what the packet generator already knew, the scoreboard simply has to look up the packet in a table to know how to account for the packet. And you guessed it, that lookup table has been filled out by the packet generator.
The mechanics of filling out the packet table is simple as hashing on a property of the packet or on the entire packet, and storing or retreiving any information you need regarding the packet: it’s final destination, how it should be routed, whether it is expected to be discarded, if it should be segmented, if it will be discarded and why, etc. All the scoreboard has to do it look up the packet in the table, retreive the associated information, and increment a counter. When the simulation ends, simply check if all the packets have been accounted for by comparing the scoreboard counts with the packet generator counts and the DUT’s internal counters. If the DUT says it discarded 10 packets because of RED, the scoreboard knows that it will be off by 10 when it tries to balance the counts.
Don’t ask the scoreboard to predict outcomes, it’s too hard and it’s not the right place.