Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pcie_core] Cannot access DDR data from high address #45

Open
lerwys opened this issue Jun 12, 2015 · 2 comments
Open

[pcie_core] Cannot access DDR data from high address #45

lerwys opened this issue Jun 12, 2015 · 2 comments
Labels

Comments

@lerwys
Copy link
Contributor

lerwys commented Jun 12, 2015

Problem: We can't read data from DDR from pages larger than 10-bits.

The problem appears when I try to read the DDR memory from AFCv3 through
PCIe. As I'm aware the DDR size is 4 GB (2^30 words of 32 bit = 4GB), right?

With that in mind I'm trying to read from DDR page 896, for instance. This gives us
1110000000 in binary, which are 10 bits. So far, so good.

When I try to read from DDR page 1152, which is 10010000000 (11 bits) in binary,
I don't get any valid data, just garbage.

Having a look at rx_MRd_Channel.vhd, which is located in https://github.com/lnls-dig/bpm-gw/blob/devel/hdl/modules/pcie/common/rx_MRd_Channel.vhd (I don't know if this is the
right place to look for this issue) file I see the following lines where sdram_pg is used:

392 pioCplD_din(C_CHBUF_DDA_BIT_TOP downto C_CHBUF_DDA_BIT_BOT)                  
393   <= sdram_pg(C_CHBUF_DDA_BIT_TOP-C_CHBUF_DDA_BIT_BOT-C_DDR_PG_WIDTH downto 0) &
394       m_axis_rx_tdata_r1(C_DDR_PG_WIDTH-1+32 downto 0+32);
...
412 pioCplD_din(C_CHBUF_DDA_BIT_TOP downto C_CHBUF_DDA_BIT_BOT)       
413   <= sdram_pg(C_CHBUF_DDA_BIT_TOP-C_CHBUF_DDA_BIT_BOT-C_DDR_PG_WIDTH downto 0) &  
414       m_axis_rx_tdata_r1(C_DDR_PG_WIDTH-1 downto 0); 

If my math is correct sdram_pg(C_CHBUF_DDA_BIT_TOP-C_CHBUF_DDA_BIT_BOT-C_DDR_PG_WIDTH downto 0) translates to sdram_pg(9 downto 0), which has only the 10 LSB.

@lerwys lerwys added the bug label Jun 12, 2015
lerwys added a commit that referenced this issue Nov 11, 2016
The previous DDR depth was hardcoded as 30,
which is right for kc705 board, but not for
AFC.

This fixes that by using the ipcores_pkg
definitions which are respective to the
DDR definitions of the used board.

This should help github issue #45,
but in my tests it didn't solve it
just yet. Nonethless, this was wrong
anyway.
@augustofg
Copy link
Member

Is this still an issue? @ericonr

@ericonr
Copy link
Member

ericonr commented Mar 16, 2023

As I'm aware the DDR size is 4 GB (2^30 words of 32 bit = 4GB), right?

I believe this is incorrect, because the DDR size is 2GB. Either way, being limited to 10 bits would still restrict us to 1GB of it.

Does it make sense to test this with the AFCv4, or should it be with the BPM gateware specifically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants