Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial gateware code for VGA capture #215

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rohitk-singh
Copy link
Member

Changes:

  • Added gateware code for vga capture in gateware/vga
  • Added atlys_vga.py target for vga capture
  • Modified atlys platform file with vga pins
  • Added some firmware code for vga capure in ad9984a.c and vga_in.c

Doesn't have to merged compulsorily. If any suggestions or refactoring/restructuring ideas are there, they are welcome. Any comments also welcome.

Have to add rest of the firmware code for capture to work. There are some conflicts with the code, so haven't committed them yet. Looking into them right now

@mithro mithro changed the title Add initial code for VGA capture capibility Add initial code for VGA capture capability Mar 6, 2016


def do_simulation(self, selfp):
print ("cycle: {cycle} , hsync: {hsync}, vsync: {vsync}, de: {de}, r: {r}, g: {g}, b: {b}".format(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please fix the wrapping here.

Something like;

    print("cycle: {cycle} , hsync: {hsync}, vsync: {vsync}, de: {de}, r: {r}, g: {g}, b: {b}".format(
        cycle = selfp.simulator.cycle_counter,
        hsync = selfp.hsync,
        vsync = selfp.vsync,
        de = selfp.de,
        r = selfp.r,
        g = selfp.g,
        b = selfp.b,
        ))

@mithro
Copy link
Member

mithro commented Mar 6, 2016

Hi @rohit91,

Generally things are looking pretty good but there are some small formatting issues. Can you please do the following things;

  • Run the python code through pep8. Due to the way migen code is generally formatted, you won't be able to be 100% pep8 clean, but it should at least show you where you have some formatting problems.
  • Fix tabs/spaces in the C code. It seems most of the existing code uses tabs.

@mithro
Copy link
Member

mithro commented Mar 6, 2016

@enjoy-digital Can you take a close look at the migen code?

@mithro
Copy link
Member

mithro commented Mar 24, 2016

@rohit91 Was this the code that @CarlFK got working today?

* www.analog.com/media/en/technical-documentation/data-sheets/AD9984A.pdf
*
* Code below is for AD9984A based VGA capturing for HDMI2USB using VGA
* Expansion Board for Atlys(https://github.com/timvideos/HDMI2USB-vmodvga)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space between Atlys and (

@rohitk-singh rohitk-singh changed the title Add initial code for VGA capture capability Initial gateware code for VGA capture Aug 6, 2016
@rohitk-singh
Copy link
Member Author

Starting afresh.

Changes:

  • Initial gateware code for vga capture in gateware/vga
  • Modified platforms/atlys.py platform file by adding vga signals

@mithro Can you look at this and see if it can be merged or not. pep8 checks are ok (only visual indentation warnings and few >79 line-length warnings). I have incorporated all of @enjoy-digital's suggestions he had after his review. This gateware code is all that is necessary for vga capture. I'll be creating separate pull requests each for firmware and for target.

self.counterY.eq(0),
),

# VGA Scan Timing Values used below for 1024x768@60Hz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a TODO to make this configurable / controllable?

Files:
    new file:   gateware/vga/__init__.py
    new file:   gateware/vga/analysis.py
    new file:   gateware/vga/datacapture.py

__init__.py:
    Implements VGAIn module which instantiates submodules
    Datacapture, FrameExtrantion and DMA, and connects them

analysis.py:
    Implements FrameExtraction module, which is reponsible
    for sof(start of frame) detection, color space conversion,
    framing(packing) and also uses async fifo to move data
    from VGA pixel clock domain to sys_clk domain

datacapture.py:
    Implements DataCapture module which is responsible for
    capturing pixel data at proper time, depending on HSYNC
    and VSYNC signals

Currently only supports 1024x768@60Hz resolution capture
VGAIn modules gives VGA capture functionality to atlys.
Also, we are now inheriting BaseSoC class directly instead of
MinoSoC
Added to _io_vccb2_3v3 list because currently VGA signals are driven
at 3.3V. This is going to change and become configurable later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants