ptang Posted May 12, 2011 Report Share Posted May 12, 2011 Hi, 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? Regards, Pinh Quote Link to comment Share on other sites More sharing options...
jadec Posted May 12, 2011 Report Share Posted May 12, 2011 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. Quote Link to comment Share on other sites More sharing options...
ptang Posted May 12, 2011 Author Report Share Posted May 12, 2011 I was able to use the typedef workaround. However, I also believe this is a limitation. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.