yigeren0405 发表于 2011-6-25 11:26:55

分频器实现流水灯

小弟想利用带参数的分频器实现流水灯,分频器输出作为流水灯模块的输入,可是为什么调用时,如果分频系数设为很大,比如2000时,出现一堆下面这样的警告,仿真不出正确的结果,为什么呢?
module clk_div(clk,cout);
parameter div_param=0;
input clk;
output cout;
reg cout;
reg cnt;
always@(posedge clk)
begin
cnt<=cnt+1;
if(cnt==div_param) begin cout<=~cout;cnt<=0;end
end
endmodule
流水灯模块:
module LED(clk,led,clkin);
input clk;
output led;
output clkin;
reg led;
reg cnt;
clk_div #(0) U1(.clk(clk),.cout(clkin));//调用
always@(posedge clkin)
        begin
        led=led>>1;
        cnt<=cnt+8'h01;
        if(cnt==2)
                begin led=3'b100;cnt<=0;end
        end
endmodule
警告:
Warning (10034): Output port "cout" at clk_div.v(4) has no driver
Warning: No clock transition on "led~reg0" register due to stuck clock or clock enable
Warning: Reduced register "led~reg0" with stuck clock port to stuck value GND
好多这样的警告,为什么啊?
页: [1]
查看完整版本: 分频器实现流水灯