Forum Discussion
Altera_Forum
Honored Contributor
13 years agoYou can use a ready-made DMA such as Altera's SGDMA, or the modular SGDMA available on the wiki. Those DMAs can be configured to put the read data in an Avalon Stream that you can connect to the VGA controller. It is recommended to put a fifo between the DMA and the VGA controller. On one side the video controller will not read new data on each clock cycle (it won't read any data during the horizontal and vertical blanks), and on the other side the DMA uses pipelining, so when new data arrives from the memory, it must be stored somewhere if the VGA controller doesn't want it straight away.
About your code, if your CPU uses a data cache, then the value -1 was most probably written to the cache but never committed outside the CPU. Try to use the IOWR macro to access your slave instead.