Altera_Forum
Honored Contributor
9 years agoqsys sdram controller address mapping
Hi,
In a qsys design I'm using the SDRAM Controller Core to control either a 2Mx32 or 4Mx32 SDRAM. My goal is to use a common FPGA image rather than have an image that is unique for each size of SDRAM. Thus I have specified the larger 4Mx32 device in my design. Operationally both devices work, but the resulting address map for the 2Mx32 is problematic. Rather than having one 8MB chunk at address 0 and a mirror at address 0x800000, the map is 4MB chunk 0, mirror of chunk 0, 4MB chunk 1, mirror of chunk 1. This is due to the way the SDRAM controller maps the avalon address signals to the SDRAM address pins. For my use case of a 4Mx32 (AS4C4M32S), the controller maps the address signals as follows: A9-A2 -> column 7-0 A10 -> bank address 0 A22-A11 -> row 11-0 A23 -> bank address 1 Note how A23 is connected to bank address 1. This is what is causing the fragmented mirroring. Since row address 11 does not exist on the 2Mx32 device, I need to have A23 map to row address 11. This would give me an 8MB contiguous chunk starting at 0, followed by an 8MB mirror when using a 2Mx32 device. Is there an easy way to achieve this? I'd prefer not to have to hack the SDRAM controller, if that's even possible. thanks, galen