三: 现在得就把这个IP核给控制起来,这就像一块回做FFT运算的芯片控制得满足它的时许要求
下面给出控制状态机
//------控制状态机------------------------
parameter frame=13'd1024; //FFT采样点数
parameter Idle=3'd0,
Go=3'd1,
Assert_eop=3'd2,
Wait_state=3'd3;
reg[2:0] Current_state,
Next_state;
reg[11:0] counter,
next_counter;
always@(*) begin
case(Current_state)
Idle: begin
Next_counter<=0;
if(sk_ready) begin
Next_state<=Go;
end
else begin
Next_state<=Idle;
end
end
Go: begin
if(counter
Next_state<=Go;
Next_counter<=counter+1'b1;
end
else begin
Next_state<=Assert_eop;
Next_counter<=counter+1'b1;
end
end
Assert_eop: begin
next_counter<=0;
Next_state<=Wait_state;
end
Wait_state: begin
if(sk_ready) begin
next_counter<=0;
Next_state<=go;
end
else begin
next_counter<=counter;
Next_state<=wait_state;
end
end
endcase
end