Outils pour utilisateurs

Outils du site


en202:vga_bitmap

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
en202:vga_bitmap [2022/09/07 15:25] – créée 78.229.230.2en202:vga_bitmap [2023/11/05 23:02] (Version actuelle) – [instanciation] Yannick Bornat
Ligne 1: Ligne 1:
 ====== Bitmap VGA output ====== ====== Bitmap VGA output ======
  
-Before the implementation of any of these modules, please, check if your design leaves enough memory resources for the required memory. Logic requirements are negligible and working frequency is above 395MHz in most cases.+**WARNING** : The module has recenty been updated... some information here might be obsolete... contact me for confirmation. 
 + 
 +Before the implementation of any of these modules, please, check if your design leaves enough memory resources for the required memory. Logic requirements are negligible and working frequency is high enough in most cases.
  
  
Ligne 11: Ligne 13:
   * reset is active high   * reset is active high
  
 +----
 +====instanciation====
 +
 +The most simple version is to be instanced with the following lines. Optional I/Os are not used, and might produce warnings, you can safely ignore them.
 +
 +
 +    display_module : entity work.vga_bitmap_640x480
 +        generic map(RAM_BPP  => 4,            -- number of bits per pixels
 +                    INDEXED  => 0,            -- do not used indexed colors
 +                    READBACK => 0)            -- read from bitmap memory disabled
 +                    
 +        port map(clk          => clk,         -- 100MHz system clock      
 +                 reset        => reset,       -- active high system reset
 +                 
 +                 VGA_hs       => VGA_hs,      -- VGA screen output
 +                 VGA_vs       => VGA_vs,
 +                 VGA_color    => VGA_color,
 +                 
 +                 pixel_x      => pixel_x,     -- pixel horizontal coordinate
 +                 pixel_y      => pixel_y,     -- pixel vertical coordinate
 +                 data_in      => data_in,     -- new color for the addressed pixel
 +                 data_write   => data_write); -- write order
 +
 +If data readback is required, it becomes :
 +  * **warning**: a 5 to 6 clock periods latency is necessary between the //data_read// assertion and //data_rout// assertion
 +  * data read requests can be pipelined
 +
 +
 +    display_module : entity work.vga_bitmap_640x480
 +        generic map(RAM_BPP  => 4,            -- number of bits per pixels
 +                    INDEXED  => 0,            -- do not used indexed colors
 +                    READBACK => 1)            -- read from bitmap memory enabled
 +                    
 +        port map(clk          => clk,         -- 100MHz system clock      
 +                 reset        => reset,       -- active high system reset
 +                 
 +                 VGA_hs       => VGA_hs,      -- VGA screen output
 +                 VGA_vs       => VGA_vs,
 +                 VGA_color    => VGA_color,
 +                 
 +                 pixel_x      => pixel_x,     -- pixel horizontal coordinate
 +                 pixel_y      => pixel_y,     -- pixel vertical coordinate
 +                 data_in      => data_in,     -- new color for the addressed pixel
 +                 data_write   => data_write,  -- write order
 +                 
 +                 data_read    => data_read,   -- read order
 +                 data_rout    => data_rout,   -- data read is ready
 +                 data_out     => data_out):   -- pixel read color
 +
 +The //end_of_frame// output signal might also be useful to synchronize display updates with screen refresh.
 ---- ----
 ==== addressing a pixel ==== ==== addressing a pixel ====
  
-Pixels are addressed by lines from the top left to the bottom right. For exampleusing a 160x100 resolution, the top left pixel has address 0, its right neighbor has  address 1, and the top right pixel has address 159 (0x009F). The Left pixel of the top second line has address 160 (0x00A0), and so on. The bottom left pixel has address 15840 (0x3DE0) and the bottom right has address 15999 (0x3E7F).+Pixels are addressed by x,y coordinates from the top left (0,0) to the bottom right (//xmax//, //ymax//).
  
 Different resolutions are available : Different resolutions are available :
-  * 160x100 +  * <del>160x120</del> (on request)
-  * 160x120 +
-  * 320x200+
   * 320x240   * 320x240
   * 640x480   * 640x480
Ligne 80: Ligne 130:
  
 ===== memory usage (Artix 7) ===== ===== memory usage (Artix 7) =====
- 
-All combinations could not be tested, so the information below may be incomplete. Please not that the following values are given for the Artix 7 family synthetized with ISE 14.7 . 
-  * For 160x100, half RAM block use the ability to split a 36kb block into two 18kb blocks. So using the 3bpp color representation requires one 36kb block and one 18kb block (the second half of the 36kb block used is still available) 
-  * For 320x240, the synthetizer is not able to split blocks because of address counting, so using a 3bpp representation will actually require 8 blocks (7.5 rounded to 8). 
-  * For 640x480, memory requirements may be very high, resulting in very high implementation times.  
-  * Being only a machine, the synthetizer is not able to perform high optimizations. For example, it is possible to use only 5 36k-block RAMs to perform a 160x120 resolution with 8bpp, instead of 8 required by the synthetizer. Implementing this optimization could be a nice project :) 
  
 ^ resolution ^ ISE synthesis ^ greedy Vivado (v1.1 and previous) ^ ^ resolution ^ ISE synthesis ^ greedy Vivado (v1.1 and previous) ^
-^ 160x100 |  0.5 BRAM / bpp  | 0.5 BRAM / bpp  | 
-^ 160x120 |  1 BRAM / bpp    | 1 BRAM / bpp    | 
-^ 320x200 |  2 BRAM / bpp    | 2 BRAM / bpp    | 
 ^ 320x240 |  2.5 BRAM / bpp  | 4 BRAM / bpp    | ^ 320x240 |  2.5 BRAM / bpp  | 4 BRAM / bpp    |
 ^ 640x480 |  10 BRAM / bpp   | 16 BRAM / bpp   | ^ 640x480 |  10 BRAM / bpp   | 16 BRAM / bpp   |
Ligne 96: Ligne 137:
 ===== Files ===== ===== Files =====
  
-  * {{ en202:vga_bitmap_160x100.vhd | file for 160x100 pixels resolution}} 
-  * {{ en202:vga_bitmap_160x120.vhd | file for 160x120 pixels resolution}} 
-  * {{ en202:vga_bitmap_320x200.vhd | file for 320x200 pixels resolution}} 
   * {{ en202:vga_bitmap_320x240.vhd | file for 320x240 pixels resolution}}   * {{ en202:vga_bitmap_320x240.vhd | file for 320x240 pixels resolution}}
   * {{ en202:vga_bitmap_640x480.vhd | file for 640x480 pixels resolution}}   * {{ en202:vga_bitmap_640x480.vhd | file for 640x480 pixels resolution}}
Ligne 104: Ligne 142:
 ===== Known bugs ===== ===== Known bugs =====
  
-Modules use excessively high memory resources when synthetising with Vivado. Versions 1.2 and above should soon fix this issue soon. Til then, 640x480 resolution can only be achieved at 8 bits/Pixel. (9 bits/pixel might work but was not tested, please give feedback concerning this limitation).+
en202/vga_bitmap.1662557147.txt.gz · Dernière modification : 2022/09/07 15:25 de 78.229.230.2