P
PatC
Guest
Hi folks,
A friend of mine wrote some component that includes an enable
construct that I haven't seen before. We discussed it and he swears that
it's legal code. Simulation and synthesis don't report any issues with
it, but now a functional issue came up in hw and it could be related to
this.
Paraphrasing, the code is similar to this:
process (reset, clk)
begin
if (reset = '1') then
state <= idle;
elsif (rising_edge(clk) and hold = '0') then
case (state) is
when idle => ...
when write => ...
end case
end if;
end process
Here, the /hold/ signal acts as an enable. Is this legal or should it
be recoded as a nested if?
Now that I look at it again, in case it's legal, shouldn't /hold/
need to be in the sensitivity list?
Thanks in advance,
-Pat
A friend of mine wrote some component that includes an enable
construct that I haven't seen before. We discussed it and he swears that
it's legal code. Simulation and synthesis don't report any issues with
it, but now a functional issue came up in hw and it could be related to
this.
Paraphrasing, the code is similar to this:
process (reset, clk)
begin
if (reset = '1') then
state <= idle;
elsif (rising_edge(clk) and hold = '0') then
case (state) is
when idle => ...
when write => ...
end case
end if;
end process
Here, the /hold/ signal acts as an enable. Is this legal or should it
be recoded as a nested if?
Now that I look at it again, in case it's legal, shouldn't /hold/
need to be in the sensitivity list?
Thanks in advance,
-Pat