I’m attempting to modularize my testbench using packages but am getting this error during compile:
pbist_agent = PbistAgent::type_id::create("pbist_agent", this);
|
ncvlog: *E,TYCMPAT (…/tb/pbistEnv.sv,23|64): formal and actual do not have assignment compatible data types (expecting datatype compatible with ‘class ovm_component’ but found ‘class PbistBaseEnv’ instead).
module worklib.pbist_tb
errors: 1, warnings: 0
(The ‘|’ in the error message is pointing to the “this” portion in the line of code in case it doesn’t format correctly).
This testbench compiled and ran just fine before when I just `included everything. I put the code/files associated with the PbistAgent (agent,driver and sequencer) into a package construct, precompiled it and then imported it into the top level testbench module.
PbistBaseEnv is derived from ovm_env which is derived from ovm_component so what am I missing? I’m suspecting that it has to do with the package since the scoreboard create line doesn’t get flagged. The PbistAgent constructor is the standard constructor that is passed (string name, ovm_component parent) and calls super.new(name,parent).
Here’s some more of the code that may be relevant:
class PbistBaseEnv extends ovm_env;
PbistAgent pbist_agent;
PbistScoreboard pbist_scoreboard;
`ovm_component_utils(PbistBaseEnv)
function new (string name, ovm_component parent);
super.new(name, parent);
endfunction : new
function void build();
super.build();
pbist_agent = PbistAgent::type_id::create(“pbist_agent”, this);
pbist_scoreboard = PbistScoreboard::type_id::create(“pbist_scoreboard”, this);
endfunction : build
.
.
.
Using ncvlog 08.20-s009.
Thanks!
Pat