|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
module Sample(EN,Reset,over,CLK,EOC_AD,fin,AD_Start);
input EN,Reset,EOC_AD,CLK,fin;
output AD_Start,over;
reg AD_Start;
reg over;
reg sampling;
reg[7:0] Fin_cnt;
reg[7:0] delt_cnt1;
reg[7:0] delt_cnt2;
always @(posedge fin)
begin
if(Reset==1||EN==0)
begin
Fin_cnt<=0;
delt_cnt1<=0;
end
if(EOC_AD==1)
begin
if(Fin_cnt==99)
begin
Fin_cnt<=0;
AD_Start=1;
sampling=1;
delt_cnt1<=delt_cnt1+1;
end
Fin_cnt<=Fin_cnt+1;
end
end
always @(posedge CLK)
begin
if(sampling==1)
if(delt_cnt2>=100)
begin
delt_cnt2<=101; //停止AD采样 直到重起信号来临
over=1; //采完100个点
end
if(delt_cnt1==delt_cnt2)
begin
AD_Start=0;
delt_cnt2<=0;
end
delt_cnt2<=delt_cnt2+1;
end
endmodule
错误如下:
Error (10028): Can't resolve multiple constant drivers for net "AD_Start" at Sample.v(18)
Error (10029): Constant driver at Sample.v(37)
Error: Can't elaborate top-level user hierarchy |
|