F
Fred Bartoli
Guest
Hello,
I now have a complex behavioral model that I'm rewriting in order to make
the RTL model and I have a complex state machine (1 process SM style).
Here's an excerpt for one state :
case CellState is
when Idle =>
..
..
..
when Wait_CluTOT =>
if IsBoundaryCell = '1' then
IsHighest_TOT := true;
TOT_Out <= TOT;
if IsSigCell = '0' then
CellResolved <= '1';
end if;
CellState := Resolve_TOT;
end if;
if (ResolveCell = '1') then
if HighTOT then
IsHighest_TOT := true;
StopNextCells <= '1';
TOT_Out <= TOT;
else
TOT_Out <= TOT_In;
end if;
if IsSigCell = '0' then
CellResolved <= '1';
end if;
CellState := Resolve_TOT;
end if;
..
..
..
when...
end case;
Apart from cleaning up the code and make it maybe more readable, I'm
wondering what is the best writing style for the outputs updating :
update one output after another and duplicate conditions, and then update
the state,
or
write the conditions and duplicate the states and outputs updates, as it is
written?
Does this have an impact on the final result or does the synthesizers do a
good job of optimizing all this ?
I ask this mainly because the overall state machine is about 140 LUTs and I
have 256 of those in my design.
Any input/comments/thought appreciated.
--
Thanks,
Fred.
I now have a complex behavioral model that I'm rewriting in order to make
the RTL model and I have a complex state machine (1 process SM style).
Here's an excerpt for one state :
case CellState is
when Idle =>
..
..
..
when Wait_CluTOT =>
if IsBoundaryCell = '1' then
IsHighest_TOT := true;
TOT_Out <= TOT;
if IsSigCell = '0' then
CellResolved <= '1';
end if;
CellState := Resolve_TOT;
end if;
if (ResolveCell = '1') then
if HighTOT then
IsHighest_TOT := true;
StopNextCells <= '1';
TOT_Out <= TOT;
else
TOT_Out <= TOT_In;
end if;
if IsSigCell = '0' then
CellResolved <= '1';
end if;
CellState := Resolve_TOT;
end if;
..
..
..
when...
end case;
Apart from cleaning up the code and make it maybe more readable, I'm
wondering what is the best writing style for the outputs updating :
update one output after another and duplicate conditions, and then update
the state,
or
write the conditions and duplicate the states and outputs updates, as it is
written?
Does this have an impact on the final result or does the synthesizers do a
good job of optimizing all this ?
I ask this mainly because the overall state machine is about 140 LUTs and I
have 256 of those in my design.
Any input/comments/thought appreciated.
--
Thanks,
Fred.