signal stage1_tmp: std_logic_vector;
signal stage1_out: std_logic_vector;
...
stage1_tmp <= ADD(stage1_out,data_in);
process(CLK,RESET)
begin
if RESET='0' then
if (CLK'event and CLK='0') then
stage1_out <= stage1_tmp;
end if;
else
stage1_out <= (others=>'0');
end if;
end process;
the code is simple, but the value of stage1_tmp can not be transferred
to stage1_out. I don't know why.
thank you for your time.
harry
I think the best to write is :
process(CLK,RESET)
begin
if RESET='1' then
stage1_out <= (others=>'0');
elsif (CLK'event and CLK='0') then
stage1_out <= stage1_tmp;
end if;
end process;
"Harry Yang" <hay...@doe.carleton.ca> a écrit dans le message news:
388D0219...@doe.carleton.ca...
The only problem I can see is that stage1_tmp should be in the
sensitivity list of the process. One compiler I use will give a
warning about this, another gives no warning, but the code will not
simulate properly.
Charles.
Sent via Deja.com http://www.deja.com/
Before you buy.
> The only problem I can see is that stage1_tmp should be in the
> sensitivity list of the process. One compiler I use will give a
> warning about this, another gives no warning, but the code will not
> simulate properly.
No, that's unnecessary--it won't change the simulation one bit,
although it might make certain synthesis tools not emit a warning.
The only time stage1_tmp gets assigned is when reset='0' and clk='0'
and clk'event, independent of whether stage1_tmp has an edge on it.
So, only reset and clk need be in the sensitivity list.
Paul
--
Paul Menchini | me...@mench.com |"Outside of a dog, a book is
Cadence Design Systems | www.orcad.com | probably man's best friend, and
P.O. Box 71767 | 919-479-1670[v] | inside of a dog, it's too dark
Durham, NC 27722-1767 | 919-479-1671[f] | to read." --Groucho Marx