[Open-graphics] more about video test logic

Timothy Miller theosib at gmail.com
Fri Oct 6 10:14:36 EDT 2006


One other suggestion I have:

Since we want to run the vertical machine only when horiz=H_TOTAL-1,
there's a way to do this and not have a nasty comparator hooked to the
vertical machine.  What you do is have a register that is true only
when horiz=H_TOTAL-1, and to do that, you need to detect it a cycle
earlier (when horiz=H_TOTAL-2) (because registering things causes a
cycle delay), so...


// Vertical machine
always @(...)
    ... reset ...
    begin
        last_pixel <= 0;
        ....
            case H_TOTAL-2:  last_pixel <= 1;
    end
end


// Horizontal machine
always @(...)
    ... reset ...
    begin
        if (last_pixel) begin
            .... vertical machine ...
        end
    end
end


I'd really like to throw at you some optimizations that will reduce
logic and improve speed, but right now, we need something that runs at
like 40MHz, and we need it rather quickly.  For pedagogical purposes,
we can continue to work on it after we have a working model.


More information about the Open-graphics mailing list