On 24/09/2019 08:42, Maciej Sobczak wrote:
> Hi, my first post here, I'm glad to join the group.
>
> I'm a software engineer with interests in embedded designs and I have decided to learn VHDL as a way to broaden my perspective on the world of programmable devices. My understanding, confirmed by authors of several books that I have seen so far, is that VHDL programming is a software experience.
I would argue against this and would say it is more of a hardware
experience, as many engineers will tell you think hardware when you
write your RTL. I would say that only languages like untimed C/C++ can
be considered more of a software than hardware experience.
This in turn suggests that with respect to quality and verification in
the industrial practice, the software standards should be relevant. All
is well until we reach the point where the easy analogies break apart -
one of such points is the notion of code coverage.
>
> Software world has a pretty good understanding of code coverage and of techniques to measure it.
The same applies in the hardware world, Code Coverage has been used for
many decades. My first introduction to Code Coverage was nearly 25 years
ago with the VN tools.
That is, my 100% object code coverage has a precise meaning and I know
how to get the evidence that my test suite actually exercises the given
design to that extent. This is how I can convince myself, the customers,
the certification authorities or whoever else, that the software was
done right.
Are you sure? I have never used Code Coverage in the software world but
Code Coverage is a measure how well your testbench/testfixture is
stimulating your design, it tells you nothing if your design is working
OK. In the hardware world you have to use functional coverage to answer
that questions.
>
> But what is the analogy of code coverage in VHDL? I can imagine that when we limit the discussion to simulation only, there are no new problems, because the design can be instrumented or the debugger instructed to gather the coverage traces and this is all software exercise.
This can also be done one a synthesised/P&R'd design or even on chip.
But the synthesis seems to be a black box, further concealed by the IP
concerns of the toolset and chip vendor. That is, because the
synthesized structures do not necessarily mirror the VHDL structures, my
simulation coverage traces are not necessarily indicative of the final
coverage in the programmed chip.
There are a lots of answers and subtleties to all the points you have
raised. However, I would say in general that if you fully validated your
synchronous RTL design you can assume that after synthesis and P&R the
produce netlist is equivalent to your RTL. If you want to validate the
netlist you can use an equivalence checker. This is especially important
if additional logic such as TMR, BIST etc is added.
One important aspect which might be different from the software world is
that 100% Code Coverage is not always achievable. I also expect that
there are more Code Coverage metrics in the hardware world than in the
software world. We have metrics like path and toggle coverage to name a
few.
Regards,
Hans
www.ht-lab.com