这是完整的程序,我想完成的功能是:当reset复位有效时req10置1;当 dataout0为下降沿时,req10不采样 req0的值,把req10置1;当gnt0为0且 frame 为下降沿时才恢复req10 对req0的采样。
拜托请帮我看看!
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY wc IS
PORT
(
clock: IN STD_LOGIC;
reset: IN STD_LOGIC;
req0,req1,req2,req3,req4,req5: IN STD_LOGIC;
dataout0,dataout1,dataout2,dataout3,dataout4,dataout5: IN STD_LOGIC;
gnt0,gnt1,gnt2,gnt3,gnt4,gnt5: IN STD_LOGIC;
frame : IN STD_LOGIC;
req10,req11,req12,req13,req14,req15: OUT STD_LOGIC
);
END wc;
ARCHITECTURE a OF wc IS
signal tmp0,tmp1,tmp2,tmp3,tmp4,tmp5: std_logic;
signal dataout_rise0,dataout_rise1,dataout_rise2,dataout_rise3,dataout_rise4,dataout_rise5: std_logic;
signal frame0:std_logic;
signal frame_rise:std_logic;
BEGIN
p1:process(clock)
begin
if clock'event and clock='1' then
if dataout_rise0='1' then
req10<='1';
else
req10<=req0;
end if;
end if;
end process p1;
p2:process(clock)
begin
if clock'event and clock='1' then
tmp0 <=dataout0;
end if;
end process p2;
dataout_rise0<='1' when (dataout0='0' and tmp0='1') else
'0';
p3:process(clock)
begin
if clock'event and clock='1' then
if dataout_rise1='1' then
req11<='1';
else
req11<=req1;
end if;
end if;
end process p3;
p4:process(clock)
begin
if clock'event and clock='1' then
tmp1 <=dataout1;
end if;
end process p4;
dataout_rise1<='1' when (dataout1='0' and tmp1='1') else
'0';
p5:process(clock)
begin
if clock'event and clock='1' then
if dataout_rise2='1' then
req12<='1';
else
req12<=req2;
end if;
end if;
end process p5;
p6:process(clock)
begin
if clock'event and clock='1' then
tmp2 <=dataout2;
end if;
end process p6;
dataout_rise2<='1' when (dataout2='0' and tmp2='1') else
'0';
p7:process(clock)
begin
if clock'event and clock='1' then
if dataout_rise3='1' then
req13<='1';
else
req13<=req3;
end if;
end if;
end process p7;
p8:process(clock)
begin
if clock'event and clock='1' then
tmp3 <=dataout3;
end if;
end process p8;
dataout_rise3<='1' when (dataout3='0' and tmp3='1') else
'0';
p9:process(clock)
begin
if clock'event and clock='1' then
if dataout_rise4<='1'then
req14<='1';
else
req14<=req4;
end if;
end if;
end process p9;
p10:process(clock)
begin
if clock'event and clock='1' then
tmp4 <=dataout4;
end if;
end process p10;
dataout_rise4<='1' when (dataout4='0' and tmp4='1') else
'0';
p11:process(clock)
begin
if clock'event and clock='1' then
if dataout_rise5<='1' then
req15<='1';
else
req15<=req5;
end if;
end if;
end process p11;
p12:process(clock)
begin
if clock'event and clock='1' then
tmp5 <=dataout5;
end if;
end process p12;
dataout_rise5<='1' when (dataout5='0' and tmp5='1') else
'0';
p13: process(clock,gnt0,frame_rise,req0)
begin
if clock'event and clock='1' then
if gnt0='0' then
if frame_rise='1'and req0='0' then
req10<='0';
else
req10<='1';
end if;
end if;
end if;
end process p13;
p14:process(clock)
begin
if clock'event and clock='1' then
frame0 <=frame;
end if;
end process p14;
frame_rise<='1' when (frame='0' and frame0='1') else
'0';
p15: process(clock,gnt1,frame_rise,req1)
begin
if clock'event and clock='1' then
if gnt1='0' then
if frame_rise='1' and req1='0' then
req11<='0';
else
req11<='1';
end if;
end if;
end if;
end process p15;
p16: process(clock,gnt2,frame_rise,req2)
begin
if clock'event and clock='1' then
if gnt2='0' then
if frame_rise='1' and req2='0'then
req12<='0';
else
req12<='1';
end if;
end if;
end if;
end process p16;
p17: process(clock,gnt3,frame_rise,req3)
begin
if clock'event and clock='1' then
if gnt3='0' then
if frame_rise='1' and req3='0' then
req13<='0';
else
req13<='1';
end if;
end if;
end if;
end process p17;
p18: process(clock,gnt4,frame_rise,req4)
begin
if clock'event and clock='1' then
if gnt4='0' then
if frame_rise='1' and req4='0' then
req14<='0';
else
req14<='1';
end if;
end if;
end if;
end process p18;
p19: process(clock,gnt5,frame_rise,req5)
begin
if clock'event and clock='1' then
if gnt5='0' then
if frame_rise='1' and req5='0' then
req15<='0';
else
req15<='1';
end if;
end if;
end if;
end process p19;
p20:process(clock)
begin
if clock'event and clock='1' then
if reset='0' then
req10<='1';
else
req10<=req0;
end if;
end if;
end process p20;
p21:process(clock)
begin
if clock'event and clock='1' then
if reset='0' then
req11<='1';
else
req11<=req1;
end if;
end if;
end process p21;
p22:process(clock)
begin
if clock'event and clock='1' then
if reset='0' then
req12<='1';
else
req12<=req2;
end if;
end if;
end process p22;
p23:process(clock)
begin
if clock'event and clock='1' then
if reset='0' then
req13<='1';
else
req13<=req3;
end if;
end if;
end process p23;
p24:process(clock)
begin
if clock'event and clock='1' then
if reset='0' then
req14<='1';
else
req14<=req4;
end if;
end if;
end process p24;
p25:process(clock)
begin
if clock'event and clock='1' then
if reset='0' then
req15<='1';
else
req15<=req5;
end if;
end if;
end process p25;
END a; |