Jump to content

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

Link to comment
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. 

 

 

Link to comment
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.

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