module feq (clk,rst_n,clk100);
input clk,rst_n;
output clk100;
reg clk100;
reg [6:0] cnt;
always@(posedge clk)
begin
if(!rst_n)
begin
cnt<=7'b0;
clk100<=1'b0;
end
else
if(cnt==49)
begin
cnt<=7'b0;
clk100<=~clk100;
end
else
begin
clk100<=clk100;
cnt<=cnt+1;
end
end
endmodule
Warning (10230): Verilog HDL assignment warning at feq.v(22): truncated value with size 32 to match size of target (7)
Warning: No exact pin location assignment(s) for 3 pins of 3 total pins
Info: Pin clk100 not assigned to an exact location on the device
Info: Pin rst_n not assigned to an exact location on the device
Info: Pin clk not assigned to an exact location on the device
Warning: Found 1 output pins without output pin load capacitance assignment
Info: Pin "clk100" has no specified output pin load capacitance -- assuming default load capacitance of 0 pF for timing analysis
Warning: Found pins functioning as undefined clocks and/or memory enables
Info: Assuming node "clk" is an undefined clock
此帖出自
小平头技术问答
第一个问题:verilog中一个整数默认是32位的,但是你的cnt是7位宽的,这两个相加就有位宽不匹配的警告,改为cnt<=cnt+7'b1就可以了
第二个问题:ALTERA器件的输出口是可以设电容值的,如果你不设置就默认为0,一般都不用设置,除了在高速电路或者特殊应用电路中应用
一周热门 更多>