- UID
- 811915
- 性别
- 女
- 来自
- 石家庄
|
下面是我写的一段在xilinx sparten 3e板 的lcd上显示字符的程序,可是下载的时候总是出现下面的问题,也不知道程序到底什么地方不对,请各位大侠多多指教,谢谢啦!
module lcd(clk,reset,lcd_rs,lcd_rw,lcd_en,data);
input clk,reset;
output lcd_rs,lcd_rw,lcd_en;
output[3:0] data;
reg [3:0] data;
reg lcd_rs,lcd_rw,lcd_en;
reg[3:0] state;
parameter write_instr='h1,write_dataup4_1='h2,write_datadown4_1='h3,set_ddramaddup='h4,set_ddramadddown='h5,write_dataup4_2='h6,write_datadown4_2='h7;
reg [7:0]myramup[39:0];
reg [7:0]myramdown[39:0];
reg lcd_clk;
reg[39:0]datacnt;
reg [32:0] n;
initial begin
lcd_clk<=0;
datacnt<=0;
lcd_rw<=0;
lcd_en<=lcd_clk;
n=0;
end
initial begin
{myramup[0],myramup[1],myramup[2],myramup[3],myramup[4],myramup[5],myramup[6],myramup[7],myramup[8],myramup[9],myramup[10],myramup[11],myramup[12],myramup[13],myramup[14],myramup[15],myramup[16],myramup[17],myramup[18],myramup[19],myramup[20],myramup[21],myramup[22],myramup[23],myramup[24],myramup[25],myramup[26],myramup[27],myramup[28],myramup[29],myramup[30],myramup[31],myramup[32],myramup[33],myramup[34],myramup[35],myramup[36],myramup[37],myramup[38],myramup[39]}="320'h4c6174792049204c6f766520596f7520466f72657665722021202032303037b039b03230202020";
{myramdown[0],myramdown[1],myramdown[2],myramdown[3],myramdown[4],myramdown[5],myramdown[6],myramdown[7],myramdown[8],myramdown[9],myramdown[10],myramdown[11],myramdown[12],myramdown[13],myramdown[14],myramdown[15],myramdown[16],myramdown[17],myramdown[18],myramdown[19],myramdown[20],myramdown[21],myramdown[22],myramdown[23],myramdown[24],myramdown[25],myramdown[26],myramdown[27],myramdown[28],myramdown[29],myramdown[30],myramdown[31],myramdown[32],myramdown[33],myramdown[34],myramdown[35],myramdown[36],myramdown[37],myramdown[38],myramdown[39]}=320'h4d6572727920546865204d6964b0617574756d6e2044617920212020546875727364617920202020;
end
always @(posedge clk)
begin
if(n<7999999)
n=n+1;
else
begin
n=0;
lcd_clk=~lcd_clk;
end
end
always @(posedge lcd_clk or negedge reset)
begin
if(reset==0)
begin
state=write_instr;
lcd_rs=0;
end
else
begin
case (state)
write_instr:
begin
lcd_rs=0;
case (datacnt)
0:
begin
data=0011;
datacnt=datacnt+1;
end
1:
begin
data=0011;
datacnt=datacnt+1;
end
2:
begin
data=0011;
datacnt=datacnt+1;
end
3:
begin
data=0010;
datacnt=datacnt+1;
end
4:
begin
data=0010;
datacnt=datacnt+1;
end
5:
begin
data=1000;
datacnt=datacnt+1;
end
6:
begin
data=0000;
datacnt=datacnt+1;
end
7:
begin
data=0111;
datacnt=datacnt+1;
end
8:
begin
data=0000;
datacnt=datacnt+1;
end
9:
begin
data=1100;
datacnt=datacnt+1;
end
10:
begin
data=1000;
datacnt=datacnt+1;
end
default:
begin
datacnt=0;
state=write_dataup4_1;
end
endcase
end
write_dataup4_1:
begin
lcd_rs=1;
data={myramup[datacnt][7],myramup[datacnt][6],myramup[datacnt][5],myramup[datacnt][4]};
state=write_datadown4_1;
end
write_datadown4_1:
begin
if(datacnt==39)
begin
data=myramup[datacnt][3:0];
datacnt=0;
state=set_ddramaddup;
end
else
begin
data=myramup[datacnt][3:0];
datacnt=datacnt+1;
state=write_dataup4_1;
end
end
set_ddramaddup:
begin
lcd_rs=0;
data=1100;
state=set_ddramadddown;
end
set_ddramadddown:
begin
data=0000;
state=write_dataup4_2;
end
write_dataup4_2:
begin
lcd_rs=1;
data={myramdown[datacnt][7],myramdown[datacnt][6],myramdown[datacnt][5],myramdown[datacnt][4]};
state=write_datadown4_2;
end
write_datadown4_2:
begin
if(datacnt==39)
begin
data=myramdown[datacnt][3:0];
datacnt=0;
state=write_dataup4_1;
end
else
begin
data=myramdown[datacnt][3:0];
datacnt=datacnt+1;
state=write_dataup4_2;
end
end
default:
state=write_instr;
endcase
end
end
endmodule
我用xilinx sparten 3e在往板子上下载程序时。总是出现以下错误。那位大侠知道原因和解决方法呀!请多多指教啊!
ERRORphysDesignRules:368 - The signal <lcd_en_OBUF> is incomplete. The signal
ERRORphysDesignRules:368 - The signal <lcd_rw_OBUF> is incomplete. The signal
ERRORphysDesignRules:10 - The network <lcd_en_OBUF> is completely unrouted.
ERRORphysDesignRules:10 - The network <lcd_rw_OBUF> is completely unrouted.
ERROR:Bitgen:25 - DRC detected 4 errors and 0 warnings. |
|