Jump to content

Issue with `uvm_register_cb macro with parameterized classes

Recommended Posts


When I try to use the `uvm_register_cb macro with a parameterized class, I run into the below compile problem.

Error-[sE] Syntax error

Following verilog source has syntax error :

"scoreboard_c.svh", 178 (expanding macro): token is '#'

`uvm_register_cb(scoreboard_c #(T_EXP,T_ACT), scoreboard_cb_c #(T_EXP,T_ACT))

The uvm_register_cb macro expands to the below code:

/*=== scoreboard_c.svh(178), macro uvm_register_cb */

static local bit m_register_cb_scoreboard_cb_c #(T_EXP,T_ACT) = uvm_callbacks#(scoreboard_c #(T_EXP,T_ACT),scoreboard_cb_c #(T_EXP,T_ACT))::register_pair("scoreboard_c #(T_EXP,T_ACT)","scoreboard_cb_c #(T_EXP,T_ACT)");

If I replace the macro with below updated code (remove #(T_EXP,T_ACT) from the member name), everything works.

static local bit m_register_cb_scoreboard_cb_c = uvm_callbacks#(scoreboard_c#(T_EXP,T_ACT),scoreboard_cb_c#(T_EXP,T_ACT))::register_pair("scoreboard_c#(T_EXP,T_ACT)","scoreboard_cb_c#(T_EXP,T_ACT)");

Is this a known problem in uvm1.0?



Link to comment
Share on other sites

It does appear to be a limitation (it uses the class as part of the generated variable name). I didn't see any reference to it in the Mantis system.

One workaround would be to typedef your parameterized class and use that for the macro.

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.

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...