fusesoc icon indicating copy to clipboard operation
fusesoc copied to clipboard

Generate coverage information with ghdl

Open danselmi opened this issue 3 years ago • 3 comments

Hi,

I like to generate coverage information for a core with ghdl (gcc backend). For this i need to add these options: -Wc,-fprofile-arcs -Wc,-ftest-coverage -Wl,-lgcovduring make phase (ghdl -m) but not for the import (ghdl -i). GHDL complains if these options are present during import.

When I add these options to targets:sim:tools:ghdl:analyze_options they are added to both phases.

Is it possible to add options only to make phase? Or is there another solution?

Thanks in advance

danselmi avatar Dec 17 '21 17:12 danselmi

Do you have an error message for ghdl -i when -lgcov is added?

m-kru avatar Apr 03 '22 06:04 m-kru

Yes, I got the following error message: ghdl:error: unknown command option '-lgcov'

danselmi avatar Apr 07 '22 13:04 danselmi

The most straight-forward way would be to add a new backend option to split up the -i and -m options. But! I was halfway through a rewrite of the ghdl backend some months ago and I have a vague memory that I planned to drop the -i -m flow in favor of some other flow. Unfortunately I can't remember the details and I never manage to learn how ghdl works. I mention this because there might be bigger changes needed and if so, I want to get this right from the start

olofk avatar May 31 '22 21:05 olofk