On Nov 17, 4:44*pm, KJ <kkjenni...@sbcglobal.net> wrote:
> On Nov 16, 6:30*am, Eli Bendersky <eli...@gmail.com> wrote:
>
>
>
> > Hello,
>
> > The testbench is for a complex multi-functional FPGA. This FPGA has
> > several almost unrelated functions, which it makes sense to check
> > separately. So I'm in doubt as to how to structure my testbench. As I
> > see it, there are two options:
>
> > 1) One big testbench for everything, and some way to sequence the
> > tests of the various functions
> > 2) Separate testbenches, one for each function
>
> > Each approach has its pros and cons. Option (2) sounds the most
> > logical, at least at first, but when I begin pursuing it, some
> > problems emerge. For example, too much duplication between testbenches
> > - in all of them I have to instantiate the large top-level entity of
> > the FPGA, write the compilation scripts for all the files, and so on.
>
> I would have a separate testbench for each of these individual
> functions, however they would not be instantiating the top level FPGA
> at all. *Each function presumably has it's own 'top' level that
> implements that function, the testbench for that function should be
> putting that entity through the wringer making sure that it works
> properly. *Having a single instantiation of the top level of the
> entire design to test some individual sub-function tends to
> dramatically slow down simulation which then produces the following
> rather severe consequences:
>
> - Given an aribtrary period of wall clock time, less testing of a
> particular function can be performed.
> - Less testing implies less coverage of oddball conditions.
> - When you have to make changes to the function to fix a problem that
> didn't happen to show up until the higher level testing was performed,
> regression testing will also be hampered by the above two points when
> trying to verify that in fixing one problem you didn't create another.
>
> As a basic rule, a testbench should be testing new design content that
> occurs roughly at that level not design content that is buried way
> down in the design. *At the top level of the FPGA design, the only new
> design content is the interconnect to the top level functions and the
> instantiation of all of the proper components.
>
While I agree that this approach is the most suitable, and your JPEG
example is right to the point, it must be stressed that there are some
problems with it.
First of all, the "details devil" is sometimes in the interface
between modules and not inside the modules themselves. Besides, you
can't always know where a module's boundary ends, especially if it's
buried deep in the design.
Second, the guys doing the verification are often not the ones who
wrote the synthesizable code, and hence have little idea of the
modules inside and their interfaces.
Third, the modules inside can change, or their interfaces can change
due to redesign or refactoring, so the testbench is likely to change
more often. On the top level, system requirements are usually more
static.
Eli
|