# Read VGA pixel value from SRAM in VHDL

I'm using a SRAM in order to store a frame that I have to display on screen with the VGA interface. I need to read the pixel value from the SRAM and then send it to the VGA monitor. I have created a SRAM Controller but it takes some clock cycles before the data are available. I don't know how to access to the RAM without exit from the Pixel process.

Here's a simplified part of the code:

process (CLK_25MHZ)
begin
if (CLK_25MHZ'event and CLK_25MHZ = '1') then
if (ACTIVE_VIDEO) then
-- This part is repeated for every pixel and I can't exit from this part
-- until I have sent the pixel data. If I exit this pixel is lost.
-- I need something like this:
else
VGA_RGB <= "000000000000";
end if;
-- Here there are the signals timings.
end if;
end process;

• How many cycles does your SRAM controller take to read? Can it be pipelined? Does it run at a higher frequency? – pjc50 May 29 '13 at 18:50
• In order to generate a 640x480x60Hz display, you need to produce pixels at a 25 MHz rate. If your SRAM can't deliver fresh data on every clock cycle, it doesn't have the bandwidth required to support this application. – Dave Tweed May 29 '13 at 18:57
• @pjc50. The controller run at an higher frequency and now need 5 clock cycles to read the RAM. I will optimize the controller and as soon as possible use a faster RAM but for now it is slower than what the VGA requires. I think that an idea can be starts to read data for a pixel in the previous pixel. Is it correct? – Oceanic815 May 29 '13 at 18:57
• @Brian Carlton. I have inserted the CALCULATE_ADDRESS row only for make sense at the next line. I haven't already wrote this part but I haven't problem for this. – Oceanic815 May 29 '13 at 19:00