Verilog hdl望前辈指点
时间:10-02
整理:3721RD
点击:
下面这个简单四次分频代码编译通过,但是仿真进行到49%就卡住的样子提示"option to preserve fewer signal
transition s to reduce memory requirements is enable d"求大神指点:
module fenping(clockin,clockout);//分频
input clockin;
output reg clockout;
reg [9:0]count0,count1,count2,count3;
reg clockout1;
reg clockout2;
reg clockout3;
parameter N=24;//改变N的值可以显示任意偶分频parameter M=49;//改变M的值可以显示任意偶分频always@(posedge clockin)//clockin上升沿触发
begin
if(count0==N)
begin
count0<=3'b000;
clockout1<=~clockout1;
end
else
count0<=count0+3'b001;
end
always@(posedge clockout1)
begin
if(count1==M)
begin
count1<=3'b000;
clockout2<=~clockout2;
end
else
count1<=count1+3'b001;
end
always@(posedge clockout2)
begin
if(count2==M)
begin count2<=3'b000;
clockout3<=~clockout3;
end
else
count2<=count2+3'b001;
end
always@(posedge clockout3)
begin
if(count3==M)
begin count3<=3'b000;
clockout<=~clockout;
end
else
count3<=count3+3'b001;
endendmodule
transition s to reduce memory requirements is enable d"求大神指点:
module fenping(clockin,clockout);//分频
input clockin;
output reg clockout;
reg [9:0]count0,count1,count2,count3;
reg clockout1;
reg clockout2;
reg clockout3;
parameter N=24;//改变N的值可以显示任意偶分频parameter M=49;//改变M的值可以显示任意偶分频always@(posedge clockin)//clockin上升沿触发
begin
if(count0==N)
begin
count0<=3'b000;
clockout1<=~clockout1;
end
else
count0<=count0+3'b001;
end
always@(posedge clockout1)
begin
if(count1==M)
begin
count1<=3'b000;
clockout2<=~clockout2;
end
else
count1<=count1+3'b001;
end
always@(posedge clockout2)
begin
if(count2==M)
begin count2<=3'b000;
clockout3<=~clockout3;
end
else
count2<=count2+3'b001;
end
always@(posedge clockout3)
begin
if(count3==M)
begin count3<=3'b000;
clockout<=~clockout;
end
else
count3<=count3+3'b001;
endendmodule