Jump to content

Functional Coverage: How to sample RTL signals in a hierarchy (gives error)


alih

Recommended Posts

Hello,

 

I am creating a functional coverage model.

I am binding my coverage model with the design using the "bind" statement.
I need to access some internal signals of a design instance inside a design module for using in my functional coverage model. However I get an error when I try that.

 

Below is what I am trying =>

In the RTL design module "dut_berc", there is a instance "dut_berc_cmd". I need to access the signal "pct_err_status_vec" in this "dut_berc_cmd" module.

 

So in design =>
-----------------------------
module dut_berc #(....)
(clk, reset, ....
);

dut_berc_cmd #(...)

       u_dut_berc_cmd (..);
-----------------------------

-----------------------------
module dut_berc_cmd #(....)
(.....
);

 

logic [PCT_DEPTH-1:0] pct_err_status_vec; <----- This is the signal I need to sample inside my functional coverage model

-----------------------------

 

In the top level TB file, the bind happens =>
---------------------------
bind dut_berc
dut_cov_berc #()
FUNC_COVERAGE (.*);
---------------------------

 

In "dut_cov_berc" =>
-------------------------
module dut_cov_berc #(...)
(
input [PCT_DEPTH-1:0] u_dut_berc_cmd.pct_err_status_vec,
........
)
-------------------------

 

However I get the following error when I try this =>
-----------------------------------
** Error: /view/....../src/dut_cov_berc.sv(36): near ".": syntax error, unexpected '.', expecting ')'
-----------------------------------

 

I tried directly accessing the signal in my functional coverage module but it gave an error that it is unable to find this signal.

Please let me known what is the correct way to access design signals present in a hierarcy in the functional coverage model?

 

Thanks.

 

Link to comment
Share on other sites

I don't understand this code:

module dut_cov_berc #(...)
(
input [PCT_DEPTH-1:0] u_dut_berc_cmd.pct_err_status_vec,
........
)

You don't need the u_dut_berc_cmd.pct_err_status_vec doesn't make sense to me.

 

When you use bind, it's like you've instantiated the bound module inside the target. So in your case it's like you wrote

module dut_berc #(....)
(clk, reset, ....
);
   dut_berc_cmd #(...) u_dut_berc_cmd (..);
   dut_cov_berc #() FUNC_COVERAGE (.*);

So if you weren't using bind, you'd have to use

module dut_berc #(....)
(clk, reset, ....
);
   dut_berc_cmd #(...) u_dut_berc_cmd (..);
   dut_cov_berc #() FUNC_COVERAGE ( u_dut_berc_cmd.pct_err_status_vec, .*);

which means your bind statement should be

bind dut_berc dut_cov_berc #() FUNC_COVERAGE (u_dut_berc_cmd.pct_err_status_vec, .*);

I think. I haven't compiled this, so I could well be wrong :-)

 

Alan

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...