|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2014-4-18 15:15:59
|
显示全部楼层
不好意思。。。刚刚没贴全,完整的程序是这样的:
always @ ( posedge CLK_100Mhz or negedge RSTn )
if( !RSTn )
begin
i <= 1;
C1 <= 29'd0;
x <= 5'd1;
y <= 5'd1;
rData <= 16'd0;
rBRC <= 22'd0;
rLED <= 4'd0;
isWrite <= 1'b0;
isRead <= 1'b0;
end
else if(!Busy_Sig)
case(i)
1:if(y==16) begin y<=5'd0;i<=2;end
else if( Done_Sig ) begin y<=y+1'b1; isWrite <= 1'b0;end
else begin isWrite <= 1'b1; rData <=y ; rBRC <= y;end
2:
if( x == 16 ) begin x <= 5'd0; i <= 1; end
else if( Done_Sig ) begin rLED <= RdData[3:0]; x <= x + 1'b1; isRead <= 1'b0; end
else begin isRead <= 1'b1; rBRC <= cntt; end
endcase
|
|