Forum Discussion
Altera_Forum
Honored Contributor
11 years agoProblem fixed, just to share ( not optimized ):
--- Quote Start --- type declaration typedef struct packed {
reg Level_main ;
reg Level_sub ;
} FSM ;
typedef struct packed {
bit Level_main_t ;
bit Level_sub_t ;
} FSM_t ; variable declaration FSM_t tempCurrentState ; // State machine index ( temporary )
FSM CurrentState ; // State machine index ( current ) function declaration function FSM_t next_state( input logic valStateBefore , input logic valSubstateBefore );
FSM_t next_state_return ;
...
return next_state_return ;
endfunction function call CurrentState <= next_state ( CurrentState.Level_main , CurrentState.Level_sub ) ; --- Quote End --- Thanks for your help. Andre