A
abasili
Guest
Hi everyone I would have liked to ask you about the difference between
the two following codes:
-- case 1
process (clk, nrst)
begin
if nrst = '0' then
En <= '0';
elsif rising_edge (clk) then
case present_state is
when S0 | S1 | S2 =>
En <= '1';
when others =>
En <= '0';
end case;
end if;
end process;
-- case 2
process (clk, nrst)
begin
if nrst = '0' then
En <= '0';
elsif rising_edge (clk) then
case present_state is
when S0 =>
En <= '1';
when S1 =>
En <= '1';
when S2 =>
En <= '1';
when others =>
En <= '0';
end case;
end if;
end process;
I found this example on few references (as the VHDL Reference Manual of
Synario design automation), but when I look at the RTL produced with
Synplify then it's clear that the compiler produces something different
in the two cases.
My logic works fine (so far) and i'm using the first case but only
recently I realized about the differences and i was wondering why the
RTLs are different and whether one syntax is more convenient than the
other one. By the way I still didn't learn what's the name of that
symbol (i know is something that produce a mutually exclusive logic) and
I didn't yet find some information through Google and some books i have.
Thanks a lot for any help or reference.
Al
the two following codes:
-- case 1
process (clk, nrst)
begin
if nrst = '0' then
En <= '0';
elsif rising_edge (clk) then
case present_state is
when S0 | S1 | S2 =>
En <= '1';
when others =>
En <= '0';
end case;
end if;
end process;
-- case 2
process (clk, nrst)
begin
if nrst = '0' then
En <= '0';
elsif rising_edge (clk) then
case present_state is
when S0 =>
En <= '1';
when S1 =>
En <= '1';
when S2 =>
En <= '1';
when others =>
En <= '0';
end case;
end if;
end process;
I found this example on few references (as the VHDL Reference Manual of
Synario design automation), but when I look at the RTL produced with
Synplify then it's clear that the compiler produces something different
in the two cases.
My logic works fine (so far) and i'm using the first case but only
recently I realized about the differences and i was wondering why the
RTLs are different and whether one syntax is more convenient than the
other one. By the way I still didn't learn what's the name of that
symbol (i know is something that produce a mutually exclusive logic) and
I didn't yet find some information through Google and some books i have.
Thanks a lot for any help or reference.
Al