在正点原子开发板中DDR的例子中,其中:
.wr_adrs ({wd_addr,3'd0}),
.wr_len ({wd_len,3'd0} ),
.rd_adrs ({rd_addr,3'd0}),
.rd_len ({rd_len,3'd0} ),
读写地址和BR后面都加入了三个零,请问一下为什么要加入三个零?4G的DDR加入三位后地址线就少了三位,容量是不是只有8分之一了?
现在修改例子保存多帧图像,每帧图像例如为1024*768=28'd786432,第一帧起始位置为0-786431,第二帧应该为786432-1572863,现在按理论地址写入第二帧发现DDR地址是不对的,请问下哪里需要修改?
代码如下:
// axi 控制模块
aq_axi_master u_aq_axi_master
(
.rst_n (rst_n && ddr3_init_done),
.clk (ui_clk ),
// Write address channel
.m_axi_awid (axi_awid ),
.m_axi_awaddr (axi_awaddr ),
.m_axi_awlen (axi_awlen ),
.m_axi_awvalid (axi_awvalid ),
.m_axi_awready (axi_awready ),
// Write data channel
.m_axi_wdata (axi_wdata ),//O
.m_axi_wstrb (axi_wstrb ),
.m_axi_wlast (axi_wlast ),
.m_axi_wready (axi_wready ),
// Read address channel
.m_axi_arid (axi_arid ),
.m_axi_araddr (axi_araddr ),
.m_axi_arlen (axi_arlen ),
.m_axi_arvalid (axi_arvalid ),
.m_axi_arready (axi_arready ),
// Read data channel
.m_axi_rdata (axi_rdata ), //I
.m_axi_rlast (axi_rlast ),
.m_axi_rvalid (axi_rvalid ),
// User control interface
.wr_start (wd_req ),
.wr_adrs ({wd_addr,3'd0}),
.wr_len ({wd_len,3'd0} ),
.wr_ready ( ),
.wr_fifo_re (wfifo_ren ),
.wr_fifo_empty (1'b0 ),
.wr_fifo_aempty (1'b0 ),
.wr_fifo_data (wfifo_rdata ),//I
.wr_done (wd_finish ),
.rd_start (rd_req ),
.rd_adrs ({rd_addr,3'd0}),
.rd_len ({rd_len,3'd0} ),
.rd_ready ( ),
.rd_fifo_we (rfifo_wen ),
.rd_fifo_full (1'b0 ),
.rd_fifo_afull (1'b0 ),
.rd_fifo_data (rfifo_wdata ),//O
.rd_done (rd_finish )
);
|