Use of struct inside a task

hello,
i am writing my UVM scoreboard.
i want to get device configurations and encapsulate them inside a device_global_cfg_t like so:

typedef struct {
bit a;
bit b;
bit c;
bit d;
int e;
bit f;
}device_global_cfg_t;

when i declare a struct veriable using this typedef:

virtual task device_actions(tti2fcu_data_c txn);
fcu_global_cfg_t fcu_global_cfg = get_configurations ();

//  // assign the expected fields of output item
//  // send expected item to cmpr

endtask : device_actions

i get the following ERROR:

0.00 VCS ERROR: SE (fc): Syntax error Following verilog source has syntax error : “yakovy/UVM/SIMULATIONS/Testplan/UL_tests/mem_test/user_link_dir/scoreboard_c.sv”, 219: token is ‘fcu_global_cfg’ fcu_global_cfg_t fcu_global_cfg = get_configurations (); ^ (in ActVCSPostProcess.pm:368)

any idea why?

thanks, Kobi.

In reply to kobiyonai:

i tried to declare the struct outside the “task device_actions” - an the ERROR was gone.
i can’t declare structs inside tasks?

thanks.

The type you declared is device_global_cfg_t, yet the variable you tried to declare has the type fcu_global_cfg_t.

thanks,
it didn’t helped when I changed device → fcu.

Kobi.