kumarswamy.hl
Newbie level 2
- Joined
- Jul 27, 2013
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 38
Hi all,
Can you please help me to clear the following warnings....
WARNIG:Xst:737 - Found 1-bit latch for signal <$old_fsm/1/fsm_enable_misr_2>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <$old_fsm/1/fsm_enable_lfsr_3>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 3-bit latch for signal <$old_fsm/1/fsm_NEXT_STATE_5>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
Code:
module BIST_controller(input test_mode,input clk,input reset,input lfsr_ready,input bist_run,
input bist_done,output enable_lfsr,output mux_sel,output enable_misr,
output enable_misr_28_bit
);
//Internal FSM state declarations
wire [1:0] NEXT_STATE;
reg [1:0] PRES_STATE = 2'b00;
//State encodings
parameter s0 = 2'b00;//Normal mode
parameter s1 = 2'b01;//Enable
parameter s2 = 2'b10;//BIST_RUN
parameter s3 = 2'b11;//BIST_DONE
//Combinational logic
function [5:0] fsm;
input fsm_test_mode,fsm_reset,fsm_lfsr_ready,fsm_bist_run,fsm_bist_done;
input [1:0] fsm_PRES_STATE;
reg fsm_enable_lfsr;
reg fsm_mux_sel,fsm_enable_misr,fsm_enable_misr_28_bit;
reg [1:0] fsm_NEXT_STATE;
begin
case (fsm_PRES_STATE)
s0:// state = s0 -> Normal mode
begin
if((fsm_reset) && (fsm_test_mode) && (fsm_bist_done))
begin
fsm_enable_lfsr = 1'b1;
fsm_mux_sel = 1'b1;
fsm_NEXT_STATE = s1;
end
else
begin
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_NEXT_STATE = s0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
end
end
s1: //state s1 -> BIST Enable
begin
if(fsm_test_mode && fsm_reset && fsm_lfsr_ready)
begin
fsm_enable_misr = 1'b1;
fsm_enable_misr_28_bit = 1'b1;
fsm_NEXT_STATE = s2;
end
else
begin
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
fsm_NEXT_STATE = s0;
end
end
s2:// state s2 -> BIST_RUN
begin
if(fsm_test_mode && fsm_reset && !fsm_bist_run)
begin
fsm_NEXT_STATE = s3;
end
else if (fsm_bist_run)
begin
fsm_NEXT_STATE = s2;
end
else
begin
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
fsm_NEXT_STATE = s0;
end
end
s3: // state s3 -> BIST_DONE
begin
if (fsm_test_mode == 1'b1 && fsm_reset == 1'b1 && fsm_bist_done == 1'b1)
begin
fsm_NEXT_STATE = s0;
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
end
else
fsm_NEXT_STATE = s3;
end
endcase
fsm = {fsm_mux_sel,fsm_enable_misr,fsm_enable_lfsr,fsm_enable_misr_28_bit,fsm_NEXT_STATE};
end
endfunction
//Reevaluate combinational logic
assign {mux_sel,enable_misr,enable_lfsr,enable_misr_28_bit,NEXT_STATE} = fsm(test_mode,reset,lfsr_ready,
bist_run,bist_done,PRES_STATE);
// clock the state flipflops
// use synchronous reset
always@(negedge clk or negedge reset)
begin
if(reset == 1'b0)
PRES_STATE <= s0;
else
PRES_STATE <= NEXT_STATE;
end
endmodule
Can you please help me to clear the following warnings....
WARNIG:Xst:737 - Found 1-bit latch for signal <$old_fsm/1/fsm_enable_misr_2>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 1-bit latch for signal <$old_fsm/1/fsm_enable_lfsr_3>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
WARNING:Xst:737 - Found 3-bit latch for signal <$old_fsm/1/fsm_NEXT_STATE_5>. Latches may be generated from incomplete case or if statements. We do not recommend the use of latches in FPGA/CPLD designs, as they may lead to timing problems.
Code:
module BIST_controller(input test_mode,input clk,input reset,input lfsr_ready,input bist_run,
input bist_done,output enable_lfsr,output mux_sel,output enable_misr,
output enable_misr_28_bit
);
//Internal FSM state declarations
wire [1:0] NEXT_STATE;
reg [1:0] PRES_STATE = 2'b00;
//State encodings
parameter s0 = 2'b00;//Normal mode
parameter s1 = 2'b01;//Enable
parameter s2 = 2'b10;//BIST_RUN
parameter s3 = 2'b11;//BIST_DONE
//Combinational logic
function [5:0] fsm;
input fsm_test_mode,fsm_reset,fsm_lfsr_ready,fsm_bist_run,fsm_bist_done;
input [1:0] fsm_PRES_STATE;
reg fsm_enable_lfsr;
reg fsm_mux_sel,fsm_enable_misr,fsm_enable_misr_28_bit;
reg [1:0] fsm_NEXT_STATE;
begin
case (fsm_PRES_STATE)
s0:// state = s0 -> Normal mode
begin
if((fsm_reset) && (fsm_test_mode) && (fsm_bist_done))
begin
fsm_enable_lfsr = 1'b1;
fsm_mux_sel = 1'b1;
fsm_NEXT_STATE = s1;
end
else
begin
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_NEXT_STATE = s0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
end
end
s1: //state s1 -> BIST Enable
begin
if(fsm_test_mode && fsm_reset && fsm_lfsr_ready)
begin
fsm_enable_misr = 1'b1;
fsm_enable_misr_28_bit = 1'b1;
fsm_NEXT_STATE = s2;
end
else
begin
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
fsm_NEXT_STATE = s0;
end
end
s2:// state s2 -> BIST_RUN
begin
if(fsm_test_mode && fsm_reset && !fsm_bist_run)
begin
fsm_NEXT_STATE = s3;
end
else if (fsm_bist_run)
begin
fsm_NEXT_STATE = s2;
end
else
begin
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
fsm_NEXT_STATE = s0;
end
end
s3: // state s3 -> BIST_DONE
begin
if (fsm_test_mode == 1'b1 && fsm_reset == 1'b1 && fsm_bist_done == 1'b1)
begin
fsm_NEXT_STATE = s0;
fsm_enable_lfsr = 1'b0;
fsm_mux_sel = 1'b0;
fsm_enable_misr = 1'b0;
fsm_enable_misr_28_bit = 1'b0;
end
else
fsm_NEXT_STATE = s3;
end
endcase
fsm = {fsm_mux_sel,fsm_enable_misr,fsm_enable_lfsr,fsm_enable_misr_28_bit,fsm_NEXT_STATE};
end
endfunction
//Reevaluate combinational logic
assign {mux_sel,enable_misr,enable_lfsr,enable_misr_28_bit,NEXT_STATE} = fsm(test_mode,reset,lfsr_ready,
bist_run,bist_done,PRES_STATE);
// clock the state flipflops
// use synchronous reset
always@(negedge clk or negedge reset)
begin
if(reset == 1'b0)
PRES_STATE <= s0;
else
PRES_STATE <= NEXT_STATE;
end
endmodule