Ok @nockieboy, now that the GPU_talk RS232 memory sniffer/debugger is perfectly functional, your work on the controls and features for the GPU begins now. I'm sending an enhanced version of the GPU_talk with some added smart features for later tonight.
These are the following simple additions are required for your project before we make the address generator:
1. Modify the core of your sync_gen.v so that the position of the active video image is shifted 16 pixels to the right by 16 lines down. Remember, you will also need to move the sync signals as well so that the picture still remains centered with reference to the syncs timings. Make this 2 new parameters called "IMAGE_X_OFFSET" and "IMAGE_Y_OFFSET".
2. To vid_osd_generator.v, add and pass through these parameters:
A) 'GPU_powerup.mif' file
B) Memory Address Bits (take care as we want total bits here. This means when defining the top bit in a register, it would be this value -1)
C) Memory Words (If this field is left empty, it's value should be calculated from (B)'s parameter )
3. Make a new verilog module called 'GPU_HW_Control_Regs.v'. This module should be a mass of registers which which are all available in parallel to any other part of the GPU, with an 8 bit data & address[19:0] input write port, a reset input and reset parameters for the first 32 bytes. This one huge output register should be called GPU_HW_Control_regs[HW_REGS_SIZE*8-1:0]. Module specs:
a) All inputs, 8 bit data in, write data enable, 20 bit write address, and reset should be all register latched (yes, latch the reset input, then use that register's output as the module's reset). This latching offers better FMAX timing fitting if we need to run this module on the alternate slower clock frequency. (IE, 50 Mhz clock).
b) A parameter, HW_REGS_SIZE , for the quantity/size bulk of 8 bit registers. (Note, for your top hierarchy, block diagram design entry, you will place a 'param' which this module will use as it's setting, see attached image as an example.)
c) Base write address for the write input. The module will always take in all 20 address bits, but when writing data to the 8 bit data input port, the upper address wires [19:8] should equal this number for the write to be successful. If parameter (b) is >256, then the bottom of the upper base write address [8] will be ignored as you will be opening a 512 byte window, and so on. (Set this default to the base of the last 256 bytes in your system memory. Yes, it will occupy the same last 256 bytes as your system GPU ram.)
d) Reset parameters. Have 32 8 bit parameter settings which will be forced into the first 32 bytes if the reset signal is sent. Make the rest of the registers reset to 0.
4. Place an input for the 'bulk GPU_HW_Control_regs[HW_REGS_SIZE*8-1:0] registers' into the following verilog modules: sync_generator.v, vid_osd_generator.v, vid_out_stencil.v. Remember, you will need to receive the block diagram parameter into each module to get the right number of wires for the inputs.
5. Add a new 48 register output to the 'sync_gen.v' called 'raster_HV_trigger[47:0]'. Make the even 'raster_HV_trigger[47:0]' wires pulse at a horizontal pixel position and the odd wires pulse on a vertical line according to the new 'GPU_HW_Control_regs[HW_REGS_SIZE*8-1:0]' onput wire, organized as 16 bit words, using the first 10 of 16 bits of each 2x2 bytes coming from the new input "GPU_HW_Control_regs[HW_REGS_SIZE*8-1:0]". You should add a new parameter input to the sync_gen.v which will allow you to shift the beginning byte base (beginning) address of GPU_HW_Controls where the 'raster_HV_trigger' get their 48 settings from. IE 48x2 bytes = 96 bytes total. Once done, out on your top block diagram, 'or' these 48 HV triggers outputs together and 'or' tie them to to the upper ro[],go[],bo[] bits of the OSD_img output. Test with the GPUtalk app. You should be able to move 24 vertical lines and 24 horizontal lines around the screen, with the first 0-15 coordinates being non-visible as those coordinates are too far to the left and above the top of the picture since we moved the picture window by 16 pixels to the right and down in step (1). (Once working, mix and combine / change around the 'or' driven ro[]&go[]&bo[] colors VS raster_HV_trigger[47:0] even and odd pairs so each set of coordinate generated lines may generate a different color on the display.)
Show us your progress. Do one item at a time. For the new modules and functions, perform a functional simulation of each one to make sure their controls work before inserting it into your design, otherwise, you are guessing to what functions and what doesn't. Even show us the simulations as proof of functionality. (Do this step, and you will have a full GPU working in not time at all.)
This work is the preparation required for the image raster address generators as they require parallel hardware control registers and and some adjustable trigger events at adjustable locations during the display, including a setup time just before the active display begins.