Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

Code Coverage

Does anyone know if there is a code coverage tool for the NIOS2? What I am talking about is a tool that connects to the hardware and traces each if, while, for, switch, etc. It dumps a report/analysis that lets you know where your dead code is. It sounds complicated, but in all actuality it takes your source code, inserts a data bus write (tag) at each conditional statement, and then recompiles it. Yes it does increase the app size and slows you down a bit, but it does what it's supposed to do - code coverage. All you need is to supply a nWE and 32 bits of data. When you run your code, it collects the data tags and writes a report for you. It's kind of like a device specific logic analyzer. We use Metrowerks Codetest, but they don't have NIOS2 support at this time. Just wondering if anyone else has something similar.