本帖最后由 liwenz 于 2016-8-9 00:13 编辑
我把reset 名称由 RSTn 改为reset 就可以识别了。
其实也可以自己添加归类 达到同样目的,但我不知道怎么类的名字。
现在就是结果不对,全都是0.
是不是reset 有方向需要设置,比如低位复位信号。
目前显示是这样的:
data2=0, status=0,count=0
data2=0, status=0,count=0
data2=0, status=0,count=0, Rdata=0;
data2 中间输出, status 2个isEmpty, isFull. count
确实那个reset 应该设置为reset_n, 但结果还是 不怎么好
init:data2=0, status=9,count=0
data2=0, status=9,count=0
data2=0, status=9,count=0
data2=0, status=9,count=0, Rdata=0;
程序是这样的:
int main()
{
unsigned char status,Rdata,data2,count;
printf("Hello from Nios II and alter15B!\n");
data2=FIFOT->inter;
status=FIFOT->status;
count=FIFOT->count;
printf("init: data2=%x,status=%x, count=%x\n",data2,status,count);
FIFOT->status=0x0;
FIFOT->data =0x01;
FIFOT->data =0x12;
FIFOT->data =0x23;
FIFOT->data =0x34;
FIFOT->data =0x45;
FIFOT->data =0x56;
//
data2=FIFOT->inter;
status=FIFOT->status;
count=FIFOT->count;
printf("data2=%x,status=%x, count=%x\n",data2,status,count);
FIFOT->status=0x01; //control
data2=FIFOT->inter;
status=FIFOT->status;
count=FIFOT->count;
printf("data2=%x,status=%x, count=%x\n",data2,status,count);
Rdata=FIFOT->data;
data2=FIFOT->inter;
status=FIFOT->status;
count=FIFOT->count;
printf("data2=%x,status=%x, count=%x,Rdata=%x\n",data2,status,count,Rdata);
return 0;
}
状态字部分是:
if(address==2'b0)begin //status
readdata[0] <=Empty_Sig1;
readdata[1] <=Empty_Sig2;
readdata[2] <=Full_Sig1;
readdata[3] <=Full_Sig2;
end
9的意思是: 第一个是Empty,第2个是full
else begin //count
readdata[3:0] <=fifo_num1;
readdata[7:4] <=fifo_num2;
end
从程序看,我没有写那么多字节呀