Re: what's difference between code coverage and function cov
consider this scenario ... there is a requirement for a code which implements a synchornus FIFO (for simplicity) ... it has wr pin when high the code will store the data present in data_wr bus into fifo and it has rd pin when this is high then the data is read from the fifo into the bus data_rd.
For verifing the design ...
1. make sure that the test cases u write cover all the lines of the RTL that was written there are specific tools that monitor if the compiler has executed that line of code suppose if the tool says that there is a line in RTL say an if condition that checks if both rd and wr were tried at same time but code inside this if statement was never executed this should tell u that you have not created any condition that checks for simultanous read and write happing .. this is know as code coverage
2. Funcitonal coverage has nothing to do with the code coverage , if we consider the FIFO example . the function of the module cna be broken down to this
(a). it can read (b). it can write
so create test cases that check for reading and writing then check for conditions like reading and writing at the same time then probably some conditon like reading and writing at same time continously say for 5 cycles . What happens ?? This type of coverage is know as funcitonal coverage