Jump to content
Sign in to follow this  
chip_maker

Enabling and executing functional coverage using UVM RAL

Recommended Posts

Hello,

Ralgen is being used to generate UVM regmodel with address map coverage. I see the corresponding constructs. However when on simulating, the tool shows zero percent coverage. Wonder what I might be missing. Do I need to use sample() function explicitly? If so, how can I use it with pre-built UVM sequences?

Kal

In my uvm test, I have the following code:

uvm_reg::include_coverage("*", UVM_CVR_ALL);

super.build_phase(phase);

endfunction : build_phase // void

task run_phase(uvm_phase phase);

super.run_phase(phase);

void'(sve.m_spiup_regmodel.set_coverage(UVM_CVR_ALL));

//create vseq

//run vseq

endtask : run_phase

Share this post


Link to post
Share on other sites

Do you get any warning as

covergroup "per_instance" option , by default, is set as 0. ??

i assume this must be there in log, please confirm this.

i met with same kind of problem, and after banging my head for couple of days i got to know that

for functional coverage this option need to set 1

there are 2 ways either you can set it from covergroup or through coverage configuration file.

like this

You can override the default behavior of covergroups by adding the assignment

option.per_instance = 1;

to your covergroup declaration. Or by adding a coverage-configuration file with the command

set_covergroup -per_instance_default_one

and passing it to the elaborator.

Share this post


Link to post
Share on other sites

I'm using Mentor's Questa for simulation. I don't see 'set_covergroup' command. By the way the report does include per_instance...

For ralgen I used the following command:

ralgen -l sv -t Mychip__Bus_2013_02_28_r0 -uvm -c a ralfconv.ralf -o ral_Mychip__Bus_2013_02_28_r0.svh

To get cover report, I used the following command:

coverage report -detail -cvg -comments -option -file fcover_report.txt

Here's extract from log:

Covergroup instance \/mychip_pkg::ral_block_Mychip__Bus_2013_02_28_r0_spi_module_1::cg_addr

0.0% 100 ZERO

option.name=\/mychip_pkg::ral_block_Mychip__Bus_2013_02_28_r0_spi_module_1::cg_addr

option.weight=1

option.goal=100

option.comment=

option.at_least=1

option.auto_bin_max=64

option.cross_num_print_missing=0

option.detect_overlap=0

option.per_instance=1

option.get_inst_coverage=0

Coverpoint sys_clk_pll_reset_reg 0.0% 100 ZERO

covered/total bins: 0 1

missing/total bins: 1 1

option.weight=1

option.goal=100

option.comment=

option.at_least=1

option.auto_bin_max=64

option.detect_overlap=0

bin accessed 0 1 ZERO

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×