boardlanguage
Full Member level 1
I've tried to initialize a union (in Modelsim 6.2f SE) , but it's not working.
I want the union to initialize to '0' (instead of 'X'.) I can't use a 2-state base-type (bit), because the union must be capable of capturing 4-state ('X') values.
/*
COMPILER ERROR: Illegal assignment of structural literals to union
*/
Is there a way to initialize a union?[/code]
I want the union to initialize to '0' (instead of 'X'.) I can't use a 2-state base-type (bit), because the union must be capable of capturing 4-state ('X') values.
Code:
typedef union packed {
logic blah7;
logic blah6;
logic blah5;
logic blah4;
} t_myunion;
t_myunion foo = { default:0 };
COMPILER ERROR: Illegal assignment of structural literals to union
*/
Is there a way to initialize a union?[/code]