Since the image is generated using an algorithm imposed on the input data, isn’t the comparison of the generated DUT image with an image generated by simulation of the algorithm sufficient?
If you are talking about a randomly generated image, you can impose that image against a reference model that creates the expected results.
If you only want to check that the statistics on the quality of the image produced (the items 1 and 2 in your list), then a simple count of the types of pixels produced should be sufficient. Of course, that does not guarantee that the filtering requirements are met.
If you already understand how to write the constraint expression, then you already know how to write the checker expression—they are both the same thing. You can even call randomize(null) which checks the constraints using the current values of all your variables.
Thanks Ben!
I looked at your paper , Do you think i can consider such assertions in my testbench?
The model holds an image in a 25x25 matrix array.
Each pixel in that image is an unsigned integer. The image is partitioned into 25 slices or
quadrants, and the scoreboard needs to compute within a 5x5 slice the number of pixels
greater than 3. The image is loaded when done_image is true, and the slice to be selected
is determined at a new ld signal. The done_image occurs within 1 to 3 cycles after the ld
signal.
How can i achieve this? If you are talking about a randomly generated image, you can impose that image against a reference model that creates the expected results.
In the next 2020 issue of the Verification Horizons I believe that my next paper Understanding the SVA Engine Using fork-join Model will be published.
In any case, the point that I am making is that if your verification environment is in a class, then use SVA model emulation using tasks. The paper http://systemverilog.us/papers/sva4scoreboarding.pdf demonstrates how SVA is used to trigger the needed functions to do complex computations and verification. But in the end, it all boils down to the same thing. It’s interesting that my model has a lot of similarities to your requirements.
Thus, yes, you can use a similar approach for your verification.