|
module rx_flame(
input clk,
input rdsig, //串口接收数据有效信号
input [7:0] rxdata, //串口接收数据
output [3:0] ledctr //LED控制
);
reg[3:0] sync_state = 4'h0;
reg[7:0] rxcounter = 8'h0; // 接收字符串计数
reg[3:0] ledctr = 4'hf;
reg [7:0] rxstore[99:0]; //存储接受字符
//--------------internal signal declarration----------
parameter IDLE=4'h0,
SYNC_HEAD=4'h1,
LAOD_DATA_0=4'h2,
LAOD_DATA_1=4'h3,
SYNC_END=4'h4;
always@(posedge clk)
case (sync_state)
IDLE:
begin
ledctr <= 4'b1111;
rxcounter <= 4'h0;
end
SYNC_HEAD:
begin
if(rxstore[0] == 8'hb1) //加上这一行就报错.
ledctr <= 4'b1110;
end
LAOD_DATA_0:
begin
;
end
SYNC_END:
begin
ledctr <= 4'h0;
end
default: ;
endcase
always@(posedge clk)
if(rdsig)
case(sync_state)
IDLE: if(rxdata == 8'hee )
sync_state <= SYNC_HEAD;
SYNC_HEAD:
if(rxdata == 8'hff )
sync_state <= SYNC_END;
else
begin
if(rxcounter == 0)
begin
rxstore[0] <=rxdata;
rxcounter <= rxcounter+ 1'b1;
end
else if(rxcounter == 1)
begin
rxstore[1] <=rxdata;
rxcounter <= rxcounter+ 1'b1;
end
else ;
end
SYNC_END: ;
default:;
endcase
else ;
endmodule
加上这一行就报错,该怎么改?
报错信息是这个
Line 44: Signal rxcounter[7] in unit rx_flame is connected to following multiple drivers: |
阿莫论坛20周年了!感谢大家的支持与爱护!!
月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!
|