Jump to content
soloist_huaxin

Using parametrized class in package

Recommended Posts

I'm building a SV class where it basically acts like broadcaster(see attached, class "bcast" is what I'm building) where it gets data object from one channel and broadcast it to others. I got the following error when compiling:

vcs -sverilog -debug_all scratch.v

Error-[ICTTFC] Incompatible complex type usage
scratch.v, 45
  Incompatible complex type usage in task or function call.
  The following expression is incompatible with the formal parameter of the 
  task. The type of the actual is 'class data_p::myD3', while the type of the 
  formal is 'class data_p::myD2'. Expression: this.data_obj
  Source info: base_p::\chan#(data_p::myD2)::get (this.in_chan, 
  this.data_obj);

My understanding is that the parameter for class "bcast" should get passed down when declaring the class member "in_chan", but VCS doesn't think so...Is there something I'm missing?

 

 

scratch.v

Share this post


Link to post
Share on other sites

Works for me in Questa, and in the  VCS on edaplayground.com. I mean I get no compilation errors, did not check the functionality of your code. Maybe you are using an older version,

Also, I suggest using *.SystemVerilog as file extension of using *.v and -sverilog switch. That helps keep legacy Verilog files working. 

 

 

Share this post


Link to post
Share on other sites
10 minutes ago, dave_59 said:

Works for me in Questa, and in the  VCS on edaplayground.com. I mean I get no compilation errors, did not check the functionality of your code. Maybe you are using an older version,

Also, I suggest using *.SystemVerilog as file extension of using *.v and -sverilog switch. That helps keep legacy Verilog files working. 

 

 

That's interesting...I'm using VCS 2017.03 so definitely not old version...

result from VCS on edaplayground.com seems to match my expectation on functionality. It's using VCS 2014.10 so I'm not sure about what happened between the versions...

Agreed on the second point - I just quickly typed up the file as example.

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

×