Bounce a scan line at both edges
Online version: https://fpga.labsland.com/altera/computer-organization/lab-08/part-02/
Debugger setup
CPUlator simulatorC · DE1-SoC Nios V computer, simulated in your browser. No board or sign-in needed.
- Get the sourceDownload
main.c - Open the simulatorOpen CPUlator
Move a yellow line by one pixel per vertical refresh. It begins two rows from the top. The starter reaches the edge and stays there. Use both the VGA output and a breakpoint to find the faulty direction change.
In CPUlator choose C, use File → Open to load main.c, then Compile and Load (F5). Open the VGA pixel buffer device and use Continue (F3).
Stop on each frame
Go to next_row in Disassembly and place a breakpoint on the first instruction. Continue seven times. At each stop a0 is the row currently on screen. The previous frame has been erased. Check that the line still has the same two horizontal endpoints and that no colored trail remains. Clear the breakpoint to watch continuous motion.
Test the opposite edge
Repair the upper-edge condition. Run again from INITIAL_ROW equal to 2, then rebuild with INITIAL_ROW equal to 237. The starting direction points toward the nearer edge. Reapply the breakpoint after rebuilding.
| Start row | Seven row readings | First direction reversal |
|---|---|---|
| 2 | ||
| 237 |
Submit both sequences and a sketch of the line at an edge. Explain why a valid final row is 239 and why waiting for the vertical refresh improves the animation.
Original LabsLand activity following FPGAcademy Computer Organization Lab 8, Part II. FPGAcademy PDF · MIT
