V
valentin tihomirov
Guest
Is it a good style to write code like the following
process (CLK, Reset)
variable RegNext: STD_LOGIC;
begin
-- comb part
RegNext := calculate();
-- reg part
if Reset = '1' then
RegNext <= '0';
elsif CLK'event and CLK = '1' then
REG <= RegNext;
end if;
end.
????
I've asked this question to myself trying to define the sensetivity list and
type (signal vs. variable) of RegNext value. This style would allow for
combining related logic into one process rather than divide one process into
comb and reg declaring lots ot specific signals at architecture scope.
process (CLK, Reset)
variable RegNext: STD_LOGIC;
begin
-- comb part
RegNext := calculate();
-- reg part
if Reset = '1' then
RegNext <= '0';
elsif CLK'event and CLK = '1' then
REG <= RegNext;
end if;
end.
????
I've asked this question to myself trying to define the sensetivity list and
type (signal vs. variable) of RegNext value. This style would allow for
combining related logic into one process rather than divide one process into
comb and reg declaring lots ot specific signals at architecture scope.