新手求助版主:再问一个弱的问题
process(clock)
begin
if clock'event and clock='1' then
if gnt0='0' then
if frame_rise='1' then
a<=b;
else
a<='1';
end if;
end if;
end if;
end process ;
Error: Can't resolve multiple constant drivers for net "a" at wc.vhd(136)
拜托!急求能人指点
process(clock,gnt0,frame_rise,b)
begin
if clock'event and clock='1' then
if gnt0='0' then
if frame_rise='1' and b='0'then
a<='0';
else
a<='1';
end if;
end if;
end if;
end process ;
Error: Can't resolve multiple constant drivers for net "a" at wc.vhd(136)
谢谢!小编
小编,我按照你说的方法修改了,为什么还会出现同样的错误提示,如果一个信号有多个触发源的话,该怎样编写程序。拜托!急!
单看你的代码,没有什么问题。报告提示是多源驱动问题,可能在不同的进程中操作了a net
你把完整的程序贴出来
问题可能在其他地方
这是完整的程序,我想完成的功能是:当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;
signaldataout_rise0,dataout_rise1,dataout_rise2,dataout_rise3,dataout_rise4,dataout_rise5: std_logic;
signalframe0:std_logic;
signalframe_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;
你在多个process中对同一信号进行操作,多源驱动。VHDL不能直接支持。
能帮我看看应该怎么编吗?
那我遇到的问题该怎样解决?拜托!
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;
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;
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;
把3个进程合并就是了
process(clock,dataout_rise0,gnt0,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='1' or dataout_rise0='1' ) then
req10<='1';
elsif(gnt0='0' and frame_rise='1')then
req10<=req0;
end if;
end if;
end process ;
太感谢小编了!
小编:不好意思又问你一个弱的问题。还是那段程序如果我想实现以下功能,在原有得程序上怎么修改?
在reset=0时req10置1,在reset=1时req10采样req0(低电平有效),等到dataout_rise0=1时
req10置1(dataout_rise0=1在req10采样了req0的低电平以后才会出现),到gnt0=0与 frame_rise=1时(gnt0=0与 frame_rise=1在dataout_rise0=1以后才会出现)才恢复req10采样req0。也就是说:先在reset=1时req10采样req0,等到dataout_rise0=1时req10置1(req10不采样req0),到gnt0=0与 frame_rise=1时才恢复req10采样req0。
拜托!
process(clock,dataout_rise0,gnt0,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='1' or dataout_rise0='1' ) then
req10<='1';
elsif(gnt0='0' and frame_rise='1')then
req10<=req0;
end if;
end if;
end process ;
下面是修改后的程序和功能仿真图
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;
signaldataout_rise0,dataout_rise1,dataout_rise2,dataout_rise3,dataout_rise4,dataout_rise5: std_logic;
signalframe0:std_logic;
signalframe_rise:std_logic;
BEGIN
p1:process(clock,dataout_rise0,gnt0,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise0='1' ) then
req10<='1';
elsif(reset='1' or (gnt0='0' and frame_rise='1'))then
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,dataout_rise1,gnt1,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise1='1' ) then
req11<='1';
elsif(reset='1' or (gnt1='0' and frame_rise='1'))then
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,dataout_rise2,gnt2,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise2='1' ) then
req12<='1';
elsif(reset='1' or (gnt2='0' and frame_rise='1'))then
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,dataout_rise3,gnt3,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise3='1' ) then
req13<='1';
elsif(reset='1' or (gnt3='0' and frame_rise='1'))then
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,dataout_rise4,gnt4,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise4='1' ) then
req14<='1';
elsif(reset='1' or (gnt4='0' and frame_rise='1'))then
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,dataout_rise5,gnt5,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise5='1' ) then
req15<='1';
elsif(reset='1' or (gnt5='0' and frame_rise='1'))then
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';
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';
END a;
功能图中,我想要当dataout1产生下降沿时,req11一直置1,直到gnt1=0,frame下降沿时才恢复对req1的采样。但在功能图中不知为什么当dataout1产生下降沿时,req11只有一个时钟周期的1。
jpg
刚才的图没有传上去
bmp
好象功能图还是没有发上
小编,再帮帮我好吗?拜托!
小编,拜托了
哪位高人给点意见啊!拜托!
把.bmp文件打开,然后另存为.jepg文件,文件size就会变小很多。
偶们浏览网页的时候打开得也快些
各位高人请指点。还是那段程序如果我想实现以下功能,在原有得程序上怎么修改?在reset=0时req10置1,在reset=1时req10采样req0(低电平有效),等到dataout_rise0=1时req10置1(dataout_rise0=1在req10采样了req0的低电平以后才会出现),到gnt0=0与 frame_rise=1时(gnt0=0与 frame_rise=1在dataout_rise0=1以后才会出现)才恢复req10采样req0。也就是说:先在reset=1时req10采样req0,等到dataout_rise0=1时req10置1(req10不采样req0),到gnt0=0与 frame_rise=1时才恢复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;
signaldataout_rise0,dataout_rise1,dataout_rise2,dataout_rise3,dataout_rise4,dataout_rise5: std_logic;
signalframe0:std_logic;
signalframe_rise:std_logic;
BEGIN
p1:process(clock,dataout_rise0,gnt0,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise0='1' ) then
req10<='1';
elsif(reset='1' or (gnt0='0' and frame_rise='1'))then
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,dataout_rise1,gnt1,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise1='1' ) then
req11<='1';
elsif(reset='1' or (gnt1='0' and frame_rise='1'))then
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,dataout_rise2,gnt2,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise2='1' ) then
req12<='1';
elsif(reset='1' or (gnt2='0' and frame_rise='1'))then
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,dataout_rise3,gnt3,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise3='1' ) then
req13<='1';
elsif(reset='1' or (gnt3='0' and frame_rise='1'))then
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,dataout_rise4,gnt4,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise4='1' ) then
req14<='1';
elsif(reset='1' or (gnt4='0' and frame_rise='1'))then
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,dataout_rise5,gnt5,frame_rise,reset)
begin
if clock'event and clock='1' then
if(reset='0' or dataout_rise5='1' ) then
req15<='1';
elsif(reset='1' or (gnt5='0' and frame_rise='1'))then
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';
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';
END a;
功能图中,我想要当dataout1产生下降沿时,req11一直置1,直到gnt1=0,frame下降沿时才恢复对req1的采样。但在功能图中不知为什么当dataout1产生下降沿时,req11只保持一个时钟周期的1。
jpg
各位大侠,帮帮忙吧,谢谢!