按照FPGA视频上所讲的例子做了一个序列检测11101的状态机程序,在.do文件中使用了virtual type,但是在仿真波形中new_state变量少了s5 和s6 两个状态,这是怎么回事,弄了半天弄不明白,求帮助
virtual type {
{01 S1}
{02 S2}
{04 S3}
{08 S4}
{10 S5}
{20 S6}
} vir_new_signal
状态机如下:
parameter s1=6'b00_0001;
parameter s2=6'b00_0010;
parameter s3=6'b00_0100;
parameter s4=6'b00_1000;
parameter s5=6'b01_0000;
parameter s6=6'b10_0000;
reg [5:0] Curr_st;
always @(posedge sclk,negedge rst_n)
if(rst_n == 1'b0)
Curr_st <= s1;
else
case(Curr_st)
s1:if(A == 1'b1)
Curr_st <= s2;
else
Curr_st <= s1;
s2:if(A == 1'b1)
Curr_st <= s3;
else
Curr_st <= s1;
s3:if(A == 1'b1)
Curr_st <= s4;
else
Curr_st <= s1;
s4:if(A == 1'b0)
Curr_st <= s5;
s5:if(A == 1'b1)
Curr_st <= s6;
else
Curr_st <= s1;
s6: Curr_st <= s1;
default:Curr_st <= s1;
endcase
|