VERILOG仿真出现的问题
用MAXPLUS2仿真是出现下列警告:
Warningroject does not contain buried node 'temp24.Q'
Warningroject does not contain buried node 'temp23.Q'
Warningroject does not contain buried node 'temp22.Q'
Warning:Project does not contain buried node 'temp21.Q'
Warning:Project does not contain buried node 'temp20.Q'
(我在程序中定义了 reg [4:0] temp1,temp2;)
请问上列是什么原因造成的?望高人速答,谢谢!
VERILOG仿真出现的问题
你定义的是 temp1,temp2 而不是temp21,temp22... 是不是错了
VERILOG仿真出现的问题
但是,我后面用的时候都是temp1,temp2为一个5位的变量来用的,并没有分开一位位的用。
VERILOG仿真出现的问题
而且为什么temp1也是同样的用法,就不会出现这种情况?
VERILOG仿真出现的问题
source code写的不对吧?
你是怎么写的?
VERILOG仿真出现的问题
斑主帮我看一下这个用法哪里出了错吧,非常感激了>。>
module pingpong(clock,reset,transa,transb,recepta,receptb,posa,posb,marka,markb,way);
input clock,reset,transa,transb,recepta,receptb;
output posa,posb,marka,markb,way;
reg [3:0] posa,marka,markb;
wire [3:0] posb;
reg [4:0] state,temp1,temp2;
reg [7:0] way;
parameter s0=1,s1=2,s2=4,s3=8,s4=16;
always @(posedge clock)
begin
if(reset) state=s0;
else
begin
case(state)
s0: begin
if(transa) state=s1;
else if(transb) state=s2;
end
s1:begin
if((posa==8)&&(!receptb)) state=s3;
else if((posa==8)&&receptb) state=s2;
else if((posa!=8)&&receptb) state=s3;
end
s2:begin
if((posa==1)&&(!recepta)) state=s4;
else if((posa==1)&&recepta) state=s1;
else if((posa!=1)&&recepta) state=s4;
end
s3:if(transa) state=s1;
s4:if(transb) state=s2;
endcase
end
end
assign posb=posa;
always @(posedge clock)
begin
if(reset)
begin
temp1=0;
temp2=0;
posa=0;
way=0;
marka=0;
markb=0;
end
else
begin
temp2=temp1;
temp1=state;
if(temp1!=temp2)
begin
case(temp1)
s1:begin
if((temp2==s2)&&(temp1==s1)) begin posa=2;way=64; end
else begin posa=1; way=128;end
end
s2:begin
if((temp2==s1)&&(temp1==s2)) begin posa=7;way=2; end
else begin posa=8;way=1;end
end
s3:begin marka=marka+1;way=0;posa=0;end
s4:begin markb=markb+1;way=0;posa=0;end
endcase
end
else if(state==s1) begin posa=posa+1;way=way>>1;end
else if(state==s2) begin posa=posa-1;way=way<<1;end
end
end
endmodule
VERILOG仿真出现的问题
因为时间关系,我不能仔细分析,但我觉得你的代码风格不好。
1. 状态机的写法不好,一般状态机应该写成两部分:组合逻辑部分和时序逻辑部分
2.在时序逻辑里,最好用阻塞符值“<=”而不应该用非阻塞符值“=“
要改你先改一下符值“<=”试试吧
VERILOG仿真出现的问题
好的,非常感谢斑主了。
VERILOG仿真出现的问题
程序很不合规范,问题多多。
代码给点注释吧!看了头大
