sixdegrees
Junior Member level 2
Can anyone tell me what is wrong with the code below?
module lcd_posedge(lcd_clk_in,clk,rst,lcd_latch);
input lcd_clk_in;
//38 hz
input clk;
//main clk
input rst;
output lcd_latch;
wire lcd_clk_in;
wire clk;
wire rst;
wire lcd_latch;
wire lcd_posedge_latch_S;
wire [1:0] edge0;
reg [1:0] edge1;
always @(negedge rst or negedge clk or negedge lcd_clk_in )
begin
if(rst == 1'b1)
begin
edge1 <= 2'b00;
end
else
begin
edge1 <= {edge1[0] ,lcd_clk_in};
end
end
assign lcd_latch = ((( ~edge1[1] )) & edge1[0] );
endmodule
Xilinx tells me the following
ERROR: Xst:898 - "lcd_posedge.v" line 28: The reset or set test condition for <edge1> is incompatible with the event declaration in the sensitivity list.
Plz suggest
module lcd_posedge(lcd_clk_in,clk,rst,lcd_latch);
input lcd_clk_in;
//38 hz
input clk;
//main clk
input rst;
output lcd_latch;
wire lcd_clk_in;
wire clk;
wire rst;
wire lcd_latch;
wire lcd_posedge_latch_S;
wire [1:0] edge0;
reg [1:0] edge1;
always @(negedge rst or negedge clk or negedge lcd_clk_in )
begin
if(rst == 1'b1)
begin
edge1 <= 2'b00;
end
else
begin
edge1 <= {edge1[0] ,lcd_clk_in};
end
end
assign lcd_latch = ((( ~edge1[1] )) & edge1[0] );
endmodule
Xilinx tells me the following
ERROR: Xst:898 - "lcd_posedge.v" line 28: The reset or set test condition for <edge1> is incompatible with the event declaration in the sensitivity list.
Plz suggest